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

Function send_data

modules/proxy/mod_proxy_fcgi.c:243–285  ·  view source on GitHub ↗

Wrapper for apr_socket_sendv that handles updating the worker stats. */

Source from the content-addressed store, hash-verified

241
242/* Wrapper for apr_socket_sendv that handles updating the worker stats. */
243static apr_status_t send_data(proxy_conn_rec *conn,
244 struct iovec *vec,
245 int nvec,
246 apr_size_t *len)
247{
248 apr_status_t rv = APR_SUCCESS;
249 apr_size_t written = 0, to_write = 0;
250 int i, offset;
251 apr_socket_t *s = conn->sock;
252
253 for (i = 0; i < nvec; i++) {
254 to_write += vec[i].iov_len;
255 }
256
257 offset = 0;
258 while (to_write) {
259 apr_size_t n = 0;
260 rv = apr_socket_sendv(s, vec + offset, nvec - offset, &n);
261 if (rv != APR_SUCCESS) {
262 break;
263 }
264 if (n > 0) {
265 written += n;
266 if (written >= to_write)
267 break; /* short circuit out */
268 for (i = offset; i < nvec; ) {
269 if (n >= vec[i].iov_len) {
270 offset++;
271 n -= vec[i++].iov_len;
272 } else {
273 vec[i].iov_len -= n;
274 vec[i].iov_base = (char *) vec[i].iov_base + n;
275 break;
276 }
277 }
278 }
279 }
280
281 conn->worker->s->transferred += written;
282 *len = written;
283
284 return rv;
285}
286
287/* Wrapper for apr_socket_recv that handles updating the worker stats. */
288static apr_status_t get_data(proxy_conn_rec *conn,

Callers 3

send_begin_requestFunction · 0.85
send_environmentFunction · 0.85
dispatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected