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

Function update_echo_child_status

modules/echo/mod_echo.c:95–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95static int update_echo_child_status(ap_sb_handle_t *sbh,
96 int status, conn_rec *c,
97 apr_bucket_brigade *last_echoed)
98{
99 worker_score *ws = ap_get_scoreboard_worker(sbh);
100 int old_status = ws->status;
101
102 ws->status = status;
103
104 if (!ap_extended_status)
105 return old_status;
106
107 ws->last_used = apr_time_now();
108
109 /* initial pass only, please - in the name of efficiency */
110 if (c) {
111 apr_cpystrn(ws->client64,
112 ap_get_remote_host(c, c->base_server->lookup_defaults,
113 REMOTE_NOLOOKUP, NULL),
114 sizeof(ws->client64));
115 apr_cpystrn(ws->vhost, c->base_server->server_hostname,
116 sizeof(ws->vhost));
117 /* Deliberate trailing space - filling in string on WRITE passes */
118 apr_cpystrn(ws->request, "ECHO ", sizeof(ws->request));
119 }
120
121 /* each subsequent WRITE pass, let's update what we echoed */
122 if (last_echoed) {
123 brigade_peek(last_echoed, ws->request + sizeof("ECHO ") - 1,
124 sizeof(ws->request) - sizeof("ECHO ") + 1);
125 }
126
127 return old_status;
128}
129
130static int process_echo_connection(conn_rec *c)
131{

Callers 1

process_echo_connectionFunction · 0.85

Calls 3

ap_get_scoreboard_workerFunction · 0.85
ap_get_remote_hostFunction · 0.85
brigade_peekFunction · 0.85

Tested by

no test coverage detected