| 1513 | } |
| 1514 | |
| 1515 | static void copy_uri_components(apr_uri_t *dst, |
| 1516 | apr_uri_t *src, request_rec *r) { |
| 1517 | if (src->scheme && src->scheme[0] != '\0') { |
| 1518 | dst->scheme = src->scheme; |
| 1519 | } |
| 1520 | else { |
| 1521 | dst->scheme = (char *) "http"; |
| 1522 | } |
| 1523 | |
| 1524 | if (src->hostname && src->hostname[0] != '\0') { |
| 1525 | dst->hostname = apr_pstrdup(r->pool, src->hostname); |
| 1526 | ap_unescape_url(dst->hostname); |
| 1527 | } |
| 1528 | else { |
| 1529 | dst->hostname = (char *) ap_get_server_name(r); |
| 1530 | } |
| 1531 | |
| 1532 | if (src->port_str && src->port_str[0] != '\0') { |
| 1533 | dst->port = src->port; |
| 1534 | } |
| 1535 | else { |
| 1536 | dst->port = ap_get_server_port(r); |
| 1537 | } |
| 1538 | |
| 1539 | if (src->path && src->path[0] != '\0') { |
| 1540 | dst->path = apr_pstrdup(r->pool, src->path); |
| 1541 | ap_unescape_url(dst->path); |
| 1542 | } |
| 1543 | else { |
| 1544 | dst->path = src->path; |
| 1545 | } |
| 1546 | |
| 1547 | if (src->query && src->query[0] != '\0') { |
| 1548 | dst->query = apr_pstrdup(r->pool, src->query); |
| 1549 | ap_unescape_url(dst->query); |
| 1550 | } |
| 1551 | else { |
| 1552 | dst->query = src->query; |
| 1553 | } |
| 1554 | |
| 1555 | dst->hostinfo = src->hostinfo; |
| 1556 | } |
| 1557 | |
| 1558 | /* These functions return 0 if client is OK, and proper error status |
| 1559 | * if not... either HTTP_UNAUTHORIZED, if we made a check, and it failed, or |
no test coverage detected