- revert 26711 and fix 2851 with dirty hack
authorSree Harsha Totakura <totakura@in.tum.de>
Mon, 1 Apr 2013 19:03:03 +0000 (19:03 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Mon, 1 Apr 2013 19:03:03 +0000 (19:03 +0000)
src/arm/arm_api.c

index 8c4192f79384b2f55548cfdc4c4fd291e4e01aad..754398fc5f91ed1f2759574d27cb1afe56fade9a 100644 (file)
@@ -349,6 +349,7 @@ trigger_next_request (struct GNUNET_ARM_Handle *h, int ignore_currently_down)
 {
   uint16_t msize;
 
+  msize = sizeof (struct GNUNET_MessageHeader);
   if ((GNUNET_YES == h->currently_down) && (ignore_currently_down == GNUNET_NO))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -360,15 +361,16 @@ trigger_next_request (struct GNUNET_ARM_Handle *h, int ignore_currently_down)
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Request pending, not processing queue\n");
     return;
   }
-  if (NULL == h->control_pending_head)
+  if (NULL != h->control_pending_head)
+    msize =
+        ntohs (((struct GNUNET_MessageHeader *) &h->
+                control_pending_head[1])->size);
+  else if (GNUNET_NO == ignore_currently_down)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Request queue empty, not processing queue\n");
     return;                     /* no pending message */
   }
-  msize =
-      ntohs (((struct GNUNET_MessageHeader *) &h->
-              control_pending_head[1])->size);
   h->cth =
       GNUNET_CLIENT_notify_transmit_ready (h->client, msize,
                                            GNUNET_TIME_UNIT_FOREVER_REL,