| 658 | | if (-1 == (r = read(hctx->fd, hctx->response->ptr + hctx->response->used - 1, b))) { |
| 659 | | log_error_write(srv, __FILE__, __LINE__, "sds", |
| 660 | | "unexpected end-of-file (perhaps the proxy process died):", |
| 661 | | proxy_fd, strerror(errno)); |
| 662 | | return -1; |
| | 658 | |
| | 659 | { |
| | 660 | int i = 0; |
| | 661 | for (;;++i) { |
| | 662 | if (-1 == (r = read(hctx->fd, hctx->response->ptr + hctx->response->used - 1, b))) { |
| | 663 | if (errno == EAGAIN && i < 3) { |
| | 664 | sleep(1); |
| | 665 | } |
| | 666 | else { |
| | 667 | log_error_write(srv, __FILE__, __LINE__, "sds", |
| | 668 | "unexpected end-of-file (perhaps the proxy process died):", |
| | 669 | proxy_fd, strerror(errno)); |
| | 670 | return -1; |
| | 671 | } |
| | 672 | } |
| | 673 | else break; |
| | 674 | } |