Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ conn *conn_new(const int sfd, STATE_FUNC init_state,
c->pcurr = c->ilist;
#endif
c->icurr = c->ilist;
c->suffixcurr = c->suffixlist;
#ifdef SCAN_COMMAND
c->pleft = 0;
#endif
Expand Down Expand Up @@ -858,10 +857,9 @@ static void conn_cleanup(conn *c)
}
#endif

if (c->suffixleft != 0) {
for (; c->suffixleft > 0; c->suffixleft--, c->suffixcurr++) {
cache_free(c->thread->suffix_cache, *(c->suffixcurr));
}
while (c->suffixleft > 0) {
c->suffixleft--;
cache_free(c->thread->suffix_cache, c->suffixlist[c->suffixleft]);
}

if (c->write_and_free) {
Expand Down Expand Up @@ -3117,7 +3115,6 @@ static void process_mget_complete(conn *c, bool return_cas)
* To release the items and free the suffixes, the below code is needed.
*/
c->icurr = c->ilist;
c->suffixcurr = c->suffixlist;

if (ret != ENGINE_SUCCESS) {
/* Releasing items on ilist and freeing suffixes will be
Expand Down Expand Up @@ -3273,7 +3270,6 @@ static void process_sasl_auth_complete(conn *c)
} else {
conn_set_state(c, conn_mwrite);
}
c->suffixcurr = c->suffixlist;
} else {
out_string(c, "AUTH_ERROR");
STATS_ERRORS_NOKEY(c, auth);
Expand Down Expand Up @@ -8577,7 +8573,6 @@ static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens,
* To release the items and free the suffixes, the below code is needed.
*/
c->icurr = c->ilist;
c->suffixcurr = c->suffixlist;

if (ret != ENGINE_SUCCESS) {
/* Releasing items on ilist and freeing suffixes will be
Expand Down Expand Up @@ -14246,10 +14241,8 @@ bool conn_mwrite(conn *c)
}
#endif
while (c->suffixleft > 0) {
char *suffix = *(c->suffixcurr);
cache_free(c->thread->suffix_cache, suffix);
c->suffixcurr++;
c->suffixleft--;
cache_free(c->thread->suffix_cache, c->suffixlist[c->suffixleft]);
}
if (c->coll_eitem != NULL) {
conn_coll_eitem_free(c);
Expand Down
1 change: 0 additions & 1 deletion memcached.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ struct conn {

char **suffixlist;
int suffixsize;
char **suffixcurr;
int suffixleft;

enum protocol protocol; /* which protocol this connection speaks */
Expand Down