Changeset 499
- Timestamp:
- 04/12/07 17:38:46 (2 years ago)
- Files:
-
- branches/multithreaded/server/ChangeLog (modified) (1 diff)
- branches/multithreaded/server/doc/protocol.txt (modified) (1 diff)
- branches/multithreaded/server/memcached.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/multithreaded/server/ChangeLog
r497 r499 2 2 3 3 * Allow changes to the verbosity level of the server with a new 4 "verbosity" command . Patch contributed by Paolo Borelli5 <paolo.borelli@gmail.com>.4 "verbosity" command and some compiler cleanups. 5 Patch contributed by Paolo Borelli <paolo.borelli@gmail.com>. 6 6 7 7 2007-04-08 Paul Lindner <lindner@inuus.com> branches/multithreaded/server/doc/protocol.txt
r497 r499 400 400 server. 401 401 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 403 succeeds, and the server sends "OK\r\n" in response. Its effect is to 404 set the verbosity level of the logging output. 410 405 411 406 "quit" is a command with no arguments: branches/multithreaded/server/memcached.c
r497 r499 466 466 467 467 if (c->rsize > READ_BUFFER_HIGHWAT && c->rbytes < DATA_BUFFER_SIZE) { 468 char *newbuf; 469 468 470 if (c->rcurr != c->rbuf) 469 471 memmove(c->rbuf, c->rcurr, (size_t)c->rbytes); 470 472 471 char *newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE);473 newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE); 472 474 473 475 if (newbuf) { … … 652 654 653 655 static void out_string(conn *c, const char *str) { 654 int len;656 size_t len; 655 657 656 658 assert(c != NULL); … … 666 668 } 667 669 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); 670 672 c->wbytes = len + 2; 671 673 c->wcurr = c->wbuf; … … 1419 1421 level = strtoul(tokens[1].value, NULL, 10); 1420 1422 settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; 1421 out_string(c, " DONE");1423 out_string(c, "OK"); 1422 1424 return; 1423 1425 } … … 1787 1789 */ 1788 1790 static int transmit(conn *c) { 1789 int res;1790 1791 1791 assert(c != NULL); 1792 1792 … … 1797 1797 } 1798 1798 if (c->msgcurr < c->msgused) { 1799 ssize_t res; 1799 1800 struct msghdr *m = &c->msglist[c->msgcurr]; 1801 1800 1802 res = sendmsg(c->sfd, m, 0); 1801 1803 if (res > 0) { … … 1854 1856 1855 1857 while (!stop) { 1858 1856 1859 switch(c->state) { 1857 1860 case conn_listening: … … 2192 2195 } 2193 2196 2194 static int server_socket_unix(c har *path) {2197 static int server_socket_unix(const char *path) { 2195 2198 int sfd; 2196 2199 struct linger ling = {0, 0};
