| 474 | } |
| 475 | |
| 476 | static void clientDone(client c) { |
| 477 | int requests_finished = 0; |
| 478 | atomicGet(config.requests_finished, requests_finished); |
| 479 | if (requests_finished >= config.requests) { |
| 480 | freeClient(c); |
| 481 | if (!config.num_threads && config.el) aeStop(config.el); |
| 482 | return; |
| 483 | } |
| 484 | if (config.keepalive) { |
| 485 | resetClient(c); |
| 486 | } else { |
| 487 | if (config.num_threads) pthread_mutex_lock(&(config.liveclients_mutex)); |
| 488 | config.liveclients--; |
| 489 | createMissingClients(c); |
| 490 | config.liveclients++; |
| 491 | if (config.num_threads) |
| 492 | pthread_mutex_unlock(&(config.liveclients_mutex)); |
| 493 | freeClient(c); |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) { |
| 498 | client c = privdata; |
no test coverage detected