jsonrpc: Propagate error code to reconnect_disconnected().
authorBen Pfaff <blp@nicira.com>
Fri, 11 Jun 2010 21:39:13 +0000 (14:39 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 22 Jun 2010 18:49:56 +0000 (11:49 -0700)
Always passing 0 to reconnect_disconnected() means that it uses a generic
log message ("connection dropped").  By passing the error code, as done by
this commit, reconnect_disconnected() can log a more specific message.

lib/jsonrpc.c

index bb4f6baf35449b1cf6606218b063704efb9d73f2..13ec4257d573477e1f8aca1c10da7e7537f6de66 100644 (file)
@@ -802,7 +802,7 @@ jsonrpc_session_run(struct jsonrpc_session *s)
         jsonrpc_run(s->rpc);
         error = jsonrpc_get_status(s->rpc);
         if (error) {
-            reconnect_disconnected(s->reconnect, time_msec(), 0);
+            reconnect_disconnected(s->reconnect, time_msec(), error);
             jsonrpc_session_disconnect(s);
         }
     } else if (s->stream) {