From 4fc0578a9d02993d5f17c7e6a2628ead2589bf23 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Thu, 25 Jun 2015 15:08:40 +0900 Subject: [PATCH] WIP: bugfixes, machi_flu1_test still broken --- src/machi.proto | 2 +- src/machi_flu1_client.erl | 3 ++- src/machi_pb_wrap.erl | 2 +- test/machi_flu1_test.erl | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/machi.proto b/src/machi.proto index 7ae4c96..dbf5237 100644 --- a/src/machi.proto +++ b/src/machi.proto @@ -353,7 +353,7 @@ message Mpb_LL_ReadProjectionResp { message Mpb_LL_WriteProjectionReq { required Mpb_ProjType type = 1; - required Mpb_ProjectionV1 proj = 1; + required Mpb_ProjectionV1 proj = 2; } message Mpb_LL_WriteProjectionResp { diff --git a/src/machi_flu1_client.erl b/src/machi_flu1_client.erl index a6e19a5..8f90381 100644 --- a/src/machi_flu1_client.erl +++ b/src/machi_flu1_client.erl @@ -834,7 +834,8 @@ list_all_projections2(Sock, ProjType) -> do_projection_common(Sock, Req) -> erase(bad_sock), try - ReqBin = machi_pb:encode_mpb_ll_request(Req), + ReqBin = list_to_binary(machi_pb:encode_mpb_ll_request(Req)), +io:format(user, "\nTrying: ~p\n", [machi_pb:decode_mpb_ll_request(ReqBin)]), Len = iolist_size(ReqBin), true = (Len =< ?MAX_CHUNK_SIZE), LenHex = machi_util:int_to_hexbin(Len, 32), diff --git a/src/machi_pb_wrap.erl b/src/machi_pb_wrap.erl index 5d97186..be089ab 100644 --- a/src/machi_pb_wrap.erl +++ b/src/machi_pb_wrap.erl @@ -149,7 +149,7 @@ make_projection_req(ID, {write_projection, ProjType, Proj}) -> ProjM = conv_from_projection_v1(Proj), #mpb_ll_request{req_id=ID, proj_wp=#mpb_ll_writeprojectionreq{type=conv_from_type(ProjType), - proj=ProjM}}; + proj=ProjM}}; make_projection_req(ID, {get_all_projections, ProjType}) -> #mpb_ll_request{req_id=ID, proj_ga=#mpb_ll_getallprojectionsreq{type=conv_from_type(ProjType)}}; diff --git a/test/machi_flu1_test.erl b/test/machi_flu1_test.erl index 7a0045d..f14c9b6 100644 --- a/test/machi_flu1_test.erl +++ b/test/machi_flu1_test.erl @@ -173,7 +173,7 @@ flu_projection_smoke_test() -> {ok, []} = ?FLU_C:list_all_projections(Host, TcpPort, T), {ok, []} = ?FLU_C:get_all_projections(Host, TcpPort, T), - P_a = #p_srvr{name=a}, + P_a = #p_srvr{name=a, port=4321}, P1 = machi_projection:new(1, a, [P_a], [], [a], [], []), ok = ?FLU_C:write_projection(Host, TcpPort, T, P1), {error, written} = ?FLU_C:write_projection(Host, TcpPort, T, P1),