** dav_error_response() ** ** Send a nice response back to the user. In most cases, Apache doesn't ** allow us to provide details in the body about what happened. This ** function allows us to completely specify the response body. ** ** ### this function is not logging any errors! (e.g. the body) */
| 358 | ** ### this function is not logging any errors! (e.g. the body) |
| 359 | */ |
| 360 | static int dav_error_response(request_rec *r, int status, const char *body) |
| 361 | { |
| 362 | r->status = status; |
| 363 | r->status_line = ap_get_status_line(status); |
| 364 | |
| 365 | ap_set_content_type_ex(r, "text/html; charset=ISO-8859-1", 1); |
| 366 | |
| 367 | /* begin the response now... */ |
| 368 | ap_rvputs(r, |
| 369 | DAV_RESPONSE_BODY_1, |
| 370 | r->status_line, |
| 371 | DAV_RESPONSE_BODY_2, |
| 372 | &r->status_line[4], |
| 373 | DAV_RESPONSE_BODY_3, |
| 374 | body, |
| 375 | DAV_RESPONSE_BODY_4, |
| 376 | ap_psignature("<hr />\n", r), |
| 377 | DAV_RESPONSE_BODY_5, |
| 378 | NULL); |
| 379 | |
| 380 | /* the response has been sent. */ |
| 381 | /* |
| 382 | * ### Use of DONE obviates logging..! |
| 383 | */ |
| 384 | return DONE; |
| 385 | } |
| 386 | |
| 387 | |
| 388 | /* |
no test coverage detected