- do clear th ALWAYS after calling notify_cb
authorBart Polot <bart@net.in.tum.de>
Thu, 26 Jul 2012 15:57:47 +0000 (15:57 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 26 Jul 2012 15:57:47 +0000 (15:57 +0000)
src/mesh/mesh_api.c

index 040b87d718ac2793c214278710a89b644244f67d..565e81d6369035f14c5965b280f346d98c0814de 100644 (file)
@@ -1207,6 +1207,7 @@ send_callback (void *cls, size_t size, void *buf)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Received NULL send callback\n");
     reconnect (h);
+    h->th = NULL;
     return 0;
   }
   tsize = 0;
@@ -1316,6 +1317,7 @@ send_callback (void *cls, size_t size, void *buf)
     tsize += psize;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG, "  total size: %u\n", tsize);
+  h->th = NULL;
   if (NULL != h->th_head)
   {
     int request = GNUNET_NO;
@@ -1337,7 +1339,6 @@ send_callback (void *cls, size_t size, void *buf)
         break;
       }
     }
-    h->th = NULL;
 
     if (GNUNET_YES == request)
     {