Changeset 499

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

merge in 496:498

Files:

Legend:

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

    r497 r499  
    22 
    33        * 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>. 
     4          "verbosity" command and some compiler cleanups.  
     5          Patch contributed by Paolo Borelli <paolo.borelli@gmail.com>. 
    66 
    772007-04-08  Paul Lindner  <lindner@inuus.com> 
  • branches/multithreaded/server/doc/protocol.txt

    r497 r499  
    400400server. 
    401401 
    402 "verbosity" is a command with one argument, the verbosity level: 
    403  
    404 verbosity 2\r\n 
    405  
    406 In response, the server sends 
    407  
    408 "DONE" 
    409  
     402"verbosity" is a command with a numeric argument. It always                                                   
     403succeeds, and the server sends "OK\r\n" in response. Its effect is to                                         
     404set the verbosity level of the logging output.                                                                
    410405 
    411406"quit" is a command with no arguments: 
  • branches/multithreaded/server/memcached.c

    r497 r499  
    466466 
    467467    if (c->rsize > READ_BUFFER_HIGHWAT && c->rbytes < DATA_BUFFER_SIZE) { 
     468        char *newbuf; 
     469 
    468470        if (c->rcurr != c->rbuf) 
    469471            memmove(c->rbuf, c->rcurr, (size_t)c->rbytes); 
    470472 
    471         char *newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE); 
     473        newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE); 
    472474 
    473475        if (newbuf) { 
     
    652654 
    653655static void out_string(conn *c, const char *str) { 
    654     int len; 
     656    size_t len; 
    655657 
    656658    assert(c != NULL); 
     
    666668    } 
    667669 
    668     strcpy(c->wbuf, str); 
    669     strcpy(c->wbuf + len, "\r\n"); 
     670    memcpy(c->wbuf, str, len); 
     671    memcpy(c->wbuf + len, "\r\n", 2); 
    670672    c->wbytes = len + 2; 
    671673    c->wcurr = c->wbuf; 
     
    14191421    level = strtoul(tokens[1].value, NULL, 10); 
    14201422    settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; 
    1421     out_string(c, "DONE"); 
     1423    out_string(c, "OK"); 
    14221424    return; 
    14231425} 
     
    17871789 */ 
    17881790static int transmit(conn *c) { 
    1789     int res; 
    1790  
    17911791    assert(c != NULL); 
    17921792 
     
    17971797    } 
    17981798    if (c->msgcurr < c->msgused) { 
     1799        ssize_t res; 
    17991800        struct msghdr *m = &c->msglist[c->msgcurr]; 
     1801 
    18001802        res = sendmsg(c->sfd, m, 0); 
    18011803        if (res > 0) { 
     
    18541856 
    18551857    while (!stop) { 
     1858 
    18561859        switch(c->state) { 
    18571860        case conn_listening: 
     
    21922195} 
    21932196 
    2194 static int server_socket_unix(char *path) { 
     2197static int server_socket_unix(const char *path) { 
    21952198    int sfd; 
    21962199    struct linger ling = {0, 0};