Changeset 496

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

Add patch for changable verbosity levels

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/server/ChangeLog

    r492 r496  
     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 
  • trunk/server/assoc.c

    r492 r496  
    246246             a+=k[0]+(((uint32_t)k[1])<<16); 
    247247             break; 
    248     case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */ 
    249     case 10: c+=k[4]; 
     248    case 11: c+=((uint32_t)k8[10])<<16;     /* @fallthrough */ 
     249    case 10: c+=k[4];                       /* @fallthrough@ */ 
    250250             b+=k[2]+(((uint32_t)k[3])<<16); 
    251251             a+=k[0]+(((uint32_t)k[1])<<16); 
    252252             break; 
    253     case 9 : c+=k8[8];                      /* fall through */ 
     253    case 9 : c+=k8[8];                      /* @fallthrough */ 
    254254    case 8 : b+=k[2]+(((uint32_t)k[3])<<16); 
    255255             a+=k[0]+(((uint32_t)k[1])<<16); 
    256256             break; 
    257     case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */ 
     257    case 7 : b+=((uint32_t)k8[6])<<16;      /* @fallthrough */ 
    258258    case 6 : b+=k[2]; 
    259259             a+=k[0]+(((uint32_t)k[1])<<16); 
    260260             break; 
    261     case 5 : b+=k8[4];                      /* fall through */ 
     261    case 5 : b+=k8[4];                      /* @fallthrough */ 
    262262    case 4 : a+=k[0]+(((uint32_t)k[1])<<16); 
    263263             break; 
    264     case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */ 
     264    case 3 : a+=((uint32_t)k8[2])<<16;      /* @fallthrough */ 
    265265    case 2 : a+=k[0]; 
    266266             break; 
  • trunk/server/doc/protocol.txt

    r484 r496  
    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: 
  • trunk/server/items.c

    r492 r496  
    9797        if (tails[id] == 0) return NULL; 
    9898 
    99         for (search = tails[id]; tries > 0 && search; tries--, search=search->prev) { 
     99        for (search = tails[id]; tries > 0 && search != NULL; tries--, search=search->prev) { 
    100100            if (search->refcount == 0) { 
    101101               if (search->exptime > current_time) 
  • trunk/server/memcached.c

    r492 r496  
    13231323} 
    13241324 
     1325static void process_verbosity_command(conn *c, token_t *tokens, const size_t ntokens) { 
     1326    unsigned int level; 
     1327 
     1328    assert(c != NULL); 
     1329 
     1330    level = strtoul(tokens[1].value, NULL, 10); 
     1331    settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; 
     1332    out_string(c, "DONE"); 
     1333    return; 
     1334} 
     1335 
    13251336static void process_command(conn *c, char *command) { 
    13261337 
     
    14991510        out_string(c, "CLIENT_ERROR Slab reassignment not supported"); 
    15001511#endif 
    1501  
     1512    } else if (ntokens == 3 && (strcmp(tokens[COMMAND_TOKEN].value, "verbosity") == 0)) { 
     1513        process_verbosity_command(c, tokens, ntokens); 
    15021514    } else { 
    15031515        out_string(c, "ERROR"); 
  • trunk/server/memcached.h

    r476 r496  
    5454    unsigned long long bytes_written; 
    5555}; 
     56 
     57#define MAX_VERBOSITY_LEVEL 2 
    5658 
    5759struct settings {