*/
struct GNUNET_TIME_Relative idle_timeout;
- /**
- * maximum write buffer size for accepted sockets
- */
- size_t maxbuf;
-
/**
* Task scheduled to do the listening.
*/
sock =
GNUNET_CONNECTION_create_from_accept (tc->sched, server->access,
server->access_cls,
- server->listen_sockets[i],
- server->maxbuf);
+ server->listen_sockets[i]);
if (sock != NULL)
{
#if DEBUG_SERVER
* @param access function for access control
* @param access_cls closure for access
* @param lsocks NULL-terminated array of listen sockets
- * @param maxbuf maximum write buffer size for accepted sockets
* @param idle_timeout after how long should we timeout idle connections?
* @param require_found if YES, connections sending messages of unknown type
* will be closed
GNUNET_SERVER_create_with_sockets (struct GNUNET_SCHEDULER_Handle *sched,
GNUNET_CONNECTION_AccessCheck access, void *access_cls,
struct GNUNET_NETWORK_Handle **lsocks,
- size_t maxbuf,
struct GNUNET_TIME_Relative
idle_timeout,
int require_found)
ret = GNUNET_malloc (sizeof (struct GNUNET_SERVER_Handle));
ret->sched = sched;
- ret->maxbuf = maxbuf;
ret->idle_timeout = idle_timeout;
ret->listen_sockets = lsocks;
ret->access = access;
* @param access_cls closure for access
* @param serverAddr address to listen on (including port), NULL terminated array
* @param socklen length of serverAddr
- * @param maxbuf maximum write buffer size for accepted sockets
* @param idle_timeout after how long should we timeout idle connections?
* @param require_found if YES, connections sending messages of unknown type
* will be closed
void *access_cls,
struct sockaddr *const *serverAddr,
const socklen_t * socklen,
- size_t maxbuf,
struct GNUNET_TIME_Relative
idle_timeout, int require_found)
{
return GNUNET_SERVER_create_with_sockets (sched,
access, access_cls,
lsocks,
- maxbuf,
idle_timeout,
require_found);
}
{
if ((mh->expected_size != 0) && (mh->expected_size != size))
{
+#if DEBUG_SERVER
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Expected %u bytes for message of type %u, got %u\n",
+ mh->expected_size,
+ mh->type,
+ size);
+#endif
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
"Server re-enters receive loop.\n");
#endif
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE,
+ GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
client->server->idle_timeout,
&process_incoming, client);
break;
#endif
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE,
+ GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
client->server->idle_timeout, &process_incoming, client);
return;
}
client = GNUNET_malloc (sizeof (struct GNUNET_SERVER_Client));
client->connection = connection;
- client->mst = GNUNET_SERVER_mst_create (GNUNET_SERVER_MAX_MESSAGE_SIZE,
- &client_message_tokenizer_callback,
+ client->mst = GNUNET_SERVER_mst_create (&client_message_tokenizer_callback,
server);
client->reference_count = 1;
client->server = server;
server->clients = client;
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE,
+ GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
server->idle_timeout, &process_incoming, client);
return client;
}