Changeset 736

Show
Ignore:
Timestamp:
03/03/08 05:08:17 (6 months ago)
Author:
dormando
Message:

Give 'SERVER_ERROR out of memory' errors more context.

Files:

Legend:

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

    r729 r736  
    975975        c->write_and_go = conn_read; 
    976976    } else { 
    977         out_string(c, "SERVER_ERROR out of memory"); 
     977        out_string(c, "SERVER_ERROR out of memory writing stats"); 
    978978    } 
    979979} 
     
    11121112 
    11131113        if ((wbuf = (char *)malloc(wsize)) == NULL) { 
    1114             out_string(c, "SERVER_ERROR out of memory"); 
     1114            out_string(c, "SERVER_ERROR out of memory writing stats maps"); 
    11151115            return; 
    11161116        } 
     
    12791279                    stats.get_misses += stats_get_misses; 
    12801280                    STATS_UNLOCK(); 
    1281                     out_string(c, "SERVER_ERROR out of memory"); 
     1281                    out_string(c, "SERVER_ERROR out of memory making CAS suffix"); 
    12821282                    return; 
    12831283                  } 
     
    13481348    if (key_token->value != NULL || add_iov(c, "END\r\n", 5) != 0 
    13491349        || (c->udp && build_udp_headers(c) != 0)) { 
    1350         out_string(c, "SERVER_ERROR out of memory"); 
     1350        out_string(c, "SERVER_ERROR out of memory writing get response"); 
    13511351    } 
    13521352    else { 
     
    14231423            out_string(c, "SERVER_ERROR object too large for cache"); 
    14241424        else 
    1425             out_string(c, "SERVER_ERROR out of memory"); 
     1425            out_string(c, "SERVER_ERROR out of memory storing object"); 
    14261426        /* swallow the data line */ 
    14271427        c->write_and_go = conn_swallow; 
     
    15241524        new_it = do_item_alloc(ITEM_key(it), it->nkey, atoi(ITEM_suffix(it) + 1), it->exptime, res + 2 ); 
    15251525        if (new_it == 0) { 
    1526             return "SERVER_ERROR out of memory"; 
     1526            return "SERVER_ERROR out of memory in incr/decr"; 
    15271527        } 
    15281528        memcpy(ITEM_data(new_it), buf, res); 
     
    16151615             */ 
    16161616            item_remove(it);    /* release reference */ 
    1617             return "SERVER_ERROR out of memory"; 
     1617            return "SERVER_ERROR out of memory expanding delete queue"; 
    16181618        } 
    16191619    } 
     
    16601660    c->iovused = 0; 
    16611661    if (add_msghdr(c) != 0) { 
    1662         out_string(c, "SERVER_ERROR out of memory"); 
     1662        out_string(c, "SERVER_ERROR out of memory preparing response"); 
    16631663        return; 
    16641664    } 
     
    19401940                    fprintf(stderr, "Couldn't realloc input buffer\n"); 
    19411941                c->rbytes = 0; /* ignore what we read */ 
    1942                 out_string(c, "SERVER_ERROR out of memory"); 
     1942                out_string(c, "SERVER_ERROR out of memory reading request"); 
    19431943                c->write_and_go = conn_closing; 
    19441944                return 1;