diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-09-11 01:54:48 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-09-11 01:54:48 +0000 |
commit | 4144058a22d274e9262c73dbf3089fd4f96cddf8 (patch) | |
tree | 788b8b21ee0c13cb07e57a1ad2fef646db00b55e /apps | |
parent | 69d209981e0d6abdc525b034bf38b1ff381f4205 (diff) | |
download | ATCD-4144058a22d274e9262c73dbf3089fd4f96cddf8.tar.gz |
ChangeLogTag:Mon Sep 10 18:59:24 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp | 27 | ||||
-rw-r--r-- | apps/Gateway/Peer/Peer.cpp | 12 |
2 files changed, 22 insertions, 17 deletions
diff --git a/apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp b/apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp index 26a794c9902..826a7331f05 100644 --- a/apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp +++ b/apps/Gateway/Gateway/Concrete_Connection_Handlers.cpp @@ -70,9 +70,20 @@ Consumer_Handler::nonblk_put (ACE_Message_Block *event) ssize_t n = this->send (event); - - if (n == -1 && errno == EWOULDBLOCK) // Didn't manage to send everything. + if (n == -1) { + // -1 is returned only when things have really gone wrong (i.e., + // not when flow control occurs). Thus, let's try to close down + // and set up a new reconnection by calling handle_close(). + this->state (Connection_Handler::FAILED); + this->handle_close (); + return -1; + } + eise if (errno == EWOULDBLOCK) + { + // We didn't manage to send everything, so we need to queue + // things up. + ACE_DEBUG ((LM_DEBUG, "(%t) queueing activated on handle %d to routing id %d\n", this->get_handle (), @@ -95,16 +106,8 @@ Consumer_Handler::nonblk_put (ACE_Message_Block *event) -1); return 0; } - else if (n == -1) - { - // Things have gone wrong, let's try to close down and set up a - // new reconnection by calling handle_close(). - this->state (Connection_Handler::FAILED); - this->handle_close (); - return -1; - } - - return n; + else + return n; } ssize_t diff --git a/apps/Gateway/Peer/Peer.cpp b/apps/Gateway/Peer/Peer.cpp index 6f6bc8f9f4f..1198e4b15a7 100644 --- a/apps/Gateway/Peer/Peer.cpp +++ b/apps/Gateway/Peer/Peer.cpp @@ -185,7 +185,11 @@ Peer_Handler::nonblk_put (ACE_Message_Block *mb) ssize_t n = this->send (mb); - if (n == -1 && errno == EWOULDBLOCK) + if (n == -1) + // -1 is returned only when things have really gone wrong (i.e., + // not when flow control occurs). + return -1; + else if (errno == EWOULDBLOCK) { // We didn't manage to send everything, so requeue. ACE_DEBUG ((LM_DEBUG, @@ -210,10 +214,8 @@ Peer_Handler::nonblk_put (ACE_Message_Block *mb) -1); return 0; } - else if (n == -1) - return -1; - - return n; + else + return n; } // Finish sending a event when flow control conditions abate. This |