Changeset 497

Show
Ignore:
Timestamp:
04/12/07 14:40:18 (2 years ago)
Author:
plindner
Message:

Merge in rev 496 -- support for verbosity switching

svn merge -r 495:496 http://code.sixapart.com/svn/memcached/trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/multithreaded/server/ChangeLog

    r490 r497  
     12007-04-12  Paul Lindner  <lindner@mirth.inuus.com> 
     2 
     3        * Allow changes to the verbosity level of the server with a new 
     4          "verbosity" command.  Patch contributed by Paolo Borelli 
     5          <paolo.borelli@gmail.com>. 
     6 
    172007-04-08  Paul Lindner  <lindner@inuus.com> 
    28 
  • branches/multithreaded/server/assoc.c

    r493 r497  
    241241             a+=k[0]+(((uint32_t)k[1])<<16); 
    242242             break; 
    243     case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */ 
    244     case 10: c+=k[4]; 
     243    case 11: c+=((uint32_t)k8[10])<<16;     /* @fallthrough */ 
     244    case 10: c+=k[4];                       /* @fallthrough@ */ 
    245245             b+=k[2]+(((uint32_t)k[3])<<16); 
    246246             a+=k[0]+(((uint32_t)k[1])<<16); 
    247247             break; 
    248     case 9 : c+=k8[8];                      /* fall through */ 
     248    case 9 : c+=k8[8];                      /* @fallthrough */ 
    249249    case 8 : b+=k[2]+(((uint32_t)k[3])<<16); 
    250250             a+=k[0]+(((uint32_t)k[1])<<16); 
    251251             break; 
    252     case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */ 
     252    case 7 : b+=((uint32_t)k8[6])<<16;      /* @fallthrough */ 
    253253    case 6 : b+=k[2]; 
    254254             a+=k[0]+(((uint32_t)k[1])<<16); 
    255255             break; 
    256     case 5 : b+=k8[4];                      /* fall through */ 
     256    case 5 : b+=k8[4];                      /* @fallthrough */ 
    257257    case 4 : a+=k[0]+(((uint32_t)k[1])<<16); 
    258258             break; 
    259     case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */ 
     259    case 3 : a+=((uint32_t)k8[2])<<16;      /* @fallthrough */ 
    260260    case 2 : a+=k[0]; 
    261261             break; 
  • branches/multithreaded/server/doc/protocol.txt

    r487 r497  
    400400server. 
    401401 
     402"verbosity" is a command with one argument, the verbosity level: 
     403 
     404verbosity 2\r\n 
     405 
     406In response, the server sends 
     407 
     408"DONE" 
     409 
    402410 
    403411"quit" is a command with no arguments: 
  • branches/multithreaded/server/items.c

    r493 r497  
    103103        if (tails[id] == 0) return NULL; 
    104104 
    105         for (search = tails[id]; tries > 0 && search; tries--, search=search->prev) { 
     105        for (search = tails[id]; tries > 0 && search != NULL; tries--, search=search->prev) { 
    106106            if (search->refcount == 0) { 
    107107               if (search->exptime > current_time) { 
  • branches/multithreaded/server/memcached.c

    r493 r497  
    14121412} 
    14131413 
     1414static void process_verbosity_command(conn *c, token_t *tokens, const size_t ntokens) { 
     1415    unsigned int level; 
     1416 
     1417    assert(c != NULL); 
     1418 
     1419    level = strtoul(tokens[1].value, NULL, 10); 
     1420    settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; 
     1421    out_string(c, "DONE"); 
     1422    return; 
     1423} 
     1424 
    14141425static void process_command(conn *c, char *command) { 
    14151426 
     
    15881599        out_string(c, "CLIENT_ERROR Slab reassignment not supported"); 
    15891600#endif 
    1590  
     1601    } else if (ntokens == 3 && (strcmp(tokens[COMMAND_TOKEN].value, "verbosity") == 0)) { 
     1602        process_verbosity_command(c, tokens, ntokens); 
    15911603    } else { 
    15921604        out_string(c, "ERROR"); 
  • branches/multithreaded/server/memcached.h

    r487 r497  
    6060    unsigned long long bytes_written; 
    6161}; 
     62 
     63#define MAX_VERBOSITY_LEVEL 2 
    6264 
    6365struct settings {