MCPcopy Create free account
hub / github.com/apache/httpd / log_script_err

Function log_script_err

modules/generators/cgi_common.h:103–126  ·  view source on GitHub ↗

Soak up stderr from a script and redirect it to the error log. */

Source from the content-addressed store, hash-verified

101/* Soak up stderr from a script and redirect it to the error log.
102 */
103static apr_status_t log_script_err(request_rec *r, apr_file_t *script_err)
104{
105 char argsbuffer[HUGE_STRING_LEN];
106 char *newline;
107 apr_status_t rv;
108 cgi_server_conf *conf = ap_get_module_config(r->server->module_config, &cgi_module);
109
110 while ((rv = apr_file_gets(argsbuffer, HUGE_STRING_LEN,
111 script_err)) == APR_SUCCESS) {
112
113 newline = strchr(argsbuffer, '\n');
114 if (newline) {
115 char *prev = newline - 1;
116 if (prev >= argsbuffer && *prev == '\r') {
117 newline = prev;
118 }
119
120 *newline = '\0';
121 }
122 log_scripterror(r, conf, r->status, 0, APLOGNO(01215), argsbuffer);
123 }
124
125 return rv;
126}
127
128static apr_status_t cgi_handle_exec(include_ctx_t *ctx, ap_filter_t *f,
129 apr_bucket_brigade *bb)

Callers 3

cgi_bucket_readFunction · 0.85
cgi_handle_responseFunction · 0.85
log_scriptFunction · 0.85

Calls 2

ap_get_module_configFunction · 0.85
log_scripterrorFunction · 0.85

Tested by

no test coverage detected