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