Commit cf3eb7b3bce4d5a77db42d712070d94be494d1b2

Authored by Georg Hopp
1 parent 6c66a61b

Fix uninitialized read_chunk_size in all communication endpoint constructor calls

... ... @@ -27,7 +27,11 @@
27 27 #include "tr/connect_entry_point.h"
28 28
29 29 void
30   -TR_serverBindTcp(TR_Server this, const char * host, int port, TR_Protocol proto)
  30 +TR_serverBindTcp(
  31 + TR_Server this,
  32 + const char * host,
  33 + int port,
  34 + TR_Protocol proto)
31 35 {
32 36 TR_Socket socket = (TR_Socket)TR_new(
33 37 TR_TcpSocket,
... ... @@ -35,7 +39,9 @@ TR_serverBindTcp(TR_Server this, const char * host, int port, TR_Protocol proto)
35 39 host,
36 40 port, 0);
37 41
38   - TR_serverAddEndpoint(this, TR_new(TR_ConnEntryPoint, socket, proto));
  42 + TR_serverAddEndpoint(
  43 + this,
  44 + TR_new(TR_ConnEntryPoint, socket, proto, 2048));
39 45 }
40 46
41 47 // vim: set ts=4 sw=4:
... ...
... ... @@ -27,7 +27,11 @@
27 27 #include "tr/datagram_entry_point.h"
28 28
29 29 void
30   -TR_serverBindUdp(TR_Server this, const char * host, int port, TR_Protocol proto)
  30 +TR_serverBindUdp(
  31 + TR_Server this,
  32 + const char * host,
  33 + int port,
  34 + TR_Protocol proto)
31 35 {
32 36 TR_Socket socket = (TR_Socket)TR_new(
33 37 TR_UdpSocket,
... ... @@ -35,7 +39,8 @@ TR_serverBindUdp(TR_Server this, const char * host, int port, TR_Protocol proto)
35 39 host,
36 40 port, 0);
37 41
38   - TR_serverAddEndpoint(this, TR_new(TR_DatagramEntryPoint, socket, proto));
  42 + TR_serverAddEndpoint(
  43 + this, TR_new(TR_DatagramEntryPoint, socket, proto, 2048));
39 44 }
40 45
41 46 // vim: set ts=4 sw=4:
... ...
... ... @@ -27,18 +27,18 @@ main (int argc, char * argv[])
27 27 #endif
28 28 TR_SimpleClient client;
29 29 TR_Protocol protocol;
30   - TR_ProtoMessageRaw message;
  30 + volatile TR_ProtoMessageRaw message;
31 31 int i, j=0;
32 32
33 33 TR_logger = TR_INSTANCE_CAST(TR_Logger, mylogger2);
34 34 protocol = TR_new(TR_ProtocolRaw);
35 35 #if UDP
36 36 socket = TR_new(TR_UdpSocket, TR_logger, "127.0.0.1", 5678, 0);
37   - connection = TR_new(TR_DatagramService, socket, protocol);
  37 + connection = TR_new(TR_DatagramService, socket, protocol, 2048);
38 38 TR_socketOpen((TR_Socket)socket);
39 39 #else
40 40 socket = TR_new(TR_TcpSocket, TR_logger, "127.0.0.1", 5678, 0);
41   - connection = TR_new(TR_Connection, socket, protocol);
  41 + connection = TR_new(TR_Connection, socket, protocol, 2048);
42 42 TR_socketConnect((TR_Socket)socket);
43 43 #endif
44 44
... ...
Please register or login to post a comment