Commit b290c2eb194167b4b44f189c2196b84282413491

Authored by Georg Hopp
1 parent 449041ae

some more fixes

1 -nobase_include_HEADERS = tr/comm_end_point.h \ 1 +nobase_include_HEADERS = trcomm.h \
  2 + tr/comm_end_point.h \
2 tr/comm_manager.h \ 3 tr/comm_manager.h \
3 tr/comm_manager_poll.h \ 4 tr/comm_manager_poll.h \
4 tr/connect_entry_point.h \ 5 tr/connect_entry_point.h \
@@ -28,14 +28,16 @@ @@ -28,14 +28,16 @@
28 int 28 int
29 cepBufferedRead(TR_CommEndPoint this) 29 cepBufferedRead(TR_CommEndPoint this)
30 { 30 {
31 - TR_RemoteData data = TR_socketRecv(this->transport); 31 + TR_RemoteData data = TR_socketRecv(this->transport, this->read_chunk_size);
32 32
33 if (! data) return FALSE; 33 if (! data) return FALSE;
34 34
35 while (data) { 35 while (data) {
36 - TR_cepAppendReadData(data);  
37 - data = TR_socketRecv(this->transport); 36 + TR_cepAppendReadData(this, data);
  37 + data = TR_socketRecv(this->transport, this->read_chunk_size);
38 } 38 }
  39 +
  40 + return TRUE;
39 } 41 }
40 42
41 // vim: set ts=4 sw=4: 43 // vim: set ts=4 sw=4:
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 #include "tr/comm_end_point.h" 26 #include "tr/comm_end_point.h"
27 27
28 int 28 int
29 -cepBufferedRead(TR_CommEndPoint this) 29 +cepWriteBuffered(TR_CommEndPoint this)
30 { 30 {
31 TR_RemoteData data = TR_cepNextWriteData(this); 31 TR_RemoteData data = TR_cepNextWriteData(this);
32 int send = 0; 32 int send = 0;
@@ -34,11 +34,14 @@ cepBufferedRead(TR_CommEndPoint this) @@ -34,11 +34,14 @@ cepBufferedRead(TR_CommEndPoint this)
34 while (data) { 34 while (data) {
35 int current_send = TR_socketSend(this->transport, data); 35 int current_send = TR_socketSend(this->transport, data);
36 36
  37 + send += current_send;
37 // TODO if nothing was send put it back into the queue.. 38 // TODO if nothing was send put it back into the queue..
38 // and stop loop. (This was a close.) 39 // and stop loop. (This was a close.)
39 40
40 - data = TR_socketRecv(this->transport); 41 + data = TR_cepNextWriteData(this);
41 } 42 }
  43 +
  44 + return TRUE;
42 } 45 }
43 46
44 // vim: set ts=4 sw=4: 47 // vim: set ts=4 sw=4:
Please register or login to post a comment