Browse Source

some more fixes

1.0.0
Georg Hopp 12 years ago
parent
commit
ed9ff63029
  1. 6
      src/cep_write_buffered.c
  2. 2
      src/i_comm_manager.c
  3. 7
      src/io_handler.c

6
src/cep_write_buffered.c

@ -33,11 +33,13 @@ TR_cepWriteBuffered(TR_CommEndPoint this)
switch (send) { switch (send) {
case FALSE: // EAGAIN case FALSE: // EAGAIN
TR_queuePutFirst(this->write_buffer, data);
break;
case -1: // FAILURE case -1: // FAILURE
case -2: // remote close case -2: // remote close
return send;
default: default:
TR_delete(data);
break; break;
} }

2
src/i_comm_manager.c

@ -122,9 +122,11 @@ TR_commManagerClose(void * _this, TR_Event event)
while (! this->endpoints[--this->max_handle]); while (! this->endpoints[--this->max_handle]);
} }
if (this->endpoints[endpoint->transport->handle]) {
TR_eventSubjectFinalize( TR_eventSubjectFinalize(
(TR_EventSubject)this->endpoints[endpoint->transport->handle]); (TR_EventSubject)this->endpoints[endpoint->transport->handle]);
this->endpoints[endpoint->transport->handle] = NULL; this->endpoints[endpoint->transport->handle] = NULL;
}
return TR_EVENT_DONE; return TR_EVENT_DONE;
} }

7
src/io_handler.c

@ -97,17 +97,10 @@ ioHandlerWrite(void * _this, TR_Event event)
switch (TR_cepWriteBuffered((TR_CommEndPoint)event->subject)) { switch (TR_cepWriteBuffered((TR_CommEndPoint)event->subject)) {
case FALSE: // EAGAIN case FALSE: // EAGAIN
if (TR_cepHasPendingData((TR_CommEndPoint)event->subject)) {
revent = TR_eventSubjectEmit( revent = TR_eventSubjectEmit(
event->subject, event->subject,
TR_CEP_EVENT_PENDING_DATA, TR_CEP_EVENT_PENDING_DATA,
NULL); NULL);
} else {
revent = TR_eventSubjectEmit(
event->subject,
TR_CEP_EVENT_END_DATA,
NULL);
}
break; break;
case -1: // FAILURE case -1: // FAILURE

Loading…
Cancel
Save