Skip to content
Browse files

fixed invalid vclocks on put

  • Loading branch information...
1 parent 3a4bce6 commit b59897dbbaf956756b2801a09585da903d41d1d5 Dave Parfitt committed
Showing with 3 additions and 4 deletions.
  1. +2 −1 src/Riak.ml
  2. +1 −3 src/Test.ml
View
3 src/Riak.ml
@@ -506,7 +506,8 @@ let riak_put (conn:riak_connection) bucket key value options vclock=
let pbresp = send_pb_message conn (Some genreq) rpbPutReq rpbPutResp in
let resp = Riak_kv_piqi.parse_rpb_put_resp pbresp in
let v = resp.Riak_kv_piqi.Rpb_put_resp.content in
- List.map (riak_process_content bucket key vclock) v
+ let newvclock = resp.Riak_kv_piqi.Rpb_put_resp.vclock in
+ List.map (riak_process_content bucket key newvclock) v
let riak_del (conn:riak_connection) bucket key options =
let delreq = process_del_options options (new_del_req bucket key) in
View
4 src/Test.ml
@@ -66,14 +66,12 @@ let test_case_put _ =
let newkey = "foo" ^ string_of_int(n) in
let newval = "bar" ^ string_of_int(n) in
let objs = riak_put conn bucket (Some newkey) newval [Put_return_body true] None in
- let f = List.hd objs in
- show_option f.obj_vclock;
let testval os =
match os with
| [] -> assert_failure "No objects returned from put"
| o :: [] ->
(match o.obj_vclock with
- | Some v -> assert_string v
+ | Some v -> assert_bool "Invalid vclock" (v <> "")
| None -> assert_failure "Put with return_body didn't return any data")
| o :: tl -> assert_failure "Put returned sublings"
in

0 comments on commit b59897d

Please sign in to comment.
Something went wrong with that request. Please try again.