[ovs-dev] [PATCH 06/17] rconn: Don't warn when peer abruptly closes connection.

Gurucharan Shetty shettyg at nicira.com
Tue Jun 24 18:52:52 UTC 2014


On Windows, when a peer terminates without calling a close
on socket fd, the server ends up printing "connection dropped"
warning messages. We probably don't want those warning messages
when the error is WSAECONNRESET.

(In OVS unit tests on Windows, anytime a client like ovs-ofctl
calls a ovs_fatal without clean close(fd) on the socket, the
server like ovs-vswitchd prints warnings that cause unit tests
to fail.)

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 lib/rconn.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/rconn.c b/lib/rconn.c
index e24c356..9ca52bb 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -1171,7 +1171,11 @@ static void
 report_error(struct rconn *rc, int error)
     OVS_REQUIRES(rc->mutex)
 {
-    if (error == EOF) {
+    if (error == EOF
+#ifdef _WIN32
+        || error == WSAECONNRESET
+#endif
+        ) {
         /* If 'rc' isn't reliable, then we don't really expect this connection
          * to last forever anyway (probably it's a connection that we received
          * via accept()), so use DBG level to avoid cluttering the logs. */
-- 
1.7.9.5




More information about the dev mailing list