Skip to content

Commit

Permalink
make iproto answer to be 3 part even for ping
Browse files Browse the repository at this point in the history
This will simplify client library construction cause it will allow to use
streaming MsgPack decoding.
If reply has variable part count, then request decoder which uses streaming
decoder, need to wait next part to analize: is it belongs to this reply
(body map) or start of next reply (ie length integer)? So that, if request
(ping) were single request, request decoder will stuck.
  • Loading branch information
funny-falcon committed Jan 15, 2015
1 parent 084fbe6 commit f433f4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/box/iproto_port.cc
Expand Up @@ -72,9 +72,11 @@ void
iproto_reply_ping(struct obuf *out, uint64_t sync)
{
struct iproto_header_bin reply = iproto_header_bin;
reply.v_len = mp_bswap_u32(sizeof(iproto_header_bin) - 5);
reply.v_len = mp_bswap_u32(sizeof(iproto_header_bin) - 5 + 1);
reply.v_sync = mp_bswap_u64(sync);
uint8_t empty_map[1] = { 0x80 };
obuf_dup(out, &reply, sizeof(reply));
obuf_dup(out, &empty_map, sizeof(empty_map));
}

static inline uint32_t
Expand Down

0 comments on commit f433f4b

Please sign in to comment.