* Send a block of data, ensure, everything is sent */
| 228 | * Send a block of data, ensure, everything is sent |
| 229 | */ |
| 230 | static int sendall(proxy_conn_rec *conn, const char *buf, apr_size_t length, |
| 231 | request_rec *r) |
| 232 | { |
| 233 | apr_status_t rv; |
| 234 | apr_size_t written; |
| 235 | |
| 236 | while (length > 0) { |
| 237 | written = length; |
| 238 | if ((rv = apr_socket_send(conn->sock, buf, &written)) != APR_SUCCESS) { |
| 239 | ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00858) |
| 240 | "sending data to %s:%u failed", |
| 241 | conn->hostname, conn->port); |
| 242 | return HTTP_SERVICE_UNAVAILABLE; |
| 243 | } |
| 244 | |
| 245 | /* count for stats */ |
| 246 | conn->worker->s->transferred += written; |
| 247 | buf += written; |
| 248 | length -= written; |
| 249 | } |
| 250 | |
| 251 | return OK; |
| 252 | } |
| 253 | |
| 254 | |
| 255 | /* |
no outgoing calls
no test coverage detected