gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12106 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r12106 - gnunet/src/util
Date: Fri, 2 Jul 2010 15:00:36 +0200

Author: nevans
Date: 2010-07-02 15:00:36 +0200 (Fri, 02 Jul 2010)
New Revision: 12106

Modified:
   gnunet/src/util/client.c
   gnunet/src/util/connection.c
   gnunet/src/util/server.c
   gnunet/src/util/server_mst.c
   gnunet/src/util/service.c
   gnunet/src/util/test_client.c
   gnunet/src/util/test_connection.c
   gnunet/src/util/test_connection_addressing.c
   gnunet/src/util/test_connection_receive_cancel.c
   gnunet/src/util/test_connection_timeout.c
   gnunet/src/util/test_connection_timeout_no_connect.c
   gnunet/src/util/test_connection_transmit_cancel.c
   gnunet/src/util/test_server.c
   gnunet/src/util/test_server_disconnect.c
   gnunet/src/util/test_server_with_client.c
Log:
remove max buffer size from everywhere in util

Modified: gnunet/src/util/client.c
===================================================================
--- gnunet/src/util/client.c    2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/client.c    2010-07-02 13:00:36 UTC (rev 12106)
@@ -290,8 +290,7 @@
        {
          sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (sched,
                                                                    cfg,
-                                                                   unixpath,
-                                                                   
GNUNET_SERVER_MAX_MESSAGE_SIZE - 1);
+                                                                   unixpath);
          GNUNET_free (unixpath);
          if (sock != NULL)
            return sock;
@@ -327,8 +326,7 @@
   sock = GNUNET_CONNECTION_create_from_connect (sched,
                                                 cfg,
                                                 hostname,
-                                                port,
-                                                GNUNET_SERVER_MAX_MESSAGE_SIZE 
- 1);
+                                                port);
   GNUNET_free (hostname);
   return sock;
 }

Modified: gnunet/src/util/connection.c
===================================================================
--- gnunet/src/util/connection.c        2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/connection.c        2010-07-02 13:00:36 UTC (rev 12106)
@@ -214,11 +214,6 @@
   char *write_buffer;
 
   /**
-   * Max size of our write buffer.
-   */
-  size_t max_write_buffer_size;
-
-  /**
    * Current size of our write buffer.
    */
   size_t write_buffer_size;
@@ -319,21 +314,17 @@
  *
  * @param sched scheduler to use
  * @param osSocket existing socket to box
- * @param maxbuf maximum write buffer size for the socket (use
- *        0 for sockets that need no write buffers, such as listen sockets)
  * @return the boxed socket handle
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle
                                         *sched,
                                         struct GNUNET_NETWORK_Handle
-                                        *osSocket, size_t maxbuf)
+                                        *osSocket)
 {
   struct GNUNET_CONNECTION_Handle *ret;
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
-  GNUNET_assert (maxbuf < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
-  ret->max_write_buffer_size = maxbuf;
   ret->write_buffer = GNUNET_malloc(ret->write_buffer_size);
   ret->sock = osSocket;
   ret->sched = sched;
@@ -349,8 +340,6 @@
  * @param access function to use to check if access is allowed
  * @param access_cls closure for access
  * @param lsock listen socket
- * @param maxbuf maximum write buffer size for the socket (use
- *        0 for sockets that need no write buffers, such as listen sockets)
  * @return the socket handle, NULL on error
  */
 struct GNUNET_CONNECTION_Handle *
@@ -358,8 +347,7 @@
                                       *sched,
                                       GNUNET_CONNECTION_AccessCheck access,
                                       void *access_cls,
-                                      struct GNUNET_NETWORK_Handle *lsock,
-                                      size_t maxbuf)
+                                      struct GNUNET_NETWORK_Handle *lsock)
 {
   struct GNUNET_CONNECTION_Handle *ret;
   char addr[128];
@@ -423,10 +411,7 @@
       return NULL;
     }
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
-
-  GNUNET_assert (maxbuf < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
-  ret->max_write_buffer_size = maxbuf;
   ret->write_buffer = GNUNET_malloc(ret->write_buffer_size);
   ret->addr = uaddr;
   ret->addrlen = addrlen;
@@ -870,16 +855,13 @@
  * @param cfg configuration to use
  * @param hostname name of the host to connect to
  * @param port port to connect to
- * @param maxbuf maximum write buffer size for the socket (use
- *        0 for sockets that need no write buffers, such as listen sockets)
  * @return the socket handle
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle *sched,
                                        const struct
                                        GNUNET_CONFIGURATION_Handle *cfg,
-                                       const char *hostname, uint16_t port,
-                                       size_t maxbuf)
+                                       const char *hostname, uint16_t port)
 {
   struct GNUNET_CONNECTION_Handle *ret;
 
@@ -887,10 +869,7 @@
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
   ret->cfg = cfg;
   ret->sched = sched;
-
-  GNUNET_assert (maxbuf < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
-  ret->max_write_buffer_size = maxbuf;
   ret->write_buffer = GNUNET_malloc(ret->write_buffer_size);
   ret->port = port;
   ret->hostname = GNUNET_strdup (hostname);
@@ -912,16 +891,13 @@
  * @param sched scheduler to use
  * @param cfg configuration to use
  * @param unixpath path to connect to
- * @param maxbuf maximum write buffer size for the socket (use
- *        0 for sockets that need no write buffers, such as listen sockets)
  * @return the socket handle, NULL on systems without UNIX support
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_connect_to_unixpath (struct 
GNUNET_SCHEDULER_Handle *sched,
                                                   const struct
                                                   GNUNET_CONFIGURATION_Handle 
*cfg,
-                                                  const char *unixpath,
-                                                  size_t maxbuf)
+                                                  const char *unixpath)
 {
 #ifdef AF_UNIX
   struct GNUNET_CONNECTION_Handle *ret;
@@ -946,9 +922,7 @@
   ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle));
   ret->cfg = cfg;
   ret->sched = sched;
-  GNUNET_assert (maxbuf < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   ret->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
-  ret->max_write_buffer_size = maxbuf;
   ret->write_buffer = GNUNET_malloc(ret->write_buffer_size);
   ret->port = 0;
   ret->hostname = NULL;
@@ -987,15 +961,13 @@
  * @param af_family address family to use
  * @param serv_addr server address
  * @param addrlen length of server address
- * @param maxbuf maximum write buffer size for the socket (use
- *        0 for sockets that need no write buffers, such as listen sockets)
  * @return the socket handle
  */
 struct GNUNET_CONNECTION_Handle *
 GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle
                                         *sched, int af_family,
                                         const struct sockaddr *serv_addr,
-                                        socklen_t addrlen, size_t maxbuf)
+                                        socklen_t addrlen)
 {
   struct GNUNET_NETWORK_Handle *s;
   struct GNUNET_CONNECTION_Handle *ret;
@@ -1015,7 +987,7 @@
       GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s));
       return NULL;
     }
-  ret = GNUNET_CONNECTION_create_from_existing (sched, s, maxbuf);
+  ret = GNUNET_CONNECTION_create_from_existing (sched, s);
   ret->addr = GNUNET_malloc (addrlen);
   memcpy (ret->addr, serv_addr, addrlen);
   ret->addrlen = addrlen;
@@ -1615,11 +1587,11 @@
   if (sock->nth.notify_ready != NULL)
     return NULL;
   GNUNET_assert (notify != NULL);
-  if ((sock->write_buffer_size < size) && (size < sock->max_write_buffer_size))
+  if ((sock->write_buffer_size < size) && (size < 
GNUNET_SERVER_MAX_MESSAGE_SIZE))
     {
       temp_size = sock->write_buffer_size + size;
-      if (temp_size > sock->max_write_buffer_size)
-        temp_size = sock->max_write_buffer_size;
+      if (temp_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+        temp_size = GNUNET_SERVER_MAX_MESSAGE_SIZE;
 
       sock->write_buffer = GNUNET_realloc(sock->write_buffer, temp_size);
       sock->write_buffer_size = temp_size;

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/server.c    2010-07-02 13:00:36 UTC (rev 12106)
@@ -122,11 +122,6 @@
   struct GNUNET_TIME_Relative idle_timeout;
 
   /**
-   * maximum write buffer size for accepted sockets
-   */
-  size_t maxbuf;
-
-  /**
    * Task scheduled to do the listening.
    */
   GNUNET_SCHEDULER_TaskIdentifier listen_task;
@@ -273,8 +268,7 @@
           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
@@ -396,7 +390,6 @@
  * @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
@@ -407,7 +400,6 @@
 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)
@@ -418,7 +410,6 @@
 
   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;
@@ -451,7 +442,6 @@
  * @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
@@ -464,7 +454,6 @@
                       void *access_cls,
                       struct sockaddr *const *serverAddr,
                       const socklen_t * socklen,
-                      size_t maxbuf,
                       struct GNUNET_TIME_Relative
                       idle_timeout, int require_found)
 {
@@ -503,7 +492,6 @@
   return GNUNET_SERVER_create_with_sockets (sched,
                                            access, access_cls,
                                            lsocks,
-                                           maxbuf, 
                                            idle_timeout,
                                            require_found);
 }
@@ -877,8 +865,7 @@
 
   client = GNUNET_malloc (sizeof (struct GNUNET_SERVER_Client));
   client->connection = connection;
-  client->mst = GNUNET_SERVER_mst_create (GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
-                                         &client_message_tokenizer_callback,
+  client->mst = GNUNET_SERVER_mst_create (&client_message_tokenizer_callback,
                                          server);
   client->reference_count = 1;
   client->server = server;

Modified: gnunet/src/util/server_mst.c
===================================================================
--- gnunet/src/util/server_mst.c        2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/server_mst.c        2010-07-02 13:00:36 UTC (rev 12106)
@@ -62,11 +62,6 @@
   size_t curr_buf;
 
   /**
-   * Maximum size of the buffer.
-   */
-  size_t maxbuf;
-
-  /**
    * How many bytes in buffer have we already processed?
    */
   size_t off;
@@ -88,15 +83,12 @@
 /**
  * Create a message stream tokenizer.
  *
- * @param maxbuf maximum message size to support (typically
- *    GNUNET_SERVER_MAX_MESSAGE_SIZE - 1)
  * @param cb function to call on completed messages
  * @param cb_cls closure for cb
  * @return handle to tokenizer
  */
 struct GNUNET_SERVER_MessageStreamTokenizer *
-GNUNET_SERVER_mst_create (size_t maxbuf,
-                         GNUNET_SERVER_MessageTokenizerCallback cb,
+GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
                          void *cb_cls)
 {
   struct GNUNET_SERVER_MessageStreamTokenizer *ret;
@@ -104,7 +96,6 @@
   ret = GNUNET_malloc (sizeof (struct GNUNET_SERVER_MessageStreamTokenizer));
   ret->hdr = GNUNET_malloc(GNUNET_SERVER_MIN_BUFFER_SIZE);
   ret->curr_buf = GNUNET_SERVER_MIN_BUFFER_SIZE;
-  ret->maxbuf = maxbuf;
   ret->cb = cb;
   ret->cb_cls = cb_cls;
   return ret;
@@ -149,11 +140,11 @@
              (unsigned int) size,
              (unsigned int) (mst->pos - mst->off));
 #endif
-  if ((size > mst->curr_buf) && (size < mst->maxbuf)) /* Received bigger 
message than we can currently handle! */
+  if ((size > mst->curr_buf) && (size < GNUNET_SERVER_MAX_MESSAGE_SIZE)) /* 
Received bigger message than we can currently handle! */
     {
       newsize = mst->curr_buf + size; /* How much space do we need? */
-      if (newsize > mst->maxbuf)
-        newsize = mst->maxbuf; /* Check it's not bigger than maxbuf */
+      if (newsize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+        newsize = GNUNET_SERVER_MAX_MESSAGE_SIZE; /* Check it's not bigger 
than GNUNET_SERVER_MAX_MESSAGE_SIZE */
 
       mst->hdr = GNUNET_realloc(mst->hdr, newsize);
       mst->curr_buf = newsize;

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/service.c   2010-07-02 13:00:36 UTC (rev 12106)
@@ -499,11 +499,6 @@
   struct GNUNET_TIME_Relative timeout;
 
   /**
-   * Maximum buffer size for the server.
-   */
-  size_t maxbuf;
-
-  /**
    * Overall success/failure of the service start.
    */
   int ret;
@@ -1077,14 +1072,13 @@
 
 
 /**
- * Setup addr, addrlen, maxbuf, idle_timeout
+ * Setup addr, addrlen, idle_timeout
  * based on configuration!
  *
  * Configuration may specify:
  * - PORT (where to bind to for TCP)
  * - UNIXPATH (where to bind to for UNIX domain sockets)
  * - TIMEOUT (after how many ms does an inactive service timeout);
- * - MAXBUF (maximum incoming message size supported)
  * - DISABLEV6 (disable support for IPv6, otherwise we use dual-stack)
  * - BINDTO (hostname or IP address to bind to, otherwise we take everything)
  * - ACCEPT_FROM  (only allow connections from specified IPv4 subnets)
@@ -1097,7 +1091,6 @@
 static int
 setup_service (struct GNUNET_SERVICE_Context *sctx)
 {
-  unsigned long long maxbuf;
   struct GNUNET_TIME_Relative idleout;
   int tolerant;
   const char *lpid;
@@ -1124,23 +1117,6 @@
     }
   else
     sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
-  if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
-                                       sctx->serviceName, "MAXBUF"))
-    {
-      if (GNUNET_OK !=
-          GNUNET_CONFIGURATION_get_value_number (sctx->cfg,
-                                                 sctx->serviceName,
-                                                 "MAXBUF", &maxbuf))
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     _("Specified value for `%s' of service `%s' is 
invalid\n"),
-                     "MAXBUF",
-                     sctx->serviceName);
-         return GNUNET_SYSERR;
-       }
-    }
-  else
-    maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1;
 
   if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
                                        sctx->serviceName, "TOLERANT"))
@@ -1201,15 +1177,6 @@
                                             &sctx->addrlens)) )
     return GNUNET_SYSERR;
   sctx->require_found = tolerant ? GNUNET_NO : GNUNET_YES;
-  sctx->maxbuf = (size_t) maxbuf;
-  if (sctx->maxbuf != maxbuf)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  _
-                  ("Value in configuration for `%s' and service `%s' too 
large!\n"),
-                  "MAXBUF", sctx->serviceName);
-      return GNUNET_SYSERR;
-    }
 
   process_acl4 (&sctx->v4_denied, sctx, "REJECT_FROM");
   process_acl4 (&sctx->v4_allowed, sctx, "ACCEPT_FROM");
@@ -1324,7 +1291,6 @@
                                                      &check_access,
                                                      sctx,
                                                      sctx->lsocks,
-                                                     sctx->maxbuf,
                                                      sctx->timeout, 
sctx->require_found);
   else
     sctx->server = GNUNET_SERVER_create (tc->sched,
@@ -1332,7 +1298,6 @@
                                         sctx,
                                         sctx->addrs,
                                         sctx->addrlens,
-                                        sctx->maxbuf,
                                         sctx->timeout, sctx->require_found);
   if (sctx->server == NULL)
     {
@@ -1577,7 +1542,6 @@
   sctx.ready_confirm_fd = -1;
   sctx.ret = GNUNET_OK;
   sctx.timeout = GNUNET_TIME_UNIT_FOREVER_REL;
-  sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1;
   sctx.task = task;
   sctx.serviceName = serviceName;
   sctx.cfg = cfg = GNUNET_CONFIGURATION_create ();
@@ -1656,7 +1620,6 @@
   sctx->ready_confirm_fd = -1;  /* no daemonizing */
   sctx->ret = GNUNET_OK;
   sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
-  sctx->maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE;
   sctx->serviceName = serviceName;
   sctx->cfg = cfg;
   sctx->sched = sched;
@@ -1672,7 +1635,6 @@
                                                      &check_access,
                                                      sctx,
                                                      sctx->lsocks,
-                                                     sctx->maxbuf,
                                                      sctx->timeout, 
sctx->require_found);
   else
     sctx->server = GNUNET_SERVER_create (sched,
@@ -1680,7 +1642,6 @@
                                         sctx,
                                         sctx->addrs,
                                         sctx->addrlens,
-                                        sctx->maxbuf,
                                         sctx->timeout,
                                         sctx->require_found);
                                         

Modified: gnunet/src/util/test_client.c
===================================================================
--- gnunet/src/util/test_client.c       2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/test_client.c       2010-07-02 13:00:36 UTC (rev 12106)
@@ -155,7 +155,6 @@
                                  NULL,
                                  sap,
                                 slens,
-                                 1024,
                                  GNUNET_TIME_relative_multiply
                                  (GNUNET_TIME_UNIT_MILLISECONDS, 10000),
                                  GNUNET_NO);

Modified: gnunet/src/util/test_connection.c
===================================================================
--- gnunet/src/util/test_connection.c   2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/test_connection.c   2010-07-02 13:00:36 UTC (rev 12106)
@@ -119,7 +119,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n");
 #endif
   asock = GNUNET_CONNECTION_create_from_accept (tc->sched,
-                                                NULL, NULL, ls, 1024);
+                                                NULL, NULL, ls);
   GNUNET_assert (asock != NULL);
   GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
 #if VERBOSE
@@ -157,11 +157,11 @@
 task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   ls = open_listen_socket ();
-  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0);
+  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls);
   GNUNET_assert (lsock != NULL);
   csock = GNUNET_CONNECTION_create_from_connect (tc->sched,
                                                  cfg,
-                                                 "localhost", PORT, 1024);
+                                                 "localhost", PORT);
   GNUNET_assert (csock != NULL);
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n");

Modified: gnunet/src/util/test_connection_addressing.c
===================================================================
--- gnunet/src/util/test_connection_addressing.c        2010-07-02 12:26:47 UTC 
(rev 12105)
+++ gnunet/src/util/test_connection_addressing.c        2010-07-02 13:00:36 UTC 
(rev 12106)
@@ -116,7 +116,7 @@
   struct sockaddr_in expect;
 
   asock = GNUNET_CONNECTION_create_from_accept (tc->sched,
-                                                NULL, NULL, ls, 1024);
+                                                NULL, NULL, ls);
   GNUNET_assert (asock != NULL);
   GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
   GNUNET_assert (GNUNET_OK ==
@@ -153,7 +153,7 @@
 {
   struct sockaddr_in v4;
   ls = open_listen_socket ();
-  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0);
+  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls);
   GNUNET_assert (lsock != NULL);
 
 #if HAVE_SOCKADDR_IN_SIN_LEN
@@ -165,7 +165,7 @@
   csock = GNUNET_CONNECTION_create_from_sockaddr (tc->sched,
                                                   AF_INET,
                                                   (const struct sockaddr
-                                                   *) &v4, sizeof (v4), 1024);
+                                                   *) &v4, sizeof (v4));
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
                  GNUNET_CONNECTION_notify_transmit_ready (csock,

Modified: gnunet/src/util/test_connection_receive_cancel.c
===================================================================
--- gnunet/src/util/test_connection_receive_cancel.c    2010-07-02 12:26:47 UTC 
(rev 12105)
+++ gnunet/src/util/test_connection_receive_cancel.c    2010-07-02 13:00:36 UTC 
(rev 12106)
@@ -91,7 +91,7 @@
 {
 
   asock = GNUNET_CONNECTION_create_from_accept (tc->sched,
-                                                NULL, NULL, ls, 1024);
+                                                NULL, NULL, ls);
   GNUNET_assert (asock != NULL);
   GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock));
   GNUNET_CONNECTION_destroy (lsock, GNUNET_YES);
@@ -119,10 +119,10 @@
 task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   ls = open_listen_socket ();
-  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0);
+  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls);
   GNUNET_assert (lsock != NULL);
   csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg,
-                                                 "localhost", PORT, 1024);
+                                                 "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_SCHEDULER_add_read_net (tc->sched,
                                  GNUNET_TIME_UNIT_FOREVER_REL,

Modified: gnunet/src/util/test_connection_timeout.c
===================================================================
--- gnunet/src/util/test_connection_timeout.c   2010-07-02 12:26:47 UTC (rev 
12105)
+++ gnunet/src/util/test_connection_timeout.c   2010-07-02 13:00:36 UTC (rev 
12106)
@@ -107,10 +107,10 @@
 {
 
   ls = open_listen_socket ();
-  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0);
+  lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls);
   GNUNET_assert (lsock != NULL);
   csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg,
-                                                 "localhost", PORT, 1024);
+                                                 "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
                  GNUNET_CONNECTION_notify_transmit_ready (csock,

Modified: gnunet/src/util/test_connection_timeout_no_connect.c
===================================================================
--- gnunet/src/util/test_connection_timeout_no_connect.c        2010-07-02 
12:26:47 UTC (rev 12105)
+++ gnunet/src/util/test_connection_timeout_no_connect.c        2010-07-02 
13:00:36 UTC (rev 12106)
@@ -54,7 +54,7 @@
 task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg,
-                                                 "localhost", PORT, 1024);
+                                                 "localhost", PORT);
   GNUNET_assert (csock != NULL);
   GNUNET_assert (NULL !=
                  GNUNET_CONNECTION_notify_transmit_ready (csock,

Modified: gnunet/src/util/test_connection_transmit_cancel.c
===================================================================
--- gnunet/src/util/test_connection_transmit_cancel.c   2010-07-02 12:26:47 UTC 
(rev 12105)
+++ gnunet/src/util/test_connection_transmit_cancel.c   2010-07-02 13:00:36 UTC 
(rev 12106)
@@ -51,7 +51,7 @@
   struct GNUNET_CONNECTION_Handle *csock;
 
   csock = GNUNET_CONNECTION_create_from_connect (tc->sched, cfg,
-                                                 "localhost", PORT, 1024);
+                                                 "localhost", PORT);
   GNUNET_assert (csock != NULL);
   th = GNUNET_CONNECTION_notify_transmit_ready (csock,
                                                 12,

Modified: gnunet/src/util/test_server.c
===================================================================
--- gnunet/src/util/test_server.c       2010-07-02 12:26:47 UTC (rev 12105)
+++ gnunet/src/util/test_server.c       2010-07-02 13:00:36 UTC (rev 12106)
@@ -95,7 +95,7 @@
 
   GNUNET_assert (ok == 3);
   ok = 4;
-  GNUNET_assert (size > sizeof (struct GNUNET_MessageHeader));
+  GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
   msg.type = htons (MY_TYPE);
   msg.size = htons (sizeof (struct GNUNET_MessageHeader));
   memcpy (buf, &msg, sizeof (struct GNUNET_MessageHeader));
@@ -137,7 +137,7 @@
 {
   struct GNUNET_MessageHeader msg;
 
-  GNUNET_assert (size > sizeof (struct GNUNET_MessageHeader));
+  GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
   msg.type = htons (MY_TYPE2);
   msg.size = htons (sizeof (struct GNUNET_MessageHeader));
   memcpy (buf, &msg, sizeof (struct GNUNET_MessageHeader));
@@ -154,7 +154,7 @@
 
   GNUNET_assert (ok == 1);
   ok = 2;
-  GNUNET_assert (size > sizeof (struct GNUNET_MessageHeader));
+  GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
   msg.type = htons (MY_TYPE);
   msg.size = htons (sizeof (struct GNUNET_MessageHeader));
   memcpy (buf, &msg, sizeof (struct GNUNET_MessageHeader));
@@ -193,7 +193,6 @@
                                  NULL,
                                  sap,
                                 slens,
-                                 1024,
                                  TIMEOUT,
                                  GNUNET_NO);
   GNUNET_assert (server != NULL);

Modified: gnunet/src/util/test_server_disconnect.c
===================================================================
--- gnunet/src/util/test_server_disconnect.c    2010-07-02 12:26:47 UTC (rev 
12105)
+++ gnunet/src/util/test_server_disconnect.c    2010-07-02 13:00:36 UTC (rev 
12106)
@@ -115,7 +115,7 @@
 
   GNUNET_assert (ok == 1);
   ok = 2;
-  GNUNET_assert (size > sizeof (struct GNUNET_MessageHeader));
+  GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
   msg.type = htons (MY_TYPE);
   msg.size = htons (sizeof (struct GNUNET_MessageHeader));
   memcpy (buf, &msg, sizeof (struct GNUNET_MessageHeader));
@@ -146,7 +146,6 @@
                                  NULL,
                                  sap,
                                 slens,
-                                 1024,
                                  TIMEOUT,
                                  GNUNET_NO);
   GNUNET_assert (server != NULL);

Modified: gnunet/src/util/test_server_with_client.c
===================================================================
--- gnunet/src/util/test_server_with_client.c   2010-07-02 12:26:47 UTC (rev 
12105)
+++ gnunet/src/util/test_server_with_client.c   2010-07-02 13:00:36 UTC (rev 
12106)
@@ -179,7 +179,6 @@
                                  NULL,
                                  sap,
                                 slens,
-                                 1024,
                                  GNUNET_TIME_relative_multiply
                                  (GNUNET_TIME_UNIT_MILLISECONDS, 250),
                                  GNUNET_NO);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]