Browse Source

some more fixes

1.0.0
Georg Hopp 11 years ago
parent
commit
b290c2eb19
  1. 3
      include/Makefile.am
  2. 8
      src/cep_buffer_read.c
  3. 7
      src/cep_write_buffered.c

3
include/Makefile.am

@ -1,4 +1,5 @@
nobase_include_HEADERS = tr/comm_end_point.h \
nobase_include_HEADERS = trcomm.h \
tr/comm_end_point.h \
tr/comm_manager.h \
tr/comm_manager_poll.h \
tr/connect_entry_point.h \

8
src/cep_buffer_read.c

@ -28,14 +28,16 @@
int
cepBufferedRead(TR_CommEndPoint this)
{
TR_RemoteData data = TR_socketRecv(this->transport);
TR_RemoteData data = TR_socketRecv(this->transport, this->read_chunk_size);
if (! data) return FALSE;
while (data) {
TR_cepAppendReadData(data);
data = TR_socketRecv(this->transport);
TR_cepAppendReadData(this, data);
data = TR_socketRecv(this->transport, this->read_chunk_size);
}
return TRUE;
}
// vim: set ts=4 sw=4:

7
src/cep_write_buffered.c

@ -26,7 +26,7 @@
#include "tr/comm_end_point.h"
int
cepBufferedRead(TR_CommEndPoint this)
cepWriteBuffered(TR_CommEndPoint this)
{
TR_RemoteData data = TR_cepNextWriteData(this);
int send = 0;
@ -34,11 +34,14 @@ cepBufferedRead(TR_CommEndPoint this)
while (data) {
int current_send = TR_socketSend(this->transport, data);
send += current_send;
// TODO if nothing was send put it back into the queue..
// and stop loop. (This was a close.)
data = TR_socketRecv(this->transport);
data = TR_cepNextWriteData(this);
}
return TRUE;
}
// vim: set ts=4 sw=4:
Loading…
Cancel
Save