Browse Source

set also the accepted sockets to nonblocking

1.0.0
Georg Hopp 11 years ago
parent
commit
67eaeba4c6
  1. 2
      src/connection.c
  2. 1
      src/connector.c

2
src/connection.c

@ -64,7 +64,7 @@ connectionNextMessage(void * _this)
TR_RemoteData data = TR_queueGet(comm->read_buffer); TR_RemoteData data = TR_queueGet(comm->read_buffer);
size_t end; size_t end;
if (NULL == this->current_message || this->current_message->ready)
if (data && (! this->current_message || this->current_message->ready))
{ {
this->current_message = this->current_message =
TR_protoCreateMessage(comm->protocol, data->remote); TR_protoCreateMessage(comm->protocol, data->remote);

1
src/connector.c

@ -59,6 +59,7 @@ connectorAccept(void * _this, TR_Event event)
(TR_TcpSocket)connection->transport); (TR_TcpSocket)connection->transport);
while (socket) { while (socket) {
TR_socketNonblock((TR_Socket)socket);
TR_Connection new_con = TR_new( TR_Connection new_con = TR_new(
TR_Connection, TR_Connection,
socket, socket,

Loading…
Cancel
Save