From: erickson Date: Mon, 17 Jul 2006 00:24:56 +0000 (+0000) Subject: Fixed issue: when the router received two messages on a single socket that both fit... X-Git-Tag: osrf_rel_2_0_1~1125 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a6f1ab3ee445178c5bf12a2a12e60ce77242577b;p=OpenSRF.git Fixed issue: when the router received two messages on a single socket that both fit into 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 --- diff --git a/src/router/osrf_router.c b/src/router/osrf_router.c index 87ab2a7..093d62a 100644 --- a/src/router/osrf_router.c +++ b/src/router/osrf_router.c @@ -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];