-fix minor issues
authorChristian Grothoff <christian@grothoff.org>
Tue, 20 Sep 2016 09:55:42 +0000 (09:55 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 20 Sep 2016 09:55:42 +0000 (09:55 +0000)
src/include/gnunet_scalarproduct_service.h
src/util/service_new.c

index 8e90d0a45d870562233f0ed189d0df21abad6b40..21e00ca10666676eba9c482695e10b1213c0fca1 100644 (file)
@@ -55,7 +55,12 @@ enum GNUNET_SCALARPRODUCT_ResponseStatus
   /**
    * Operation is still active (never returned, used internally).
    */
-  GNUNET_SCALARPRODUCT_STATUS_ACTIVE = 0,
+  GNUNET_SCALARPRODUCT_STATUS_INIT = 0,
+
+  /**
+   * Operation is still active (never returned, used internally).
+   */
+  GNUNET_SCALARPRODUCT_STATUS_ACTIVE = 1,
 
   /**
    * The computation was successful.
index 123b40d5ba0c37cbc1b8cb18f649bfc3394b5bf1..e9c986c43da3365ccf3fd770d4b0a6c07623f474 100644 (file)
@@ -384,9 +384,10 @@ service_main (void *cls)
     GNUNET_SCHEDULER_add_shutdown (&service_shutdown,
                                    sh);
   GNUNET_SERVICE_resume (sh);
-  sh->service_init_cb (sh->cb_cls,
-                       sh->cfg,
-                       sh);
+  if (NULL != sh->service_init_cb)
+    sh->service_init_cb (sh->cb_cls,
+                        sh->cfg,
+                        sh);
 }
 
 
@@ -2250,6 +2251,8 @@ resume_client_receive (void *cls)
   if (GNUNET_YES == c->needs_continue)
     return; /* #GNUNET_MST_next() did give a message to the client */
   /* need to receive more data from the network first */
+  if (NULL != c->recv_task)
+    return;
   c->recv_task
     = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
                                     c->sock,