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

(-)proxy_util.c.orig (-4 / +46 lines)
Lines 20-25 Link Here
20
#include "scoreboard.h"
20
#include "scoreboard.h"
21
#include "apr_version.h"
21
#include "apr_version.h"
22
22
23
#define PROXY_COPY_CONF_PARAMS(w, c) \
24
    do {                             \
25
        (w)->timeout              = (c)->timeout;               \
26
        (w)->timeout_set          = (c)->timeout_set;           \
27
        (w)->recv_buffer_size     = (c)->recv_buffer_size;      \
28
        (w)->recv_buffer_size_set = (c)->recv_buffer_size_set;  \
29
        (w)->io_buffer_size       = (c)->io_buffer_size;        \
30
        (w)->io_buffer_size_set   = (c)->io_buffer_size_set;    \
31
    } while (0)
32
23
#if APR_HAVE_UNISTD_H
33
#if APR_HAVE_UNISTD_H
24
#include <unistd.h>         /* for getpid() */
34
#include <unistd.h>         /* for getpid() */
25
#endif
35
#endif
Lines 1394-1407 Link Here
1394
        }
1404
        }
1395
        else if (r->proxyreq == PROXYREQ_REVERSE) {
1405
        else if (r->proxyreq == PROXYREQ_REVERSE) {
1396
            if (conf->reverse) {
1406
            if (conf->reverse) {
1397
                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
1398
                              "proxy: *: found reverse proxy worker for %s",
1399
                               *url);
1400
                *balancer = NULL;
1407
                *balancer = NULL;
1408
1409
		char *c;
1410
		char url_copy[strlen(*url) + 1];
1411
1412
		/* Make a copy of the URL where the path is truncated */
1413
		strcpy(url_copy, *url);
1414
		c = ap_strchr_c(url_copy, ':');
1415
1416
		if ( !(c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') ) {
1417
		  c = ap_strchr_c(c+3, '/');
1418
		  if ( c[0] == '/' )
1419
		    c[1] = '\0';
1420
		}
1421
1422
                const char *err = ap_proxy_add_worker(worker, conf->pool, conf, url_copy);
1423
		if (err) {
1424
		   ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
1425
                                 "proxy: unable to add new reverse proxy worker for %s - %s",
1426
                                 *url, err);
1427
		}
1428
		else
1429
		{
1430
         	   PROXY_COPY_CONF_PARAMS((proxy_worker *) *worker,
1431
					  (proxy_server_conf *) conf);
1432
1433
            	   ap_proxy_initialize_worker_share(conf, *worker, r->server);
1434
            	   ap_proxy_initialize_worker(*worker, r->server);
1435
            	   /* Do not disable worker in case of errors */
1436
            	   (*worker)->s->status |= PROXY_WORKER_IGNORE_ERRORS;
1437
            	   (*worker)->is_address_reusable = 1;
1438
		}
1439
1440
		ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
1441
                              "proxy: *: found reverse proxy worker for %s",
1442
                              *url);
1401
                *worker = conf->reverse;
1443
                *worker = conf->reverse;
1402
                access_status = OK;
1444
                access_status = OK;
1403
            }
1445
            }
1404
        }
1446
	}
1405
    }
1447
    }
1406
    else if (access_status == DECLINED && *balancer != NULL) {
1448
    else if (access_status == DECLINED && *balancer != NULL) {
1407
        /* All the workers are busy */
1449
        /* All the workers are busy */

Return to bug 43308