Commit f56a0fb71923ac931c6643cb29f407dbbe44330c

Kano 2013-03-01T16:57:22

API always report failed send() replies

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/api.c b/api.c
index 6d77c60..9140df6 100644
--- a/api.c
+++ b/api.c
@@ -3433,12 +3433,10 @@ static void send_result(struct io_data *io_data, SOCKETTYPE c, bool isjson)
 	// ignore failure - it's closed immediately anyway
 	n = send(c, buf, len+1, 0);
 
-	if (opt_debug) {
-		if (SOCKETFAIL(n))
-			applog(LOG_DEBUG, "API: send failed: %s", SOCKERRMSG);
-		else
-			applog(LOG_DEBUG, "API: sent %d", n);
-	}
+	if (SOCKETFAIL(n))
+		applog(LOG_WARNING, "API: send failed: %s", SOCKERRMSG);
+	else
+		applog(LOG_DEBUG, "API: sent %d", n);
 }
 
 static void tidyup(__maybe_unused void *arg)