gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13855 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r13855 - gnunet/src/core
Date: Wed, 1 Dec 2010 10:14:32 +0100

Author: wachs
Date: 2010-12-01 10:14:31 +0100 (Wed, 01 Dec 2010)
New Revision: 13855

Modified:
   gnunet/src/core/gnunet-service-core.c
Log:
fixed:
- off-by-one in msg size
- changed 0 to GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR


Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2010-11-30 19:54:56 UTC (rev 
13854)
+++ gnunet/src/core/gnunet-service-core.c       2010-12-01 09:14:31 UTC (rev 
13855)
@@ -1277,7 +1277,7 @@
       while (n != NULL)
        {
          size = sizeof (struct ConnectNotifyMessage) +
-           (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+           (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
          if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
            {
              GNUNET_break (0);
@@ -1286,7 +1286,7 @@
                                 n->ats_count,
                                 0);
              size = sizeof (struct ConnectNotifyMessage) +
-               (n->ats_count+1) * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information);
+               (n->ats_count) * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information);
            }
          cnm = (struct ConnectNotifyMessage*) buf;       
          cnm->header.size = htons (size);
@@ -1419,7 +1419,7 @@
       if (n->status == PEER_STATE_KEY_CONFIRMED)
         {
          size = sizeof (struct ConnectNotifyMessage) +
-           (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+           (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
          if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
            {
              GNUNET_break (0);
@@ -1428,7 +1428,7 @@
                                 n->ats_count,
                                 0);
              size = sizeof (struct PeerStatusNotifyMessage) +
-               (n->ats_count+1) * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information);
+               (n->ats_count) * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information);
            }
          cnm = (struct ConnectNotifyMessage*) buf;
          cnm->header.size = htons (size);
@@ -1438,7 +1438,7 @@
          memcpy (ats,
                  n->ats,
                  n->ats_count * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information));
-         ats[n->ats_count].type = htonl (0);
+         ats[n->ats_count].type = htonl 
(GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
          ats[n->ats_count].value = htonl (0);    
 #if DEBUG_CORE_CLIENT
           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -3526,7 +3526,7 @@
         }      
       update_neighbour_performance (n, ats, ats_count);      
       size = sizeof (struct ConnectNotifyMessage) +
-       (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+       (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
       if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
        {
          GNUNET_break (0);
@@ -3535,7 +3535,7 @@
                             n->ats_count,
                             0);
          size = sizeof (struct PeerStatusNotifyMessage) +
-           (n->ats_count+1) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
+           (n->ats_count) * sizeof (struct GNUNET_TRANSPORT_ATS_Information);
        }
       cnm = (struct ConnectNotifyMessage*) buf;
       cnm->header.size = htons (size);
@@ -3545,7 +3545,7 @@
       memcpy (mats,
              n->ats,
              n->ats_count * sizeof (struct GNUNET_TRANSPORT_ATS_Information));
-      mats[n->ats_count].type = htonl (0);
+      mats[n->ats_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
       mats[n->ats_count].value = htonl (0);      
       send_to_all_clients (&cnm->header, 
                           GNUNET_NO, 




reply via email to

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