aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_tcp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-25 21:08:55 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-25 21:08:55 +0000
commit537903a8dc4c3ecf2dfa382af0289ddf890adfc7 (patch)
tree93e448c15c843861bd5dfe86c7cad3245abedfe7 /src/transport/plugin_transport_tcp.c
parent2b61888a0bf1d41b2b25256ca9834c3040551ce9 (diff)
downloadgnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.tar.gz
gnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.zip
fixing common off-by-one error with respect to maximum message size
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r--src/transport/plugin_transport_tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 9b09d8948..c1397da61 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1120,7 +1120,7 @@ tcp_plugin_send (void *cls,
1120 } 1120 }
1121 sa = GNUNET_CONNECTION_create_from_sockaddr (plugin->env->sched, 1121 sa = GNUNET_CONNECTION_create_from_sockaddr (plugin->env->sched,
1122 af, sb, sbs, 1122 af, sb, sbs,
1123 GNUNET_SERVER_MAX_MESSAGE_SIZE); 1123 GNUNET_SERVER_MAX_MESSAGE_SIZE - 1);
1124 if (sa == NULL) 1124 if (sa == NULL)
1125 { 1125 {
1126#if DEBUG_TCP 1126#if DEBUG_TCP
@@ -1991,7 +1991,7 @@ tcp_plugin_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
1991 * that wants to connect to us! Send a message to establish a connection. 1991 * that wants to connect to us! Send a message to establish a connection.
1992 */ 1992 */
1993 sock = GNUNET_CONNECTION_create_from_sockaddr (plugin->env->sched, AF_INET, (struct sockaddr *)&in_addr, 1993 sock = GNUNET_CONNECTION_create_from_sockaddr (plugin->env->sched, AF_INET, (struct sockaddr *)&in_addr,
1994 sizeof(in_addr), GNUNET_SERVER_MAX_MESSAGE_SIZE); 1994 sizeof(in_addr), GNUNET_SERVER_MAX_MESSAGE_SIZE - 1);
1995 if (sock == NULL) 1995 if (sock == NULL)
1996 { 1996 {
1997 plugin->server_read_task = 1997 plugin->server_read_task =