Skip to content

Commit

Permalink
Moxi in mcmux mode give error if default(or behaviour) downstream pro…
Browse files Browse the repository at this point in the history
…tocol is ascii

when moxi running in mcmux mode, if client want to use binary protocol between
moxi and membase, it will send B:host:port <command>, so the peer_protocol of
upstream connection will be binary but we will send still in ascii to membase since
default behaviour is ascii. When we get response from membase, we check that that
upstream connection's peer protocol is binary, so try to parse ascii response with
binary handler and it fails.

Change-Id: I26f097bc7d20a0e11c76560c8be54a9dda6b05b1
Reviewed-on: http://review.couchbase.org/9554
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information
nimish gupta authored and steveyen committed Sep 14, 2011
1 parent 120c83d commit c0e094a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,8 +1935,12 @@ bool cproxy_forward(downstream *d) {
if (IS_ASCII(d->upstream_conn->protocol)) {
// ASCII upstream.
//
if (IS_ASCII(d->upstream_conn->peer_protocol) ||
IS_ASCII(d->ptd->behavior_pool.base.downstream_protocol)) {
unsigned int peer_protocol =
d->upstream_conn->peer_protocol ?
d->upstream_conn->peer_protocol :
d->ptd->behavior_pool.base.downstream_protocol;

if (IS_ASCII(peer_protocol)) {
return cproxy_forward_a2a_downstream(d);
} else {
return cproxy_forward_a2b_downstream(d);
Expand Down

0 comments on commit c0e094a

Please sign in to comment.