diff --git a/include/tr/comm_manager.h b/include/tr/comm_manager.h index f8111ee..3aac5e7 100644 --- a/include/tr/comm_manager.h +++ b/include/tr/comm_manager.h @@ -51,4 +51,3 @@ TR_EventDone TR_commManagerShutdown(void *, TR_Event event); #endif // __TR_COMM_MANAGER_H__ // vim: set ts=4 sw=4: - diff --git a/src/cep_write_buffered.c b/src/cep_write_buffered.c index 57377b9..2f73b81 100644 --- a/src/cep_write_buffered.c +++ b/src/cep_write_buffered.c @@ -47,8 +47,6 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) case -1: // FAILURE case -2: // remote close TR_delete(data); - TR_queueDestroy(this->write_buffer); - *size = this->write_buffer_size; break; default: @@ -71,7 +69,7 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) } break; } - + if (send <= 0) break; } diff --git a/src/comm_end_point.c b/src/comm_end_point.c index d0fc31c..5ad3435 100644 --- a/src/comm_end_point.c +++ b/src/comm_end_point.c @@ -118,7 +118,7 @@ const char * TR_cepEventStrings[] = { "TR_CEP_EVENT_SHUT_WRITE", "TR_CEP_EVENT_CLOSE", }; - + intptr_t comm_end_point_events[TR_CEP_EVENT_MAX + 1]; TR_INIT_IFACE(TR_Class, commEndPointCtor, commEndPointDtor, NULL); TR_INIT_IFACE(TR_CommEndPoint, NULL, NULL); diff --git a/src/connector.c b/src/connector.c index 2c03a2e..e696226 100644 --- a/src/connector.c +++ b/src/connector.c @@ -62,7 +62,7 @@ connectorAccept(void * _this, TR_Event event) while (socket) { TR_socketNonblock((TR_Socket)socket); TR_Connection new_con = TR_new( - TR_Connection, + TR_Connection, socket, connection->protocol, CEP_DEFAULT_READ_SIZE); diff --git a/src/protocol_handler.c b/src/protocol_handler.c index ad4fff2..f34d58c 100644 --- a/src/protocol_handler.c +++ b/src/protocol_handler.c @@ -101,7 +101,7 @@ protocolHandlerCompose(void * _this, TR_Event event) NULL)); } - if (endpoint->write_buffer->nmsg == 1) { + if (TR_queueSize(endpoint->write_buffer) >= 1) { TR_eventHandlerIssueEvent( (TR_EventHandler)_this, TR_eventSubjectEmit(