From 67eaeba4c6c61be7208e672b1197fa4dda2fc4dd Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Tue, 12 Aug 2014 18:27:06 +0100 Subject: [PATCH] set also the accepted sockets to nonblocking --- src/connection.c | 2 +- src/connector.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index 16c2458..f052618 100644 --- a/src/connection.c +++ b/src/connection.c @@ -64,7 +64,7 @@ connectionNextMessage(void * _this) TR_RemoteData data = TR_queueGet(comm->read_buffer); size_t end; - if (NULL == this->current_message || this->current_message->ready) + if (data && (! this->current_message || this->current_message->ready)) { this->current_message = TR_protoCreateMessage(comm->protocol, data->remote); diff --git a/src/connector.c b/src/connector.c index fc1a9f4..04817f1 100644 --- a/src/connector.c +++ b/src/connector.c @@ -59,6 +59,7 @@ connectorAccept(void * _this, TR_Event event) (TR_TcpSocket)connection->transport); while (socket) { + TR_socketNonblock((TR_Socket)socket); TR_Connection new_con = TR_new( TR_Connection, socket,