Skip to content
Browse files

Moxi in mcmux mode give error if default(or behaviour) downstream pro…

…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...
1 parent 120c83d commit c0e094a5536ea0f3d0bc34377f8361c436fc0755 @nimishzynga nimishzynga committed with steveyen Sep 13, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 cproxy.c
View
8 cproxy.c
@@ -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);

0 comments on commit c0e094a

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