summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-12 04:24:31 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-12 04:24:31 +0000
commitea80e7dfbe4ceddd9bb67968b6bae7a48a7ee195 (patch)
tree9f2951a3de5705f2174cb05a1ee5b90a014e997b /apps
parent3effb49b5076ccd28a7d9e5452e8f03622a44d63 (diff)
downloadATCD-ea80e7dfbe4ceddd9bb67968b6bae7a48a7ee195.tar.gz
Both transmit and transmit_stdin should return proper status of transmission.
Diffstat (limited to 'apps')
-rw-r--r--apps/Gateway/Peer/Peer.cpp11
-rw-r--r--apps/Gateway/Peer/Peer.h6
2 files changed, 10 insertions, 7 deletions
diff --git a/apps/Gateway/Peer/Peer.cpp b/apps/Gateway/Peer/Peer.cpp
index 47ee65b5a26..a4c17e6218b 100644
--- a/apps/Gateway/Peer/Peer.cpp
+++ b/apps/Gateway/Peer/Peer.cpp
@@ -57,7 +57,7 @@ Peer_Handler::open (void *a)
return 0;
}
-void
+int
Peer_Handler::transmit (ACE_Message_Block *mb,
size_t n,
int event_type)
@@ -89,7 +89,9 @@ Peer_Handler::transmit (ACE_Message_Block *mb,
// Caller is responsible for freeing a ACE_Message_Block
// if failures occur.
mb->release ();
+ return -1;
}
+ return 0;
}
// Read events from stdin and send them to the gatewayd.
@@ -130,13 +132,14 @@ Peer_Handler::transmit_stdin (void)
break;
/* NOTREACHED */
default:
- this->transmit (mb, n, ROUTING_EVENT);
- break;
+ return this->transmit (mb, n, ROUTING_EVENT);
/* NOTREACHED */
}
+ return 0;
}
- return 0;
+ ACE_DEBUG ((LM_DEBUG, "Must transmit over an opened channel.\n"));
+ return -1;
}
// Perform a non-blocking <put> of event MB. If we are unable to send
diff --git a/apps/Gateway/Peer/Peer.h b/apps/Gateway/Peer/Peer.h
index 80707d9e3e1..67b9a936dd7 100644
--- a/apps/Gateway/Peer/Peer.h
+++ b/apps/Gateway/Peer/Peer.h
@@ -94,9 +94,9 @@ public:
protected:
typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> inherited;
- void transmit (ACE_Message_Block *mb,
- size_t n,
- int event_type);
+ int transmit (ACE_Message_Block *mb,
+ size_t n,
+ int event_type);
// Transmit <mb> to the gatewayd.
virtual int recv (ACE_Message_Block *&mb);