Changeset 498
- Timestamp:
- 04/12/07 17:35:06 (2 years ago)
- Files:
-
- trunk/server/ChangeLog (modified) (1 diff)
- trunk/server/doc/protocol.txt (modified) (1 diff)
- trunk/server/memcached.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/ChangeLog
r496 r498 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> trunk/server/doc/protocol.txt
r496 r498 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: trunk/server/memcached.c
r496 r498 468 468 469 469 if (c->rsize > READ_BUFFER_HIGHWAT && c->rbytes < DATA_BUFFER_SIZE) { 470 char *newbuf; 471 470 472 if (c->rcurr != c->rbuf) 471 473 memmove(c->rbuf, c->rcurr, (size_t)c->rbytes); 472 474 473 char *newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE);475 newbuf = (char *)realloc((void *)c->rbuf, DATA_BUFFER_SIZE); 474 476 475 477 if (newbuf) { … … 654 656 655 657 static void out_string(conn *c, const char *str) { 656 int len;658 size_t len; 657 659 658 660 assert(c != NULL); … … 668 670 } 669 671 670 strcpy(c->wbuf, str);671 strcpy(c->wbuf + len, "\r\n");672 memcpy(c->wbuf, str, len); 673 memcpy(c->wbuf + len, "\r\n", 2); 672 674 c->wbytes = len + 2; 673 675 c->wcurr = c->wbuf; … … 1330 1332 level = strtoul(tokens[1].value, NULL, 10); 1331 1333 settings.verbose = level > MAX_VERBOSITY_LEVEL ? MAX_VERBOSITY_LEVEL : level; 1332 out_string(c, " DONE");1334 out_string(c, "OK"); 1333 1335 return; 1334 1336 } … … 1690 1692 */ 1691 1693 static int transmit(conn *c) { 1692 int res;1693 1694 1694 assert(c != NULL); 1695 1695 … … 1700 1700 } 1701 1701 if (c->msgcurr < c->msgused) { 1702 ssize_t res; 1702 1703 struct msghdr *m = &c->msglist[c->msgcurr]; 1704 1703 1705 res = sendmsg(c->sfd, m, 0); 1704 1706 if (res > 0) { … … 1755 1757 1756 1758 while (!stop) { 1759 1757 1760 switch(c->state) { 1758 1761 case conn_listening: … … 1777 1780 break; 1778 1781 } 1779 conn *newc = conn_new(sfd, conn_read, EV_READ | EV_PERSIST, 1780 DATA_BUFFER_SIZE, false); 1781 if (!newc) { 1782 if (conn_new(sfd, conn_read, EV_READ | EV_PERSIST, 1783 DATA_BUFFER_SIZE, false) == NULL) { 1782 1784 if (settings.verbose > 0) 1783 1785 fprintf(stderr, "couldn't create new connection\n"); … … 2096 2098 } 2097 2099 2098 static int server_socket_unix(c har *path) {2100 static int server_socket_unix(const char *path) { 2099 2101 int sfd; 2100 2102 struct linger ling = {0, 0};
