View | Details | Raw Unified | Return to bug 54101
Collapse All | Expand All

(-)modules/proxy/mod_proxy_balancer.c (-7 / +10 lines)
Lines 118-124 static void init_balancer_members(apr_pool_t *p, s Link Here
118
        int worker_is_initialized;
118
        int worker_is_initialized;
119
        proxy_worker *worker = *workers;
119
        proxy_worker *worker = *workers;
120
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01158)
120
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01158)
121
                     "Looking at %s -> %s initialized?", balancer->s->name, worker->s->name);
121
                     "Looking at %s -> %s initialized?", balancer->s->name,
122
                     ap_proxy_worker_name(p, worker));
122
        worker_is_initialized = PROXY_WORKER_IS_INITIALIZED(worker);
123
        worker_is_initialized = PROXY_WORKER_IS_INITIALIZED(worker);
123
        if (!worker_is_initialized) {
124
        if (!worker_is_initialized) {
124
            ap_proxy_initialize_worker(worker, s, p);
125
            ap_proxy_initialize_worker(worker, s, p);
Lines 638-647 static int proxy_balancer_post_request(proxy_worke Link Here
638
            int val = ((int *)balancer->errstatuses->elts)[i];
639
            int val = ((int *)balancer->errstatuses->elts)[i];
639
            if (r->status == val) {
640
            if (r->status == val) {
640
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01174)
641
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01174)
641
                              "%s: Forcing worker (%s) into error state " 
642
                              "%s: Forcing worker (%s) into error state "
642
                              "due to status code %d matching 'failonstatus' "
643
                              "due to status code %d matching 'failonstatus' "
643
                              "balancer parameter",
644
                              "balancer parameter",
644
                              balancer->s->name, worker->s->name, val);
645
                              balancer->s->name, ap_proxy_worker_name(r->pool, worker),
646
                              val);
645
                worker->s->status |= PROXY_WORKER_IN_ERROR;
647
                worker->s->status |= PROXY_WORKER_IN_ERROR;
646
                worker->s->error_time = apr_time_now();
648
                worker->s->error_time = apr_time_now();
647
                break;
649
                break;
Lines 654-660 static int proxy_balancer_post_request(proxy_worke Link Here
654
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02460)
656
        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02460)
655
                      "%s: Forcing worker (%s) into error state "
657
                      "%s: Forcing worker (%s) into error state "
656
                      "due to timeout and 'failonstatus' parameter being set",
658
                      "due to timeout and 'failonstatus' parameter being set",
657
                       balancer->s->name, worker->s->name);
659
                       balancer->s->name, ap_proxy_worker_name(r->pool, worker));
658
        worker->s->status |= PROXY_WORKER_IN_ERROR;
660
        worker->s->status |= PROXY_WORKER_IN_ERROR;
659
        worker->s->error_time = apr_time_now();
661
        worker->s->error_time = apr_time_now();
660
662
Lines 1282-1288 static int balancer_handler(request_rec *r) Link Here
1282
                worker = *workers;
1284
                worker = *workers;
1283
                /* Start proxy_worker */
1285
                /* Start proxy_worker */
1284
                ap_rputs("        <httpd:worker>\n", r);
1286
                ap_rputs("        <httpd:worker>\n", r);
1285
                ap_rvputs(r, "          <httpd:name>", worker->s->name,
1287
                ap_rvputs(r, "          <httpd:name>", ap_proxy_worker_name(r->pool, worker),
1286
                          "</httpd:name>\n", NULL);
1288
                          "</httpd:name>\n", NULL);
1287
                ap_rvputs(r, "          <httpd:scheme>", worker->s->scheme,
1289
                ap_rvputs(r, "          <httpd:scheme>", worker->s->scheme,
1288
                          "</httpd:scheme>\n", NULL);
1290
                          "</httpd:scheme>\n", NULL);
Lines 1531-1537 static int balancer_handler(request_rec *r) Link Here
1531
                          ap_escape_uri(r->pool, worker->s->name),
1533
                          ap_escape_uri(r->pool, worker->s->name),
1532
                          "&nonce=", balancer->s->nonce,
1534
                          "&nonce=", balancer->s->nonce,
1533
                          "\">", NULL);
1535
                          "\">", NULL);
1534
                ap_rvputs(r, worker->s->name, "</a></td>", NULL);
1536
                ap_rvputs(r, (*worker->s->uds_path ? "<i>" : ""), ap_proxy_worker_name(r->pool, worker),
1537
                          (*worker->s->uds_path ? "</i>" : ""), "</a></td>", NULL);
1535
                ap_rvputs(r, "<td>", ap_escape_html(r->pool, worker->s->route),
1538
                ap_rvputs(r, "<td>", ap_escape_html(r->pool, worker->s->route),
1536
                          NULL);
1539
                          NULL);
1537
                ap_rvputs(r, "</td><td>",
1540
                ap_rvputs(r, "</td><td>",
Lines 1556-1562 static int balancer_handler(request_rec *r) Link Here
1556
        ap_rputs("<hr />\n", r);
1559
        ap_rputs("<hr />\n", r);
1557
        if (wsel && bsel) {
1560
        if (wsel && bsel) {
1558
            ap_rputs("<h3>Edit worker settings for ", r);
1561
            ap_rputs("<h3>Edit worker settings for ", r);
1559
            ap_rvputs(r, wsel->s->name, "</h3>\n", NULL);
1562
            ap_rvputs(r, (*wsel->s->uds_path?"<i>":""), ap_proxy_worker_name(r->pool, wsel), (*wsel->s->uds_path?"</i>":""), "</h3>\n", NULL);
1560
            ap_rputs("<form method=\"POST\" enctype=\"application/x-www-form-urlencoded\" action=\"", r);
1563
            ap_rputs("<form method=\"POST\" enctype=\"application/x-www-form-urlencoded\" action=\"", r);
1561
            ap_rvputs(r, ap_escape_uri(r->pool, action), "\">\n", NULL);
1564
            ap_rvputs(r, ap_escape_uri(r->pool, action), "\">\n", NULL);
1562
            ap_rputs("<dl>\n<table><tr><td>Load factor:</td><td><input name='w_lf' id='w_lf' type=text ", r);
1565
            ap_rputs("<dl>\n<table><tr><td>Load factor:</td><td><input name='w_lf' id='w_lf' type=text ", r);
(-)modules/proxy/proxy_util.c (-105 / +286 lines)
Lines 31-36 Link Here
31
#define apr_socket_create apr_socket_create_ex
31
#define apr_socket_create apr_socket_create_ex
32
#endif
32
#endif
33
33
34
#if APR_HAVE_SYS_UN_H
35
#include <sys/un.h>
36
#endif
37
#if (APR_MAJOR_VERSION < 2)
38
#include "apr_support.h"        /* for apr_wait_for_io_or_timeout() */
39
#endif
40
34
APLOG_USE_MODULE(proxy);
41
APLOG_USE_MODULE(proxy);
35
42
36
/*
43
/*
Lines 86-99 PROXY_DECLARE(apr_status_t) ap_proxy_strncpy(char Link Here
86
    char *thenil;
93
    char *thenil;
87
    apr_size_t thelen;
94
    apr_size_t thelen;
88
95
96
    /* special case handling */
97
    if (!dlen) {
98
        /* XXX: APR_ENOSPACE would be better */
99
        return APR_EGENERAL;
100
    }
101
    if (!src) {
102
        *dst = '\0';
103
        return APR_SUCCESS;
104
    }
89
    thenil = apr_cpystrn(dst, src, dlen);
105
    thenil = apr_cpystrn(dst, src, dlen);
90
    thelen = thenil - dst;
106
    thelen = thenil - dst;
91
    /* Assume the typical case is smaller copying into bigger
107
    if (src[thelen] == '\0') {
92
       so we have a fast return */
93
    if ((thelen < dlen-1) || ((strlen(src)) == thelen)) {
94
        return APR_SUCCESS;
108
        return APR_SUCCESS;
95
    }
109
    }
96
    /* XXX: APR_ENOSPACE would be better */
97
    return APR_EGENERAL;
110
    return APR_EGENERAL;
98
}
111
}
99
112
Lines 1218-1228 PROXY_DECLARE(apr_status_t) ap_proxy_share_balance Link Here
1218
    } else {
1231
    } else {
1219
        action = "re-using";
1232
        action = "re-using";
1220
    }
1233
    }
1234
    balancer->s = shm;
1235
    balancer->s->index = i;
1221
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02337)
1236
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02337)
1222
                 "%s shm[%d] (0x%pp) for %s", action, i, (void *)shm,
1237
                 "%s shm[%d] (0x%pp) for %s", action, i, (void *)shm,
1223
                 balancer->s->name);
1238
                 balancer->s->name);
1224
    balancer->s = shm;
1225
    balancer->s->index = i;
1226
    /* the below should always succeed */
1239
    /* the below should always succeed */
1227
    lbmethod = ap_lookup_provider(PROXY_LBMETHOD, balancer->s->lbpname, "0");
1240
    lbmethod = ap_lookup_provider(PROXY_LBMETHOD, balancer->s->lbpname, "0");
1228
    if (lbmethod) {
1241
    if (lbmethod) {
Lines 1356-1362 static apr_status_t connection_cleanup(void *theco Link Here
1356
        ap_log_perror(APLOG_MARK, APLOG_ERR, 0, conn->pool, APLOGNO(00923)
1369
        ap_log_perror(APLOG_MARK, APLOG_ERR, 0, conn->pool, APLOGNO(00923)
1357
                      "Pooled connection 0x%pp for worker %s has been"
1370
                      "Pooled connection 0x%pp for worker %s has been"
1358
                      " already returned to the connection pool.", conn,
1371
                      " already returned to the connection pool.", conn,
1359
                      worker->s->name);
1372
                      ap_proxy_worker_name(conn->pool, worker));
1360
        return APR_SUCCESS;
1373
        return APR_SUCCESS;
1361
    }
1374
    }
1362
1375
Lines 1480-1485 static apr_status_t connection_destructor(void *re Link Here
1480
 * WORKER related...
1493
 * WORKER related...
1481
 */
1494
 */
1482
1495
1496
PROXY_DECLARE(char *) ap_proxy_worker_name(apr_pool_t *p,
1497
                                           proxy_worker *worker)
1498
{
1499
    if (!(*worker->s->uds_path) || !p) {
1500
        /* just in case */
1501
        return worker->s->name;
1502
    }
1503
    return apr_pstrcat(p, "unix:", worker->s->uds_path, "|", worker->s->name, NULL);
1504
}
1505
1483
PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p,
1506
PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p,
1484
                                                  proxy_balancer *balancer,
1507
                                                  proxy_balancer *balancer,
1485
                                                  proxy_server_conf *conf,
1508
                                                  proxy_server_conf *conf,
Lines 1495-1500 PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker( Link Here
1495
    char *url_copy;
1518
    char *url_copy;
1496
    int i;
1519
    int i;
1497
1520
1521
    if (!url) {
1522
        return NULL;
1523
    }
1524
1498
    c = ap_strchr_c(url, ':');
1525
    c = ap_strchr_c(url, ':');
1499
    if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') {
1526
    if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') {
1500
        return NULL;
1527
        return NULL;
Lines 1573-1592 PROXY_DECLARE(char *) ap_proxy_define_worker(apr_p Link Here
1573
                                             int do_malloc)
1600
                                             int do_malloc)
1574
{
1601
{
1575
    int rv;
1602
    int rv;
1576
    apr_uri_t uri;
1603
    apr_uri_t uri, urisock;
1577
    proxy_worker_shared *wshared;
1604
    proxy_worker_shared *wshared;
1578
    char *ptr;
1605
    char *ptr, *sockpath = NULL;
1579
1606
1607
    /*
1608
     * Look to see if we are using UDS:
1609
     * require format: unix:/path/foo/bar.sock|http://ignored/path2/
1610
     * This results in talking http to the socket at /path/foo/bar.sock
1611
     */
1612
    ptr = ap_strchr((char *)url, '|');
1613
    if (ptr) {
1614
        *ptr = '\0';
1615
        rv = apr_uri_parse(p, url, &urisock);
1616
        if (rv == APR_SUCCESS && !strcasecmp(urisock.scheme, "unix")) {
1617
            sockpath = ap_runtime_dir_relative(p, urisock.path);;
1618
            url = ptr+1;    /* so we get the scheme for the uds */
1619
        }
1620
        else {
1621
            *ptr = '|';
1622
        }
1623
    }
1580
    rv = apr_uri_parse(p, url, &uri);
1624
    rv = apr_uri_parse(p, url, &uri);
1581
1625
1582
    if (rv != APR_SUCCESS) {
1626
    if (rv != APR_SUCCESS) {
1583
        return "Unable to parse URL";
1627
        return apr_pstrcat(p, "Unable to parse URL: ", url, NULL);
1584
    }
1628
    }
1585
    if (!uri.hostname || !uri.scheme) {
1629
    if (!uri.scheme) {
1586
        return "URL must be absolute!";
1630
        return apr_pstrcat(p, "URL must be absolute!: ", url, NULL);
1587
    }
1631
    }
1588
1632
    /* allow for unix:/path|http: */
1589
    ap_str_tolower(uri.hostname);
1633
    if (!uri.hostname) {
1634
        if (sockpath) {
1635
            uri.hostname = "localhost";
1636
        }
1637
        else {
1638
            return apr_pstrcat(p, "URL must be absolute!: ", url, NULL);
1639
        }
1640
    }
1641
    else {
1642
        ap_str_tolower(uri.hostname);
1643
    }
1590
    ap_str_tolower(uri.scheme);
1644
    ap_str_tolower(uri.scheme);
1591
    /*
1645
    /*
1592
     * Workers can be associated w/ balancers or on their
1646
     * Workers can be associated w/ balancers or on their
Lines 1642-1648 PROXY_DECLARE(char *) ap_proxy_define_worker(apr_p Link Here
1642
    wshared->hash.def = ap_proxy_hashfunc(wshared->name, PROXY_HASHFUNC_DEFAULT);
1696
    wshared->hash.def = ap_proxy_hashfunc(wshared->name, PROXY_HASHFUNC_DEFAULT);
1643
    wshared->hash.fnv = ap_proxy_hashfunc(wshared->name, PROXY_HASHFUNC_FNV);
1697
    wshared->hash.fnv = ap_proxy_hashfunc(wshared->name, PROXY_HASHFUNC_FNV);
1644
    wshared->was_malloced = (do_malloc != 0);
1698
    wshared->was_malloced = (do_malloc != 0);
1699
    if (sockpath) {
1700
        if (PROXY_STRNCPY(wshared->uds_path, sockpath) != APR_SUCCESS) {
1701
            return apr_psprintf(p, "worker uds path (%s) too long", sockpath);
1702
        }
1645
1703
1704
    }
1705
    else {
1706
        *wshared->uds_path = '\0';
1707
    }
1708
1646
    (*worker)->hash = wshared->hash;
1709
    (*worker)->hash = wshared->hash;
1647
    (*worker)->context = NULL;
1710
    (*worker)->context = NULL;
1648
    (*worker)->cp = NULL;
1711
    (*worker)->cp = NULL;
Lines 1670-1681 PROXY_DECLARE(apr_status_t) ap_proxy_share_worker( Link Here
1670
    } else {
1733
    } else {
1671
        action = "re-using";
1734
        action = "re-using";
1672
    }
1735
    }
1673
    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02338)
1674
                 "%s shm[%d] (0x%pp) for worker: %s", action, i, (void *)shm,
1675
                 worker->s->name);
1676
1677
    worker->s = shm;
1736
    worker->s = shm;
1678
    worker->s->index = i;
1737
    worker->s->index = i;
1738
    {
1739
        apr_pool_t *pool;
1740
        apr_pool_create(&pool, ap_server_conf->process->pool);
1741
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02338)
1742
                     "%s shm[%d] (0x%pp) for worker: %s", action, i, (void *)shm,
1743
                     ap_proxy_worker_name(pool, worker));
1744
        if (pool) {
1745
            apr_pool_destroy(pool);
1746
        }
1747
    }
1679
    return APR_SUCCESS;
1748
    return APR_SUCCESS;
1680
}
1749
}
1681
1750
Lines 1687-1697 PROXY_DECLARE(apr_status_t) ap_proxy_initialize_wo Link Here
1687
    if (worker->s->status & PROXY_WORKER_INITIALIZED) {
1756
    if (worker->s->status & PROXY_WORKER_INITIALIZED) {
1688
        /* The worker is already initialized */
1757
        /* The worker is already initialized */
1689
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00924)
1758
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00924)
1690
                     "worker %s shared already initialized", worker->s->name);
1759
                     "worker %s shared already initialized",
1760
                     ap_proxy_worker_name(p, worker));
1691
    }
1761
    }
1692
    else {
1762
    else {
1693
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00925)
1763
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00925)
1694
                     "initializing worker %s shared", worker->s->name);
1764
                     "initializing worker %s shared",
1765
                     ap_proxy_worker_name(p, worker));
1695
        /* Set default parameters */
1766
        /* Set default parameters */
1696
        if (!worker->s->retry_set) {
1767
        if (!worker->s->retry_set) {
1697
            worker->s->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
1768
            worker->s->retry = apr_time_from_sec(PROXY_WORKER_DEFAULT_RETRY);
Lines 1727-1737 PROXY_DECLARE(apr_status_t) ap_proxy_initialize_wo Link Here
1727
    /* What if local is init'ed and shm isn't?? Even possible? */
1798
    /* What if local is init'ed and shm isn't?? Even possible? */
1728
    if (worker->local_status & PROXY_WORKER_INITIALIZED) {
1799
    if (worker->local_status & PROXY_WORKER_INITIALIZED) {
1729
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00926)
1800
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00926)
1730
                     "worker %s local already initialized", worker->s->name);
1801
                     "worker %s local already initialized",
1802
                     ap_proxy_worker_name(p, worker));
1731
    }
1803
    }
1732
    else {
1804
    else {
1733
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00927)
1805
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00927)
1734
                     "initializing worker %s local", worker->s->name);
1806
                     "initializing worker %s local",
1807
                     ap_proxy_worker_name(p, worker));
1735
        apr_global_mutex_lock(proxy_mutex);
1808
        apr_global_mutex_lock(proxy_mutex);
1736
        /* Now init local worker data */
1809
        /* Now init local worker data */
1737
        if (worker->tmutex == NULL) {
1810
        if (worker->tmutex == NULL) {
Lines 2023-2028 PROXY_DECLARE(int) ap_proxy_acquire_connection(con Link Here
2023
    (*conn)->close  = 0;
2096
    (*conn)->close  = 0;
2024
    (*conn)->inreslist = 0;
2097
    (*conn)->inreslist = 0;
2025
2098
2099
    if (*worker->s->uds_path) {
2100
        if ((*conn)->uds_path == NULL) {
2101
            /* use (*conn)->pool instead of worker->cp->pool to match lifetime */
2102
            (*conn)->uds_path = apr_pstrdup((*conn)->pool, worker->s->uds_path);
2103
        }
2104
        if ((*conn)->uds_path) {
2105
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02545)
2106
                         "%s: has determined UDS as %s",
2107
                         proxy_function, (*conn)->uds_path);
2108
        }
2109
        else {
2110
            /* should never happen */
2111
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02546)
2112
                         "%s: cannot determine UDS (%s)",
2113
                         proxy_function, worker->s->uds_path);
2114
2115
        }
2116
    }
2117
    else {
2118
        (*conn)->uds_path = NULL;
2119
    }
2120
2121
2026
    return OK;
2122
    return OK;
2027
}
2123
}
2028
2124
Lines 2094-2100 ap_proxy_determine_connection(apr_pool_t *p, reque Link Here
2094
     *      spilling the cached addr from the worker.
2190
     *      spilling the cached addr from the worker.
2095
     */
2191
     */
2096
    if (!conn->hostname || !worker->s->is_address_reusable ||
2192
    if (!conn->hostname || !worker->s->is_address_reusable ||
2097
        worker->s->disablereuse) {
2193
        worker->s->disablereuse || *worker->s->uds_path) {
2098
        if (proxyname) {
2194
        if (proxyname) {
2099
            conn->hostname = apr_pstrdup(conn->pool, proxyname);
2195
            conn->hostname = apr_pstrdup(conn->pool, proxyname);
2100
            conn->port = proxyport;
2196
            conn->port = proxyport;
Lines 2132-2138 ap_proxy_determine_connection(apr_pool_t *p, reque Link Here
2132
            conn->port = uri->port;
2228
            conn->port = uri->port;
2133
        }
2229
        }
2134
        socket_cleanup(conn);
2230
        socket_cleanup(conn);
2135
        if (!worker->s->is_address_reusable || worker->s->disablereuse) {
2231
        if (!(*worker->s->uds_path) &&
2232
            (!worker->s->is_address_reusable || worker->s->disablereuse)) {
2136
            /*
2233
            /*
2137
             * Only do a lookup if we should not reuse the backend address.
2234
             * Only do a lookup if we should not reuse the backend address.
2138
             * Otherwise we will look it up once for the worker.
2235
             * Otherwise we will look it up once for the worker.
Lines 2143-2149 ap_proxy_determine_connection(apr_pool_t *p, reque Link Here
2143
                                        conn->pool);
2240
                                        conn->pool);
2144
        }
2241
        }
2145
    }
2242
    }
2146
    if (worker->s->is_address_reusable && !worker->s->disablereuse) {
2243
    if (!(*worker->s->uds_path) && worker->s->is_address_reusable && !worker->s->disablereuse) {
2147
        /*
2244
        /*
2148
         * Looking up the backend address for the worker only makes sense if
2245
         * Looking up the backend address for the worker only makes sense if
2149
         * we can reuse the address.
2246
         * we can reuse the address.
Lines 2372-2377 static apr_status_t send_http_connect(proxy_conn_r Link Here
2372
}
2469
}
2373
2470
2374
2471
2472
#if APR_HAVE_SYS_UN_H
2473
/* lifted from mod_proxy_fdpass.c; tweaked addrlen in connect() call */
2474
static apr_status_t socket_connect_un(apr_socket_t *sock,
2475
                                      struct sockaddr_un *sa)
2476
{
2477
    apr_status_t rv;
2478
    apr_os_sock_t rawsock;
2479
    apr_interval_time_t t;
2480
2481
    rv = apr_os_sock_get(&rawsock, sock);
2482
    if (rv != APR_SUCCESS) {
2483
        return rv;
2484
    }
2485
2486
    rv = apr_socket_timeout_get(sock, &t);
2487
    if (rv != APR_SUCCESS) {
2488
        return rv;
2489
    }
2490
2491
    do {
2492
        const socklen_t addrlen = APR_OFFSETOF(struct sockaddr_un, sun_path)
2493
                                  + strlen(sa->sun_path) + 1;
2494
        rv = connect(rawsock, (struct sockaddr*)sa, addrlen);
2495
    } while (rv == -1 && errno == EINTR);
2496
2497
    if ((rv == -1) && (errno == EINPROGRESS || errno == EALREADY)
2498
        && (t > 0)) {
2499
#if APR_MAJOR_VERSION < 2
2500
        rv = apr_wait_for_io_or_timeout(NULL, sock, 0);
2501
#else
2502
        rv = apr_socket_wait(sock, APR_WAIT_WRITE);
2503
#endif
2504
2505
        if (rv != APR_SUCCESS) {
2506
            return rv;
2507
        }
2508
    }
2509
2510
    if (rv == -1 && errno != EISCONN) {
2511
        return errno;
2512
    }
2513
2514
    return APR_SUCCESS;
2515
}
2516
#endif
2517
2375
PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
2518
PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
2376
                                            proxy_conn_rec *conn,
2519
                                            proxy_conn_rec *conn,
2377
                                            proxy_worker *worker,
2520
                                            proxy_worker *worker,
Lines 2396-2488 PROXY_DECLARE(int) ap_proxy_connect_backend(const Link Here
2396
                         proxy_function);
2539
                         proxy_function);
2397
        }
2540
        }
2398
    }
2541
    }
2399
    while (backend_addr && !connected) {
2542
    while ((backend_addr || conn->uds_path) && !connected) {
2400
        if ((rv = apr_socket_create(&newsock, backend_addr->family,
2543
#if APR_HAVE_SYS_UN_H
2401
                                SOCK_STREAM, APR_PROTO_TCP,
2544
        if (conn->uds_path)
2402
                                conn->scpool)) != APR_SUCCESS) {
2545
        {
2403
            loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
2546
            struct sockaddr_un sa;
2404
            ap_log_error(APLOG_MARK, loglevel, rv, s, APLOGNO(00952)
2405
                         "%s: error creating fam %d socket for target %s",
2406
                         proxy_function,
2407
                         backend_addr->family,
2408
                         worker->s->hostname);
2409
            /*
2410
             * this could be an IPv6 address from the DNS but the
2411
             * local machine won't give us an IPv6 socket; hopefully the
2412
             * DNS returned an additional address to try
2413
             */
2414
            backend_addr = backend_addr->next;
2415
            continue;
2416
        }
2417
        conn->connection = NULL;
2418
2547
2419
        if (worker->s->recv_buffer_size > 0 &&
2548
            rv = apr_socket_create(&newsock, AF_UNIX, SOCK_STREAM, 0,
2420
            (rv = apr_socket_opt_set(newsock, APR_SO_RCVBUF,
2549
                                   conn->scpool);
2421
                                     worker->s->recv_buffer_size))) {
2550
            if (rv != APR_SUCCESS) {
2422
            ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00953)
2551
                loglevel = APLOG_ERR;
2423
                         "apr_socket_opt_set(SO_RCVBUF): Failed to set "
2552
                ap_log_error(APLOG_MARK, loglevel, rv, s, APLOGNO(02453)
2424
                         "ProxyReceiveBufferSize, using default");
2553
                             "%s: error creating Unix domain socket for "
2425
        }
2554
                             "target %s",
2555
                             proxy_function,
2556
                             worker->s->hostname);
2557
                break;
2558
            }
2559
            conn->connection = NULL;
2426
2560
2427
        rv = apr_socket_opt_set(newsock, APR_TCP_NODELAY, 1);
2561
            sa.sun_family = AF_UNIX;
2428
        if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
2562
            apr_cpystrn(sa.sun_path, conn->uds_path, sizeof(sa.sun_path));
2429
             ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00954)
2430
                          "apr_socket_opt_set(APR_TCP_NODELAY): "
2431
                          "Failed to set");
2432
        }
2433
2563
2434
        /* Set a timeout for connecting to the backend on the socket */
2564
            rv = socket_connect_un(newsock, &sa);
2435
        if (worker->s->conn_timeout_set) {
2565
            if (rv != APR_SUCCESS) {
2436
            apr_socket_timeout_set(newsock, worker->s->conn_timeout);
2566
                apr_socket_close(newsock);
2567
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(02454)
2568
                             "%s: attempt to connect to Unix domain socket "
2569
                             "%s (%s) failed",
2570
                             proxy_function,
2571
                             conn->uds_path,
2572
                             worker->s->hostname);
2573
                break;
2574
            }
2437
        }
2575
        }
2438
        else if (worker->s->timeout_set) {
2576
        else
2439
            apr_socket_timeout_set(newsock, worker->s->timeout);
2577
#endif
2440
        }
2578
        {
2441
        else if (conf->timeout_set) {
2579
            if ((rv = apr_socket_create(&newsock, backend_addr->family,
2442
            apr_socket_timeout_set(newsock, conf->timeout);
2580
                                        SOCK_STREAM, APR_PROTO_TCP,
2443
        }
2581
                                        conn->scpool)) != APR_SUCCESS) {
2444
        else {
2582
                loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
2445
             apr_socket_timeout_set(newsock, s->timeout);
2583
                ap_log_error(APLOG_MARK, loglevel, rv, s, APLOGNO(00952)
2446
        }
2584
                             "%s: error creating fam %d socket for "
2447
        /* Set a keepalive option */
2585
                             "target %s",
2448
        if (worker->s->keepalive) {
2586
                             proxy_function,
2449
            if ((rv = apr_socket_opt_set(newsock,
2587
                             backend_addr->family,
2450
                            APR_SO_KEEPALIVE, 1)) != APR_SUCCESS) {
2588
                             worker->s->hostname);
2451
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00955)
2589
                /*
2452
                             "apr_socket_opt_set(SO_KEEPALIVE): Failed to set"
2590
                 * this could be an IPv6 address from the DNS but the
2453
                             " Keepalive");
2591
                 * local machine won't give us an IPv6 socket; hopefully the
2592
                 * DNS returned an additional address to try
2593
                 */
2594
                backend_addr = backend_addr->next;
2595
                continue;
2454
            }
2596
            }
2455
        }
2597
            conn->connection = NULL;
2456
        ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, s,
2457
                     "%s: fam %d socket created to connect to %s",
2458
                     proxy_function, backend_addr->family, worker->s->hostname);
2459
2598
2460
        if (conf->source_address_set) {
2599
            if (worker->s->recv_buffer_size > 0 &&
2461
            local_addr = apr_pmemdup(conn->pool, conf->source_address,
2600
                (rv = apr_socket_opt_set(newsock, APR_SO_RCVBUF,
2462
                                     sizeof(apr_sockaddr_t));
2601
                                         worker->s->recv_buffer_size))) {
2463
            local_addr->pool = conn->pool;
2602
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00953)
2464
            rv = apr_socket_bind(newsock, local_addr);
2603
                             "apr_socket_opt_set(SO_RCVBUF): Failed to set "
2465
            if (rv != APR_SUCCESS) {
2604
                             "ProxyReceiveBufferSize, using default");
2466
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00956)
2467
                    "%s: failed to bind socket to local address",
2468
                    proxy_function);
2469
            }
2605
            }
2470
        }
2471
2606
2472
        /* make the connection out of the socket */
2607
            rv = apr_socket_opt_set(newsock, APR_TCP_NODELAY, 1);
2473
        rv = apr_socket_connect(newsock, backend_addr);
2608
            if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
2609
                ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00954)
2610
                             "apr_socket_opt_set(APR_TCP_NODELAY): "
2611
                             "Failed to set");
2612
            }
2474
2613
2475
        /* if an error occurred, loop round and try again */
2614
            /* Set a timeout for connecting to the backend on the socket */
2476
        if (rv != APR_SUCCESS) {
2615
            if (worker->s->conn_timeout_set) {
2477
            apr_socket_close(newsock);
2616
                apr_socket_timeout_set(newsock, worker->s->conn_timeout);
2478
            loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
2617
            }
2479
            ap_log_error(APLOG_MARK, loglevel, rv, s, APLOGNO(00957)
2618
            else if (worker->s->timeout_set) {
2480
                         "%s: attempt to connect to %pI (%s) failed",
2619
                apr_socket_timeout_set(newsock, worker->s->timeout);
2481
                         proxy_function,
2620
            }
2482
                         backend_addr,
2621
            else if (conf->timeout_set) {
2483
                         worker->s->hostname);
2622
                apr_socket_timeout_set(newsock, conf->timeout);
2484
            backend_addr = backend_addr->next;
2623
            }
2485
            continue;
2624
            else {
2625
                apr_socket_timeout_set(newsock, s->timeout);
2626
            }
2627
            /* Set a keepalive option */
2628
            if (worker->s->keepalive) {
2629
                if ((rv = apr_socket_opt_set(newsock,
2630
                                             APR_SO_KEEPALIVE, 1)) != APR_SUCCESS) {
2631
                    ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00955)
2632
                                 "apr_socket_opt_set(SO_KEEPALIVE): Failed to set"
2633
                                 " Keepalive");
2634
                }
2635
            }
2636
            ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, s,
2637
                         "%s: fam %d socket created to connect to %s",
2638
                         proxy_function, backend_addr->family, worker->s->hostname);
2639
2640
            if (conf->source_address_set) {
2641
                local_addr = apr_pmemdup(conn->pool, conf->source_address,
2642
                                         sizeof(apr_sockaddr_t));
2643
                local_addr->pool = conn->pool;
2644
                rv = apr_socket_bind(newsock, local_addr);
2645
                if (rv != APR_SUCCESS) {
2646
                    ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00956)
2647
                                 "%s: failed to bind socket to local address",
2648
                                 proxy_function);
2649
                }
2650
            }
2651
2652
            /* make the connection out of the socket */
2653
            rv = apr_socket_connect(newsock, backend_addr);
2654
2655
            /* if an error occurred, loop round and try again */
2656
            if (rv != APR_SUCCESS) {
2657
                apr_socket_close(newsock);
2658
                loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR;
2659
                ap_log_error(APLOG_MARK, loglevel, rv, s, APLOGNO(00957)
2660
                             "%s: attempt to connect to %pI (%s) failed",
2661
                             proxy_function,
2662
                             backend_addr,
2663
                             worker->s->hostname);
2664
                backend_addr = backend_addr->next;
2665
                continue;
2666
            }
2486
        }
2667
        }
2487
2668
2488
        /* Set a timeout on the socket */
2669
        /* Set a timeout on the socket */
Lines 2498-2504 PROXY_DECLARE(int) ap_proxy_connect_backend(const Link Here
2498
2679
2499
        conn->sock = newsock;
2680
        conn->sock = newsock;
2500
2681
2501
        if (conn->forward) {
2682
        if (!conn->uds_path && conn->forward) {
2502
            forward_info *forward = (forward_info *)conn->forward;
2683
            forward_info *forward = (forward_info *)conn->forward;
2503
            /*
2684
            /*
2504
             * For HTTP CONNECT we need to prepend CONNECT request before
2685
             * For HTTP CONNECT we need to prepend CONNECT request before
Lines 2779-2785 PROXY_DECLARE(apr_status_t) ap_proxy_sync_balancer Link Here
2779
                found = 1;
2960
                found = 1;
2780
                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02402)
2961
                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02402)
2781
                             "re-grabbing shm[%d] (0x%pp) for worker: %s", i, (void *)shm,
2962
                             "re-grabbing shm[%d] (0x%pp) for worker: %s", i, (void *)shm,
2782
                             worker->s->name);
2963
                             ap_proxy_worker_name(conf->pool, worker));
2783
                break;
2964
                break;
2784
            }
2965
            }
2785
        }
2966
        }
(-)modules/proxy/mod_proxy.c (-11 / +40 lines)
Lines 1370-1376 static void *merge_proxy_dir_config(apr_pool_t *p, Link Here
1370
    return new;
1370
    return new;
1371
}
1371
}
1372
1372
1373
1374
static const char *
1373
static const char *
1375
    add_proxy(cmd_parms *cmd, void *dummy, const char *f1, const char *r1, int regex)
1374
    add_proxy(cmd_parms *cmd, void *dummy, const char *f1, const char *r1, int regex)
1376
{
1375
{
Lines 1445-1450 static const char * Link Here
1445
    return add_proxy(cmd, dummy, f1, r1, 1);
1444
    return add_proxy(cmd, dummy, f1, r1, 1);
1446
}
1445
}
1447
1446
1447
static char *de_socketfy(apr_pool_t *p, char *url)
1448
{
1449
    char *ptr;
1450
    /*
1451
     * We could be passed a URL during the config stage that contains
1452
     * the UDS path... ignore it
1453
     */
1454
    if (!strncasecmp(url, "unix:", 5) &&
1455
        ((ptr = ap_strchr(url, '|')) != NULL)) {
1456
        /* move past the 'unix:...|' UDS path info */
1457
        char *ret, *c;
1458
1459
        ret = ptr + 1;
1460
        /* special case: "unix:....|scheme:" is OK, expand
1461
         * to "unix:....|scheme://localhost"
1462
         * */
1463
        c = ap_strchr(ret, ':');
1464
        if (c == NULL) {
1465
            return NULL;
1466
        }
1467
        if (c[1] == '\0') {
1468
            return apr_pstrcat(p, ret, "//localhost", NULL);
1469
        }
1470
        else {
1471
            return ret;
1472
        }
1473
    }
1474
    return url;
1475
}
1476
1448
static const char *
1477
static const char *
1449
    add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex)
1478
    add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex)
1450
{
1479
{
Lines 1536-1542 static const char * Link Here
1536
    }
1565
    }
1537
1566
1538
    new->fake = apr_pstrdup(cmd->pool, f);
1567
    new->fake = apr_pstrdup(cmd->pool, f);
1539
    new->real = apr_pstrdup(cmd->pool, r);
1568
    new->real = apr_pstrdup(cmd->pool, de_socketfy(cmd->pool, r));
1540
    new->flags = flags;
1569
    new->flags = flags;
1541
    if (use_regex) {
1570
    if (use_regex) {
1542
        new->regex = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
1571
        new->regex = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
Lines 1572-1578 static const char * Link Here
1572
        new->balancer = balancer;
1601
        new->balancer = balancer;
1573
    }
1602
    }
1574
    else {
1603
    else {
1575
        proxy_worker *worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, r);
1604
        proxy_worker *worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, de_socketfy(cmd->pool, r));
1576
        int reuse = 0;
1605
        int reuse = 0;
1577
        if (!worker) {
1606
        if (!worker) {
1578
            const char *err = ap_proxy_define_worker(cmd->pool, &worker, NULL, conf, r, 0);
1607
            const char *err = ap_proxy_define_worker(cmd->pool, &worker, NULL, conf, r, 0);
Lines 1584-1597 static const char * Link Here
1584
            reuse = 1;
1613
            reuse = 1;
1585
            ap_log_error(APLOG_MARK, APLOG_INFO, 0, cmd->server, APLOGNO(01145)
1614
            ap_log_error(APLOG_MARK, APLOG_INFO, 0, cmd->server, APLOGNO(01145)
1586
                         "Sharing worker '%s' instead of creating new worker '%s'",
1615
                         "Sharing worker '%s' instead of creating new worker '%s'",
1587
                         worker->s->name, new->real);
1616
                         ap_proxy_worker_name(cmd->pool, worker), new->real);
1588
        }
1617
        }
1589
1618
1590
        for (i = 0; i < arr->nelts; i++) {
1619
        for (i = 0; i < arr->nelts; i++) {
1591
            if (reuse) {
1620
            if (reuse) {
1592
                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(01146)
1621
                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(01146)
1593
                             "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
1622
                             "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
1594
                             elts[i].key, elts[i].val, worker->s->name);
1623
                             elts[i].key, elts[i].val, ap_proxy_worker_name(cmd->pool, worker));
1595
            } else {
1624
            } else {
1596
                const char *err = set_worker_param(cmd->pool, worker, elts[i].key,
1625
                const char *err = set_worker_param(cmd->pool, worker, elts[i].key,
1597
                                                   elts[i].val);
1626
                                                   elts[i].val);
Lines 2048-2054 static const char *add_member(cmd_parms *cmd, void Link Here
2048
    }
2077
    }
2049
2078
2050
    /* Try to find existing worker */
2079
    /* Try to find existing worker */
2051
    worker = ap_proxy_get_worker(cmd->temp_pool, balancer, conf, name);
2080
    worker = ap_proxy_get_worker(cmd->temp_pool, balancer, conf, de_socketfy(cmd->temp_pool, name));
2052
    if (!worker) {
2081
    if (!worker) {
2053
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, APLOGNO(01147)
2082
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, APLOGNO(01147)
2054
                     "Defining worker '%s' for balancer '%s'",
2083
                     "Defining worker '%s' for balancer '%s'",
Lines 2057-2069 static const char *add_member(cmd_parms *cmd, void Link Here
2057
            return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL);
2086
            return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL);
2058
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, APLOGNO(01148)
2087
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, APLOGNO(01148)
2059
                     "Defined worker '%s' for balancer '%s'",
2088
                     "Defined worker '%s' for balancer '%s'",
2060
                     worker->s->name, balancer->s->name);
2089
                     ap_proxy_worker_name(cmd->pool, worker), balancer->s->name);
2061
        PROXY_COPY_CONF_PARAMS(worker, conf);
2090
        PROXY_COPY_CONF_PARAMS(worker, conf);
2062
    } else {
2091
    } else {
2063
        reuse = 1;
2092
        reuse = 1;
2064
        ap_log_error(APLOG_MARK, APLOG_INFO, 0, cmd->server, APLOGNO(01149)
2093
        ap_log_error(APLOG_MARK, APLOG_INFO, 0, cmd->server, APLOGNO(01149)
2065
                     "Sharing worker '%s' instead of creating new worker '%s'",
2094
                     "Sharing worker '%s' instead of creating new worker '%s'",
2066
                     worker->s->name, name);
2095
                     ap_proxy_worker_name(cmd->pool, worker), name);
2067
    }
2096
    }
2068
2097
2069
    arr = apr_table_elts(params);
2098
    arr = apr_table_elts(params);
Lines 2072-2078 static const char *add_member(cmd_parms *cmd, void Link Here
2072
        if (reuse) {
2101
        if (reuse) {
2073
            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(01150)
2102
            ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(01150)
2074
                         "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
2103
                         "Ignoring parameter '%s=%s' for worker '%s' because of worker sharing",
2075
                         elts[i].key, elts[i].val, worker->s->name);
2104
                         elts[i].key, elts[i].val, ap_proxy_worker_name(cmd->pool, worker));
2076
        } else {
2105
        } else {
2077
            err = set_worker_param(cmd->pool, worker, elts[i].key,
2106
            err = set_worker_param(cmd->pool, worker, elts[i].key,
2078
                                               elts[i].val);
2107
                                               elts[i].val);
Lines 2134-2140 static const char * Link Here
2134
        }
2163
        }
2135
    }
2164
    }
2136
    else {
2165
    else {
2137
        worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, name);
2166
        worker = ap_proxy_get_worker(cmd->temp_pool, NULL, conf, de_socketfy(cmd->temp_pool, name));
2138
        if (!worker) {
2167
        if (!worker) {
2139
            if (in_proxy_section) {
2168
            if (in_proxy_section) {
2140
                err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
2169
                err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
Lines 2274-2280 static const char *proxysection(cmd_parms *cmd, vo Link Here
2274
        }
2303
        }
2275
        else {
2304
        else {
2276
            worker = ap_proxy_get_worker(cmd->temp_pool, NULL, sconf,
2305
            worker = ap_proxy_get_worker(cmd->temp_pool, NULL, sconf,
2277
                                         conf->p);
2306
                                         de_socketfy(cmd->temp_pool, (char*)conf->p));
2278
            if (!worker) {
2307
            if (!worker) {
2279
                err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
2308
                err = ap_proxy_define_worker(cmd->pool, &worker, NULL,
2280
                                          sconf, conf->p, 0);
2309
                                          sconf, conf->p, 0);
(-)modules/proxy/mod_proxy.h (+12 lines)
Lines 253-258 typedef struct { Link Here
253
    unsigned int need_flush:1; /* Flag to decide whether we need to flush the
253
    unsigned int need_flush:1; /* Flag to decide whether we need to flush the
254
                                * filter chain or not */
254
                                * filter chain or not */
255
    unsigned int inreslist:1;  /* connection in apr_reslist? */
255
    unsigned int inreslist:1;  /* connection in apr_reslist? */
256
    const char   *uds_path;    /* Unix domain socket path */
256
} proxy_conn_rec;
257
} proxy_conn_rec;
257
258
258
typedef struct {
259
typedef struct {
Lines 345-350 typedef struct { Link Here
345
    char      route[PROXY_WORKER_MAX_ROUTE_SIZE];     /* balancing route */
346
    char      route[PROXY_WORKER_MAX_ROUTE_SIZE];     /* balancing route */
346
    char      redirect[PROXY_WORKER_MAX_ROUTE_SIZE];  /* temporary balancing redirection route */
347
    char      redirect[PROXY_WORKER_MAX_ROUTE_SIZE];  /* temporary balancing redirection route */
347
    char      flusher[PROXY_WORKER_MAX_SCHEME_SIZE];  /* flush provider used by mod_proxy_fdpass */
348
    char      flusher[PROXY_WORKER_MAX_SCHEME_SIZE];  /* flush provider used by mod_proxy_fdpass */
349
    char      uds_path[PROXY_WORKER_MAX_NAME_SIZE];   /* path to worker's unix domain socket if applicable */
348
    int             lbset;      /* load balancer cluster set */
350
    int             lbset;      /* load balancer cluster set */
349
    int             retries;    /* number of retries on this worker */
351
    int             retries;    /* number of retries on this worker */
350
    int             lbstatus;   /* Current lbstatus */
352
    int             lbstatus;   /* Current lbstatus */
Lines 590-595 typedef __declspec(dllimport) const char * Link Here
590
592
591
/* Connection pool API */
593
/* Connection pool API */
592
/**
594
/**
595
 * Return the user-land, UDS aware worker name
596
 * @param p        memory pool used for displaying worker name
597
 * @param worker   the worker
598
 * @return         name
599
 */
600
601
PROXY_DECLARE(char *) ap_proxy_worker_name(apr_pool_t *p,
602
                                           proxy_worker *worker);
603
604
/**
593
 * Get the worker from proxy configuration
605
 * Get the worker from proxy configuration
594
 * @param p        memory pool used for finding worker
606
 * @param p        memory pool used for finding worker
595
 * @param balancer the balancer that the worker belongs to
607
 * @param balancer the balancer that the worker belongs to

Return to bug 54101