gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r12676 - gnunet/src/util
Date: Thu, 19 Aug 2010 15:13:45 +0200

Author: grothoff
Date: 2010-08-19 15:13:45 +0200 (Thu, 19 Aug 2010)
New Revision: 12676

Modified:
   gnunet/src/util/common_allocation.c
   gnunet/src/util/connection.c
Log:
fixing fun bug

Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2010-08-19 12:37:20 UTC (rev 12675)
+++ gnunet/src/util/common_allocation.c 2010-08-19 13:13:45 UTC (rev 12676)
@@ -116,11 +116,7 @@
  */
 void *
 GNUNET_xrealloc_ (void *ptr,
-#ifndef W32_MEM_LIMIT
-                  const size_t n,
-#else
                   size_t n,
-#endif
                   const char *filename, int linenumber)
 {
 #ifdef W32_MEM_LIMIT

Modified: gnunet/src/util/connection.c
===================================================================
--- gnunet/src/util/connection.c        2010-08-19 12:37:20 UTC (rev 12675)
+++ gnunet/src/util/connection.c        2010-08-19 13:13:45 UTC (rev 12676)
@@ -1504,6 +1504,13 @@
       return;                   /* connect failed for good, we're finished */
     }
   GNUNET_assert (sock->write_buffer_off >= sock->write_buffer_pos);
+  if ( (sock->nth.notify_ready != NULL) &&
+       (sock->write_buffer_size < sock->nth.notify_size) )
+    {
+      sock->write_buffer = GNUNET_realloc(sock->write_buffer, 
+                                         sock->nth.notify_size);
+      sock->write_buffer_size = sock->nth.notify_size;
+    }    
   process_notify (sock);
   have = sock->write_buffer_off - sock->write_buffer_pos;
   if (have == 0)
@@ -1592,12 +1599,6 @@
     return NULL;
   GNUNET_assert (notify != NULL);
   GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
-  if (sock->write_buffer_size < size)
-    {
-      sock->write_buffer = GNUNET_realloc(sock->write_buffer, size);
-      sock->write_buffer_size = size;
-    }
-  GNUNET_assert (sock->write_buffer_size >= size);
   GNUNET_assert (sock->write_buffer_off <= sock->write_buffer_size);
   GNUNET_assert (sock->write_buffer_pos <= sock->write_buffer_size);
   GNUNET_assert (sock->write_buffer_pos <= sock->write_buffer_off);




reply via email to

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