- don't clear th immediately, in case notify_cb calls notify_tmt_rdy
authorBart Polot <bart@net.in.tum.de>
Thu, 26 Jul 2012 15:54:51 +0000 (15:54 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 26 Jul 2012 15:54:51 +0000 (15:54 +0000)
src/mesh/mesh_api.c

index cf2963ca73e707a06137d561750875d6d9a91e64..040b87d718ac2793c214278710a89b644244f67d 100644 (file)
@@ -1203,7 +1203,6 @@ send_callback (void *cls, size_t size, void *buf)
   size_t psize;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Send packet() Buffer %u\n", size);
-  h->th = NULL;
   if ((0 == size) || (NULL == buf))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Received NULL send callback\n");
@@ -1328,6 +1327,7 @@ send_callback (void *cls, size_t size, void *buf)
 
       LOG (GNUNET_ERROR_TYPE_DEBUG, "  [%p] notify: %p, size %u\n",
            th, th->notify, th->size);
+      GNUNET_assert (NULL != t);
       LOG (GNUNET_ERROR_TYPE_DEBUG, "  pid %u, max %u\n", t->pid, t->max_pid);
 
       if (GNUNET_NO == th_is_payload (th) ||
@@ -1337,6 +1337,7 @@ send_callback (void *cls, size_t size, void *buf)
         break;
       }
     }
+    h->th = NULL;
 
     if (GNUNET_YES == request)
     {