summaryrefslogtreecommitdiffstats
path: root/lib/smux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smux.c')
-rw-r--r--lib/smux.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/smux.c b/lib/smux.c
index 6285c94d..c5159dd9 100644
--- a/lib/smux.c
+++ b/lib/smux.c
@@ -226,7 +226,8 @@ smux_socket ()
}
freeaddrinfo(res0);
if (sock < 0)
- zlog_warn ("Can't connect to SNMP agent with SMUX");
+ if (debug_smux)
+ zlog_debug ("Can't connect to SNMP agent with SMUX");
#else
sock = socket (AF_INET, SOCK_STREAM, 0);
if (sock < 0)
@@ -257,7 +258,8 @@ smux_socket ()
{
close (sock);
smux_sock = -1;
- zlog_warn ("Can't connect to SNMP agent with SMUX");
+ if (debug_smux)
+ zlog_debug ("Can't connect to SNMP agent with SMUX");
return -1;
}
#endif
@@ -1179,7 +1181,10 @@ smux_connect (struct thread *t)
int ret;
if (debug_smux)
- zlog_debug ("SMUX connect try %d", fail + 1);
+ {
+ fail = fail + 1;
+ zlog_debug ("SMUX connect try %d", fail);
+ }
/* Clear thread poner of myself. */
smux_connect_thread = NULL;
@@ -1188,8 +1193,10 @@ smux_connect (struct thread *t)
smux_sock = smux_socket ();
if (smux_sock < 0)
{
- if (++fail < SMUX_MAX_FAILURE)
- smux_event (SMUX_CONNECT, 0);
+ if (debug_smux)
+ zlog_debug ("SMUX socket/connection creation error");
+ // if (++fail < SMUX_MAX_FAILURE)
+ smux_event (SMUX_CONNECT, 0);
return 0;
}
@@ -1200,8 +1207,8 @@ smux_connect (struct thread *t)
zlog_warn ("SMUX open message send failed: %s", safe_strerror (errno));
close (smux_sock);
smux_sock = -1;
- if (++fail < SMUX_MAX_FAILURE)
- smux_event (SMUX_CONNECT, 0);
+ // if (++fail < SMUX_MAX_FAILURE)
+ smux_event (SMUX_CONNECT, 0);
return -1;
}
@@ -1212,8 +1219,8 @@ smux_connect (struct thread *t)
zlog_warn ("SMUX register message send failed: %s", safe_strerror (errno));
close (smux_sock);
smux_sock = -1;
- if (++fail < SMUX_MAX_FAILURE)
- smux_event (SMUX_CONNECT, 0);
+ // if (++fail < SMUX_MAX_FAILURE)
+ smux_event (SMUX_CONNECT, 0);
return -1;
}