Changeset e61b4e
- Timestamp:
- 10/05/08 13:49:56 (4 years ago)
- Branches:
- master
- Children:
- b1ae26
- Parents:
- c346b2
- git-author:
- Tomash Brechko <tomash.brechko@…> (10/04/08 16:24:39)
- git-committer:
- Tomash Brechko <tomash.brechko@…> (10/05/08 13:49:56)
- File:
-
- 1 edited
-
src/client.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/client.c
rc346b2 re61b4e 1406 1406 struct server *s; 1407 1407 struct pollfd *pollfd_beg, *pollfd; 1408 int nfds, res; 1409 1410 nfds = 0; 1408 int res; 1409 1410 pollfd_beg = array_beg(c->pollfds, struct pollfd); 1411 pollfd = pollfd_beg; 1412 1411 1413 for (array_each(c->servers, struct server, s)) 1412 1414 { … … 1435 1437 if (may_read || may_write) 1436 1438 { 1437 #if 11438 /*1439 At least gcc 3.4.2--4.2.2 report that res may be used1440 uninitialized here. Though this doesn't look so, we1441 initialize it to suppress the warning.1442 */1443 int res = 0;1444 #endif1445 1446 1439 if (may_write) 1447 1440 { 1441 int res; 1442 1448 1443 res = send_request(state, s); 1449 1444 if (res == MEMCACHED_CLOSED) … … 1452 1447 1453 1448 if (may_read) 1454 res =process_reply(state, s);1455 1456 if ( is_active(state))1457 ++nfds;1449 process_reply(state, s); 1450 1451 if (! is_active(state)) 1452 continue; 1458 1453 } 1459 else 1454 1455 pollfd->events = 0; 1456 1457 if (state->iov_count > 0) 1458 pollfd->events |= POLLOUT; 1459 if (state->reply_count > 0 || state->nowait_count > 0) 1460 pollfd->events |= POLLIN; 1461 1462 if (pollfd->events != 0) 1460 1463 { 1461 ++nfds; 1464 pollfd->fd = state->fd; 1465 state->pollfd = pollfd; 1466 ++pollfd; 1462 1467 } 1463 1468 } 1464 1469 1465 if ( nfds == 0)1470 if (pollfd == pollfd_beg) 1466 1471 break; 1467 1468 pollfd_beg = array_beg(c->pollfds, struct pollfd);1469 pollfd = pollfd_beg;1470 1471 for (array_each(c->servers, struct server, s))1472 {1473 struct command_state *state = &s->cmd_state;1474 1475 if (is_active(state))1476 {1477 pollfd->events = 0;1478 1479 if (state->iov_count > 0)1480 pollfd->events |= POLLOUT;1481 if (state->reply_count > 0 || state->nowait_count > 0)1482 pollfd->events |= POLLIN;1483 1484 if (pollfd->events != 0)1485 {1486 pollfd->fd = state->fd;1487 state->pollfd = pollfd;1488 ++pollfd;1489 }1490 }1491 }1492 1472 1493 1473 do
Note: See TracChangeset
for help on using the changeset viewer.
