LP1204123 Don't treat interrupts as errors
authorBill Erickson <berick@esilibrary.com>
Wed, 24 Jul 2013 20:28:15 +0000 (16:28 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 4 Sep 2013 15:07:59 +0000 (11:07 -0400)
Interrupted calls to select() are generally not errors, but more likely
signals received by the process.  Avoid setting the transport_client
error flag to true in these cases.  Otherwise, after one signal is
received, no other outbound communication can occur on the client
connection.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>

src/libopensrf/transport_client.c
src/libopensrf/transport_session.c

index 79f0aa6..2a86d0c 100644 (file)
@@ -250,9 +250,7 @@ transport_message* client_recv( transport_client* client, int timeout ) {
 
        transport_message* msg = NULL;
 
-       if( error )
-               client->error = 1;
-       else if( client->msg_q_head != NULL ) {
+       if( !error && client->msg_q_head != NULL ) {
                /* got message(s); dequeue the oldest one */
                msg = client->msg_q_head;
                client->msg_q_head = msg->next;
index 67bda87..4d2f7f6 100644 (file)
@@ -285,7 +285,6 @@ int session_wait( transport_session* session, int timeout ) {
 
        if( ret ) {
                osrfLogDebug(OSRF_LOG_MARK, "socket_wait returned error code %d", ret);
-               session->state_machine->connected = 0;
        }
        return ret;
 }