allow starter to initiate connections simultaneously (on auto=start)
authorMartin Willi <martin@strongswan.org>
Mon, 6 Aug 2007 07:41:19 +0000 (07:41 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 6 Aug 2007 07:41:19 +0000 (07:41 -0000)
src/charon/control/interface_manager.c
src/charon/control/interfaces/stroke_interface.c

index 700174c..4cc0581 100644 (file)
@@ -290,6 +290,13 @@ static status_t initiate(private_interface_manager_t *this,
        }
        charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
        
+       if (callback == NULL)
+       {
+               /* don't wait for a result if no callback is specified */
+               charon->bus->set_listen_state(charon->bus, FALSE);
+               return NEED_MORE;
+       }
+       
        /* wait until we get a result */
        while (TRUE)
        {
index 7885fc2..3d4e637 100755 (executable)
@@ -779,10 +779,18 @@ static void stroke_initiate(stroke_msg_t *msg, FILE *out)
                return;
        }
        
-       info.out = out;
-       info.level = msg->output_verbosity;
-       charon->interfaces->initiate(charon->interfaces, peer_cfg, child_cfg,
-                                                                (interface_manager_cb_t)stroke_log, &info);
+       if (msg->output_verbosity < 0)
+       {
+               charon->interfaces->initiate(charon->interfaces, peer_cfg, child_cfg,
+                                                                        NULL, NULL);
+       }
+       else
+       {
+               info.out = out;
+               info.level = msg->output_verbosity;
+               charon->interfaces->initiate(charon->interfaces, peer_cfg, child_cfg,
+                                                                        (interface_manager_cb_t)stroke_log, &info);
+       }
 }
 
 /**