diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:08:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-25 21:08:55 +0000 |
commit | 537903a8dc4c3ecf2dfa382af0289ddf890adfc7 (patch) | |
tree | 93e448c15c843861bd5dfe86c7cad3245abedfe7 /src/util/service.c | |
parent | 2b61888a0bf1d41b2b25256ca9834c3040551ce9 (diff) | |
download | gnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.tar.gz gnunet-537903a8dc4c3ecf2dfa382af0289ddf890adfc7.zip |
fixing common off-by-one error with respect to maximum message size
Diffstat (limited to 'src/util/service.c')
-rw-r--r-- | src/util/service.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/service.c b/src/util/service.c index cff701a3c..46a01a098 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -1140,7 +1140,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1140 | } | 1140 | } |
1141 | } | 1141 | } |
1142 | else | 1142 | else |
1143 | maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; | 1143 | maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1; |
1144 | 1144 | ||
1145 | if (GNUNET_CONFIGURATION_have_value (sctx->cfg, | 1145 | if (GNUNET_CONFIGURATION_have_value (sctx->cfg, |
1146 | sctx->serviceName, "TOLERANT")) | 1146 | sctx->serviceName, "TOLERANT")) |
@@ -1577,7 +1577,7 @@ GNUNET_SERVICE_run (int argc, | |||
1577 | sctx.ready_confirm_fd = -1; | 1577 | sctx.ready_confirm_fd = -1; |
1578 | sctx.ret = GNUNET_OK; | 1578 | sctx.ret = GNUNET_OK; |
1579 | sctx.timeout = GNUNET_TIME_UNIT_FOREVER_REL; | 1579 | sctx.timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
1580 | sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; | 1580 | sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1; |
1581 | sctx.task = task; | 1581 | sctx.task = task; |
1582 | sctx.serviceName = serviceName; | 1582 | sctx.serviceName = serviceName; |
1583 | sctx.cfg = cfg = GNUNET_CONFIGURATION_create (); | 1583 | sctx.cfg = cfg = GNUNET_CONFIGURATION_create (); |
@@ -1656,7 +1656,7 @@ GNUNET_SERVICE_start (const char *serviceName, | |||
1656 | sctx->ready_confirm_fd = -1; /* no daemonizing */ | 1656 | sctx->ready_confirm_fd = -1; /* no daemonizing */ |
1657 | sctx->ret = GNUNET_OK; | 1657 | sctx->ret = GNUNET_OK; |
1658 | sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL; | 1658 | sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
1659 | sctx->maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; | 1659 | sctx->maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1; |
1660 | sctx->serviceName = serviceName; | 1660 | sctx->serviceName = serviceName; |
1661 | sctx->cfg = cfg; | 1661 | sctx->cfg = cfg; |
1662 | sctx->sched = sched; | 1662 | sctx->sched = sched; |