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

Function ap_getline

server/protocol.c:545–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543#endif
544
545AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int flags)
546{
547 char *tmp_s = s;
548 apr_status_t rv;
549 apr_size_t len;
550 apr_bucket_brigade *tmp_bb;
551
552 if (n < 1) {
553 /* Can't work since we always NUL terminate */
554 return -1;
555 }
556
557 tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
558 rv = ap_rgetline(&tmp_s, n, &len, r, flags, tmp_bb);
559 apr_brigade_destroy(tmp_bb);
560
561 /* Map the out-of-space condition to the old API. */
562 if (rv == APR_ENOSPC) {
563 return n;
564 }
565
566 /* Anything else is just bad. */
567 if (rv != APR_SUCCESS) {
568 return -1;
569 }
570
571 return (int)len;
572}
573
574/* parse_uri: break apart the uri
575 * Side Effects:

Callers 2

mod_proxy_uwsgi.cFile · 0.85
hc_read_headersFunction · 0.85

Calls 1

ap_rgetlineFunction · 0.85

Tested by

no test coverage detected