Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MB-3845 - Improved rehabilitation of a born-again conn

It's possible that a conn_new() reuses a conn structure from the
freelist rather than from calloc().  Initialize the fields of that
recycled conn better.

Change-Id: Ib0f491106980f4648c0c60a1ab3c9c5af61a4486
Reviewed-on: http://review.membase.org/6265
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
commit 1222513cf9b9d7efb103351372659de33bf982ac 1 parent 5fa3a33
Steve Yen authored May 15, 2011 alk committed May 16, 2011

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  memcached.c
5  memcached.c
@@ -440,11 +440,16 @@ conn *conn_new(const int sfd, enum conn_states init_state,
440 440
             moxi_log_write( "<%d initialized conn_funcs to default\n", sfd);
441 441
     }
442 442
 
  443
+    c->cmd_curr = -1;
443 444
     c->cmd_start = NULL;
444 445
     c->cmd_start_time = 0;
445 446
     c->cmd_retries = 0;
446 447
     c->corked = NULL;
447 448
     c->host_ident = NULL;
  449
+    c->peer_host = NULL;
  450
+    c->peer_protocol = 0;
  451
+    c->peer_port = 0;
  452
+    c->update_diag = NULL;
448 453
 
449 454
     c->extra = extra;
450 455
 

0 notes on commit 1222513

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