Changeset 651

Show
Ignore:
Timestamp:
11/21/07 19:59:12 (1 year ago)
Author:
dormando
Message:

Remove conn_caswrite mode. Tomash pointed out that it's unneeded.
One more change to suffix malloc'ing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/server/memcached.c

    r650 r651  
    575575        /* If malloc fails, let the logic fall through without spamming 
    576576         * STDERR on the server. */ 
    577         s = malloc( sizeof(char *) * SUFFIX_SIZE ); 
     577        s = malloc( SUFFIX_SIZE ); 
    578578    } 
    579579 
     
    13221322        out_string(c, "SERVER_ERROR out of memory"); 
    13231323    } 
    1324     else if (return_cas) { 
    1325         conn_set_state(c, conn_caswrite); 
    1326         c->msgcurr = 0; 
    1327     } 
    13281324    else { 
    13291325        conn_set_state(c, conn_mwrite); 
     
    22052201 
    22062202        case conn_mwrite: 
    2207         case conn_caswrite: 
    22082203            switch (transmit(c)) { 
    22092204            case TRANSMIT_COMPLETE: 
    2210                 if (c->state == conn_mwrite || c->state == conn_caswrite) { 
     2205                if (c->state == conn_mwrite) { 
    22112206                    while (c->ileft > 0) { 
    22122207                        item *it = *(c->icurr); 
     
    22162211                        c->ileft--; 
    22172212                    } 
    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); 
    22272218                        } 
     2219                        c->suffixcurr++; 
     2220                        c->suffixleft--; 
    22282221                    } 
    22292222                    conn_set_state(c, conn_read); 
  • trunk/server/memcached.h

    r650 r651  
    141141    conn_closing,    /** closing this connection */ 
    142142    conn_mwrite,     /** writing out many items sequentially */ 
    143     conn_caswrite,   /** writing out many items sequentially with cas value */ 
    144143}; 
    145144