Skip to content

Commit

Permalink
added cmd_retries to conn
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Apr 23, 2009
1 parent ed80bb9 commit c3fd319
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cproxy.c
Expand Up @@ -325,14 +325,13 @@ void cproxy_on_close_downstream_conn(conn *c) {
// ending up here. That is, drive_machine only
// seems to move to conn_closing from conn_read.
//
// TODO: Need a retry counter on the upstream conn?
//
if (c->rcurr != NULL &&
c->rbytes == 0 &&
d->downstream_used_start == d->downstream_used &&
d->downstream_used_start == 1) {
d->downstream_used_start == 1 &&
d->upstream_conn->cmd_retries < 1) {
d->upstream_conn->cmd_retries++;
uc_retry = d->upstream_conn;

d->upstream_suffix = NULL;
}
}
Expand Down
1 change: 1 addition & 0 deletions cproxy_protocol.c
Expand Up @@ -35,6 +35,7 @@ void cproxy_process_upstream_ascii(conn *c, char *line) {
// Snapshot rcurr, because the caller, try_read_command(), changes it.
//
c->cmd_ascii = c->rcurr;
c->cmd_retries = 0;

/* For commands set/add/replace, we build an item and read the data
* directly into it, then continue in nread_complete().
Expand Down
4 changes: 3 additions & 1 deletion memcached.h
Expand Up @@ -413,8 +413,10 @@ struct conn {
LIBEVENT_THREAD *thread; /* Pointer to the thread object serving this connection */

conn_funcs *funcs;
char *cmd_ascii; // Pointer into rbuf, snapshot of rcurr.
void *extra;

char *cmd_ascii; // Pointer into rbuf, snapshot of rcurr.
int cmd_retries;
};

extern conn *listen_conn;
Expand Down

0 comments on commit c3fd319

Please sign in to comment.