From f13493edb2aae228ddbe70cc2f0609c541faf2d7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 31 Mar 2014 22:23:55 -0700 Subject: Oops... turns out we need to differentiate incoming from outgoing TCP and indeed learn incoming TCP paths. Otherwise the recipient of a TCP connection does not know to reply via TCP! Heh. --- node/TcpSocket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'node/TcpSocket.cpp') diff --git a/node/TcpSocket.cpp b/node/TcpSocket.cpp index 7dbcc4e1..b21cbd5e 100644 --- a/node/TcpSocket.cpp +++ b/node/TcpSocket.cpp @@ -72,7 +72,6 @@ bool TcpSocket::send(const InetAddress &to,const void *msg,unsigned int msglen) return true; // sanity check Mutex::Lock _l(_writeLock); - bool writeInProgress = ((_outptr != 0)||(_connecting)); // Ensure that _outbuf is large enough @@ -144,9 +143,10 @@ bool TcpSocket::notifyAvailableForRead(const SharedPtr &self,SocketManag if ((pl)&&(p >= pl)) { Buffer data(_inbuf + 5,pl - 5); - sm->handleReceivedPacket(self,_remote,data); - memmove(_inbuf,_inbuf + pl,p - pl); - p -= pl; + memmove(_inbuf,_inbuf + pl,p -= pl); + try { + sm->handleReceivedPacket(self,_remote,data); + } catch ( ... ) {} // handlers should not throw pl = 0; } } -- cgit v1.2.3