File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 33
44#define MAX_TRANSACTIONS 4096
55
6- #define BUFFER_SIZE (64 * 1024)
6+ #define BUFFER_SIZE (256 * 1024)
77#define LISTEN_QUEUE_SIZE 100
88#define MAX_STREAMS 4096
99
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ bool server_start(server_t server) {
128128 return true;
129129}
130130
131+ long sent_messages ;
132+ long sent_bytes ;
133+
131134static bool stream_flush (stream_t stream ) {
132135 int tosend = stream -> output .ready ;
133136 if (tosend == 0 ) {
@@ -138,12 +141,14 @@ static bool stream_flush(stream_t stream) {
138141 char * cursor = stream -> output .data ;
139142 while (tosend > 0 ) {
140143 // repeat sending until we send everything
141- int sent = send (stream -> fd , cursor , tosend , 0 );
144+ int sent = send (stream -> fd , cursor , tosend , 0 );
142145 if (sent == -1 ) {
143146 shout ("failed to flush the stream\n" );
144147 stream -> good = false;
145148 return false;
146149 }
150+ sent_messages += 1 ;
151+ sent_bytes += sent ;
147152 cursor += sent ;
148153 tosend -= sent ;
149154 assert (tosend >= 0 );
You can’t perform that action at this time.
0 commit comments