Permalink
Browse files

MB-3849 - SERVER_ERROR proxy downstream closed $HOST_IDENT

Change-Id: Ibe9fd62bc76fc1f14554977f592ef347f871d734
Reviewed-on: http://review.membase.org/6268
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
1 parent 142396c commit d4879b6b4a8ff5e5c8fadbee544cc8653d1c70c9 @steveyen steveyen committed with alk May 16, 2011
Showing with 12 additions and 1 deletion.
  1. +10 −0 cproxy.c
  2. +2 −1 cproxy.h
View
@@ -732,6 +732,16 @@ void cproxy_on_close_downstream_conn(conn *c) {
if (IS_ASCII(d->upstream_conn->protocol)) {
d->upstream_suffix = "SERVER_ERROR proxy downstream closed\r\n";
+
+ if (c->host_ident != NULL) {
+ char *s = add_conn_suffix(d->upstream_conn);
+ snprintf(s, SUFFIX_SIZE - 1,
+ "SERVER_ERROR proxy downstream closed %s\r\n",
+ c->host_ident);
+ s[SUFFIX_SIZE - 1] = '\0';
+ d->upstream_suffix = s;
+ }
+
d->upstream_suffix_len = 0;
} else {
d->upstream_status = PROTOCOL_BINARY_RESPONSE_EINTERNAL;
View
@@ -464,7 +464,8 @@ struct downstream {
conn *upstream_conn; // Non-NULL when downstream is reserved.
char *upstream_suffix; // Last bit to write when downstreams are done.
- int upstream_suffix_len; // When >0, overrides strlen(upstream_suffix) for binary.
+ int upstream_suffix_len; // When > 0, overrides strlen(upstream_suffix),
+ // during binary protocol.
// Used during an error when upstream is binary protocol.
protocol_binary_response_status upstream_status;

0 comments on commit d4879b6

Please sign in to comment.