Fixed issue: when the router received two messages on a single socket that both fit...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 17 Jul 2006 00:24:56 +0000 (00:24 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Mon, 17 Jul 2006 00:24:56 +0000 (00:24 +0000)
the read buffer, only the first message was being processed

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@748 9efc2488-bf62-4759-914b-345cdb29e865

src/router/osrf_router.c

index 87ab2a7..093d62a 100644 (file)
@@ -104,10 +104,14 @@ void osrfRouterHandleIncoming( osrfRouter* router ) {
 
        transport_message* msg = NULL;
 
-       if( (msg = client_recv( router->connection, 0 )) ) { 
+       //if( (msg = client_recv( router->connection, 0 )) ) { 
+       while( (msg = client_recv( router->connection, 0 )) ) { 
 
                if( msg->sender ) {
 
+                       osrfLogDebug(OSRF_LOG_MARK, 
+                               "osrfRouterHandleIncoming(): investigating message from %s", msg->sender);
+
                        /* if the sender is not a trusted server, drop the message */
                        int len = strlen(msg->sender) + 1;
                        char domain[len];
@@ -130,10 +134,13 @@ int osrfRouterClassHandleIncoming( osrfRouter* router, char* classname, osrfRout
        transport_message* msg;
        osrfLogDebug( OSRF_LOG_MARK, "osrfRouterClassHandleIncoming()");
 
-       if( (msg = client_recv( class->connection, 0 )) ) {
+       while( (msg = client_recv( class->connection, 0 )) ) {
 
                if( msg->sender ) {
 
+                       osrfLogDebug(OSRF_LOG_MARK, 
+                               "osrfRouterClassHandleIncoming(): investigating message from %s", msg->sender);
+
                        /* if the client is not from a trusted domain, drop the message */
                        int len = strlen(msg->sender) + 1;
                        char domain[len];