| 543 | #endif |
| 544 | |
| 545 | AP_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: |
no test coverage detected