Changeset 651
- Timestamp:
- 11/21/07 19:59:12 (1 year ago)
- Files:
-
- trunk/server/memcached.c (modified) (4 diffs)
- trunk/server/memcached.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/memcached.c
r650 r651 575 575 /* If malloc fails, let the logic fall through without spamming 576 576 * STDERR on the server. */ 577 s = malloc( sizeof(char *) *SUFFIX_SIZE );577 s = malloc( SUFFIX_SIZE ); 578 578 } 579 579 … … 1322 1322 out_string(c, "SERVER_ERROR out of memory"); 1323 1323 } 1324 else if (return_cas) {1325 conn_set_state(c, conn_caswrite);1326 c->msgcurr = 0;1327 }1328 1324 else { 1329 1325 conn_set_state(c, conn_mwrite); … … 2205 2201 2206 2202 case conn_mwrite: 2207 case conn_caswrite:2208 2203 switch (transmit(c)) { 2209 2204 case TRANSMIT_COMPLETE: 2210 if (c->state == conn_mwrite || c->state == conn_caswrite) {2205 if (c->state == conn_mwrite) { 2211 2206 while (c->ileft > 0) { 2212 2207 item *it = *(c->icurr); … … 2216 2211 c->ileft--; 2217 2212 } 2218 if (c->state == conn_caswrite) { 2219 while (c->suffixleft > 0) { 2220 char *suffix = *(c->suffixcurr); 2221 if(suffix_add_to_freelist(suffix)) { 2222 /* Failed to add to freelist, don't leak */ 2223 free(suffix); 2224 } 2225 c->suffixcurr++; 2226 c->suffixleft--; 2213 while (c->suffixleft > 0) { 2214 char *suffix = *(c->suffixcurr); 2215 if(suffix_add_to_freelist(suffix)) { 2216 /* Failed to add to freelist, don't leak */ 2217 free(suffix); 2227 2218 } 2219 c->suffixcurr++; 2220 c->suffixleft--; 2228 2221 } 2229 2222 conn_set_state(c, conn_read); trunk/server/memcached.h
r650 r651 141 141 conn_closing, /** closing this connection */ 142 142 conn_mwrite, /** writing out many items sequentially */ 143 conn_caswrite, /** writing out many items sequentially with cas value */144 143 }; 145 144
