diff options
author | Ben Pfaff <blp@nicira.com> | 2011-07-13 16:15:22 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-07-26 16:50:09 -0700 |
commit | 87fcbc60f28cde16939b3a9e139bdc67ca831010 (patch) | |
tree | 604269982b12c4557bb869dc454546c1e0da6ccf /ovsdb/jsonrpc-server.h | |
parent | 53ffefe93c91823344645d5e27082381f7f680cc (diff) | |
download | openvswitch-87fcbc60f28cde16939b3a9e139bdc67ca831010.tar.gz |
ovsdb-server: Reliably report status of inbound connections.
ovsdb_jsonrpc_server keeps track of its remotes in a shash indexed on the
remote name specified in the database Manager record, but
ovsdb_jsonrpc_server_get_remote_status() added the name returned by
jsonrpc_session_get_name() to the shash returned to the ovsdb-server code.
If that name happened to be different (which is entirely possible because
the latter returns a "canonicalized" name in some cases) then the
ovsdb-server code couldn't find it. Furthermore, if an inbound (e.g.
"ptcp:") Manager got a connection and then lost it, the status info in
that Manager never got updated to reflect that, because the code considered
that that "couldn't happen" and didn't bother to do any updates.
This commit simplifies the logic. Now ovsdb-server just asks for a single
status record at a time, using the name that is indexed in the
ovsdb_jsonrpc_server shash, avoiding that whole issue.
Diffstat (limited to 'ovsdb/jsonrpc-server.h')
-rw-r--r-- | ovsdb/jsonrpc-server.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ovsdb/jsonrpc-server.h b/ovsdb/jsonrpc-server.h index dc786352e..1d612cdfd 100644 --- a/ovsdb/jsonrpc-server.h +++ b/ovsdb/jsonrpc-server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010 Nicira Networks +/* Copyright (c) 2009, 2010, 2011 Nicira Networks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,9 +42,9 @@ struct ovsdb_jsonrpc_remote_status { unsigned int sec_since_disconnect; bool is_connected; }; -void ovsdb_jsonrpc_server_get_remote_status( - const struct ovsdb_jsonrpc_server *, - struct shash * /* of 'struct ovsdb_jsonrpc_remote_status' */ ); +bool ovsdb_jsonrpc_server_get_remote_status( + const struct ovsdb_jsonrpc_server *, const char *target, + struct ovsdb_jsonrpc_remote_status *); void ovsdb_jsonrpc_server_reconnect(struct ovsdb_jsonrpc_server *); |