Read and discard all output from the brigade. Note that with the * CGI bucket, the brigade will become empty once the script's stdout * is closed (or on error/timeout), but the stderr output may not have * been entirely captured at this point. */
| 45 | * is closed (or on error/timeout), but the stderr output may not have |
| 46 | * been entirely captured at this point. */ |
| 47 | static void discard_script_output(apr_bucket_brigade *bb) |
| 48 | { |
| 49 | apr_bucket *e; |
| 50 | const char *buf; |
| 51 | apr_size_t len; |
| 52 | |
| 53 | for (e = APR_BRIGADE_FIRST(bb); |
| 54 | e != APR_BRIGADE_SENTINEL(bb) && !APR_BUCKET_IS_EOS(e); |
| 55 | e = APR_BRIGADE_FIRST(bb)) |
| 56 | { |
| 57 | if (apr_bucket_read(e, &buf, &len, APR_BLOCK_READ)) { |
| 58 | break; |
| 59 | } |
| 60 | apr_bucket_delete(e); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | static int log_scripterror(request_rec *r, cgi_server_conf *conf, int ret, |
| 65 | apr_status_t rv, const char *logno, |
no outgoing calls
no test coverage detected