#include "reconnect.h"
#include "stream.h"
#include "timeval.h"
-
-#define THIS_MODULE VLM_jsonrpc
#include "vlog.h"
+
+VLOG_DEFINE_THIS_MODULE(jsonrpc)
\f
struct jsonrpc {
struct stream *stream;
}
/* Creates and returns a jsonrpc_session that is initially connected to
- * 'jsonrpc'. If the connection is dropped, it will not be reconnected. */
+ * 'jsonrpc'. If the connection is dropped, it will not be reconnected.
+ *
+ * On the assumption that such connections are likely to be short-lived
+ * (e.g. from ovs-vsctl), informational logging for them is suppressed. */
struct jsonrpc_session *
jsonrpc_session_open_unreliably(struct jsonrpc *jsonrpc)
{
s = xmalloc(sizeof *s);
s->reconnect = reconnect_create(time_msec());
+ reconnect_set_quiet(s->reconnect, true);
reconnect_set_name(s->reconnect, jsonrpc_get_name(jsonrpc));
reconnect_set_max_tries(s->reconnect, 0);
reconnect_connected(s->reconnect, time_msec());
reply = jsonrpc_create_reply(json_clone(msg->params), msg->id);
jsonrpc_session_send(s, reply);
} else if (msg->type == JSONRPC_REPLY
- && msg->id && msg->id->type == JSON_STRING
- && !strcmp(msg->id->u.string, "echo")) {
+ && msg->id && msg->id->type == JSON_STRING
+ && !strcmp(msg->id->u.string, "echo")) {
/* It's a reply to our echo request. Suppress it. */
} else {
return msg;