From 9196573d0673e6aa36398fd03670bc636bd9a4e1 Mon Sep 17 00:00:00 2001 From: Ali Ince Date: Wed, 19 Sep 2018 15:28:25 +0100 Subject: [PATCH 1/2] Ignore passed-in bookmarks for Bolt V1 instead of returning error --- seabolt/src/bolt/protocol/v1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/seabolt/src/bolt/protocol/v1.c b/seabolt/src/bolt/protocol/v1.c index 93a6499d..c506ddfd 100644 --- a/seabolt/src/bolt/protocol/v1.c +++ b/seabolt/src/bolt/protocol/v1.c @@ -736,9 +736,10 @@ int BoltProtocolV1_set_tx_timeout_unsupported(struct BoltConnection* connection, return BOLT_PROTOCOL_UNSUPPORTED; } -int BoltProtocolV1_set_tx_bookmark_unsupported(struct BoltConnection* connection, struct BoltValue* value) +int BoltProtocolV1_set_tx_bookmark_ignore(struct BoltConnection* connection, struct BoltValue* value) { - return BOLT_PROTOCOL_UNSUPPORTED; + // we will ignore bookmarks with this version of the protocol + return BOLT_SUCCESS; } int BoltProtocolV1_set_tx_metadata_unsupported(struct BoltConnection* connection, struct BoltValue* value) @@ -769,7 +770,7 @@ struct BoltProtocol* BoltProtocolV1_create_protocol() protocol->clear_run = &BoltProtocolV1_clear_load_run_request; protocol->set_run_cypher = &BoltProtocolV1_set_run_cypher; protocol->set_run_cypher_parameter = &BoltProtocolV1_set_run_cypher_parameter; - protocol->set_run_bookmark = &BoltProtocolV1_set_tx_bookmark_unsupported; + protocol->set_run_bookmark = &BoltProtocolV1_set_tx_bookmark_ignore; protocol->set_run_tx_timeout = &BoltProtocolV1_set_tx_timeout_unsupported; protocol->set_run_tx_metadata = &BoltProtocolV1_set_tx_metadata_unsupported; protocol->load_run = &BoltProtocolV1_load_run_request; From 9c590228c2eff5ba41b7802ede07e28b1a14c4b4 Mon Sep 17 00:00:00 2001 From: Ali Ince Date: Wed, 19 Sep 2018 15:28:54 +0100 Subject: [PATCH 2/2] Fix a typo in setting parameter key for bookmarks --- seabolt/src/bolt/protocol/v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seabolt/src/bolt/protocol/v1.c b/seabolt/src/bolt/protocol/v1.c index c506ddfd..e8efe6c0 100644 --- a/seabolt/src/bolt/protocol/v1.c +++ b/seabolt/src/bolt/protocol/v1.c @@ -329,7 +329,7 @@ int BoltProtocolV1_set_begin_tx_bookmark(struct BoltConnection* connection, stru struct BoltValue* bookmarks; if (params->size==0) { BoltValue_format_as_Dictionary(params, 1); - if (BoltDictionary_set_key(params, 0, BOOKMARK_KEY, BOOKMARK_KEY_SIZE)) { + if (BoltDictionary_set_key(params, 0, BOOKMARKS_KEY, BOOKMARKS_KEY_SIZE)) { return BOLT_PROTOCOL_VIOLATION; } bookmarks = BoltDictionary_value(params, 0);