-/* Copyright (c) 2009 Nicira Networks.
+/* Copyright (c) 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
reply = NULL;
- if (msg->type == JSONRPC_REQUEST && !strcmp(msg->method, "echo")) {
- reply = jsonrpc_create_reply(json_clone(msg->params), msg->id);
- } else if (msg->type == JSONRPC_NOTIFY
+ if (msg->type == JSONRPC_NOTIFY
&& !strcmp(msg->method, "update")
&& msg->params->type == JSON_ARRAY
&& msg->params->u.array.n == 2
&& ovsdb_idl_txn_process_reply(idl, msg)) {
/* ovsdb_idl_txn_process_reply() did everything needful. */
} else {
- VLOG_WARN("%s: received unexpected %s message",
- jsonrpc_session_get_name(idl->session),
- jsonrpc_msg_type_to_string(msg->type));
- jsonrpc_session_force_reconnect(idl->session);
+ /* This can happen if ovsdb_idl_txn_destroy() is called to destroy
+ * a transaction before we receive the reply, so keep the log level
+ * low. */
+ VLOG_DBG("%s: received unexpected %s message",
+ jsonrpc_session_get_name(idl->session),
+ jsonrpc_msg_type_to_string(msg->type));
}
if (reply) {
jsonrpc_session_send(idl->session, reply);
return idl->change_seqno;
}
+bool
+ovsdb_idl_has_ever_connected(const struct ovsdb_idl *idl)
+{
+ return ovsdb_idl_get_seqno(idl) != 0;
+}
+
void
ovsdb_idl_force_reconnect(struct ovsdb_idl *idl)
{
if (!any_updates) {
txn->status = TXN_UNCHANGED;
+ json_destroy(operations);
} else if (!jsonrpc_session_send(
txn->idl->session,
jsonrpc_create_request(