Fix handle connection reset during session init

Patch to handle nmap version probes.

Signed-off-by: Dhammika Pathirana <dhammika@gmail.com>
This commit is contained in:
Dhammika Pathirana
2011-01-20 07:52:40 +01:00
committed by Martin Sustrik
parent 56bdba592c
commit c91bf25645
2 changed files with 5 additions and 1 deletions

View File

@@ -91,6 +91,10 @@ namespace zmq
// bytes actually processed.
inline size_t process_buffer (unsigned char *data_, size_t size_)
{
// Check if we had an error in previous attempt.
if (unlikely (!(static_cast <T*> (this)->next)))
return (size_t) -1;
// In case of zero-copy simply adjust the pointers, no copying
// is required. Also, run the state machine in case all the data
// were processed.

View File

@@ -151,7 +151,7 @@ void zmq::zmq_engine_t::in_event ()
inout->flush ();
}
if (disconnection)
if (inout && disconnection)
error ();
}