ovs-vsctl: Try connecting only once for active connections by default.
[sliver-openvswitch.git] / lib / reconnect.c
index 0f1e062..b914ef6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
 #include <config.h>
 #include "reconnect.h"
 
-#include <assert.h>
 #include <stdlib.h>
 
 #include "poll-loop.h"
@@ -208,7 +207,8 @@ reconnect_get_max_tries(struct reconnect *fsm)
 
 /* Configures the backoff parameters for 'fsm'.  'min_backoff' is the minimum
  * number of milliseconds, and 'max_backoff' is the maximum, between connection
- * attempts.
+ * attempts.  The current backoff is also the duration that 'fsm' is willing to
+ * wait for a given connection to succeed or fail.
  *
  * 'min_backoff' must be at least 1000, and 'max_backoff' must be greater than
  * or equal to 'min_backoff'.
@@ -503,7 +503,7 @@ reconnect_transition__(struct reconnect *fsm, long long int now,
 static long long int
 reconnect_deadline__(const struct reconnect *fsm)
 {
-    assert(fsm->state_entered != LLONG_MIN);
+    ovs_assert(fsm->state_entered != LLONG_MIN);
     switch (fsm->state) {
     case S_VOID:
     case S_LISTENING: