* Send request body (if any) */
| 332 | * Send request body (if any) |
| 333 | */ |
| 334 | static int send_request_body(request_rec *r, proxy_conn_rec *conn) |
| 335 | { |
| 336 | if (ap_should_client_block(r)) { |
| 337 | char *buf = apr_palloc(r->pool, AP_IOBUFSIZE); |
| 338 | int status; |
| 339 | long readlen; |
| 340 | |
| 341 | readlen = ap_get_client_block(r, buf, AP_IOBUFSIZE); |
| 342 | while (readlen > 0) { |
| 343 | status = sendall(conn, buf, (apr_size_t)readlen, r); |
| 344 | if (status != OK) { |
| 345 | return HTTP_SERVICE_UNAVAILABLE; |
| 346 | } |
| 347 | readlen = ap_get_client_block(r, buf, AP_IOBUFSIZE); |
| 348 | } |
| 349 | if (readlen == -1) { |
| 350 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00859) |
| 351 | "receiving request body failed"); |
| 352 | return HTTP_INTERNAL_SERVER_ERROR; |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | return OK; |
| 357 | } |
| 358 | |
| 359 | |
| 360 | /* |
no test coverage detected