Lines 1794-1799
Link Here
|
1794 |
} |
1794 |
} |
1795 |
#endif |
1795 |
#endif |
1796 |
|
1796 |
|
|
|
1797 |
#if PROXY_HAS_SCOREBOARD |
1798 |
void *ap_proxy_get_scoreboard_lb(proxy_worker *worker) { |
1799 |
int i = 0; |
1800 |
proxy_worker_stat *free_slot = NULL; |
1801 |
proxy_worker_stat *s; |
1802 |
|
1803 |
if (!ap_scoreboard_image) { |
1804 |
return NULL; |
1805 |
} |
1806 |
|
1807 |
/* Try to find out the right shared memory according to worker->name. */ |
1808 |
while ((s = (proxy_worker_stat *)ap_get_scoreboard_lb(i++)) != NULL) { |
1809 |
if (strncmp(worker->name, s->name, PROXY_WORKER_MAX_NAME_SIZE) == 0) { |
1810 |
return s; |
1811 |
} |
1812 |
else if (s->status == 0 && free_slot == NULL) { |
1813 |
free_slot = s; |
1814 |
} |
1815 |
} |
1816 |
|
1817 |
/* We failed to find out shared memory, so just use free slot */ |
1818 |
return free_slot; |
1819 |
}; |
1820 |
#endif |
1821 |
|
1797 |
/* |
1822 |
/* |
1798 |
* ap_proxy_initialize_worker_share() concerns itself |
1823 |
* ap_proxy_initialize_worker_share() concerns itself |
1799 |
* with initializing those parts of worker which |
1824 |
* with initializing those parts of worker which |
Lines 1819-1825
Link Here
|
1819 |
#if PROXY_HAS_SCOREBOARD |
1844 |
#if PROXY_HAS_SCOREBOARD |
1820 |
/* Get scoreboard slot */ |
1845 |
/* Get scoreboard slot */ |
1821 |
if (ap_scoreboard_image) { |
1846 |
if (ap_scoreboard_image) { |
1822 |
score = ap_get_scoreboard_lb(worker->id); |
1847 |
score = ap_proxy_get_scoreboard_lb(worker); |
1823 |
if (!score) { |
1848 |
if (!score) { |
1824 |
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, |
1849 |
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, |
1825 |
"proxy: ap_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s", |
1850 |
"proxy: ap_get_scoreboard_lb(%d) failed in child %" APR_PID_T_FMT " for worker %s", |
Lines 1862-1867
Link Here
|
1862 |
else { |
1887 |
else { |
1863 |
*worker->s->redirect = '\0'; |
1888 |
*worker->s->redirect = '\0'; |
1864 |
} |
1889 |
} |
|
|
1890 |
strncpy(worker->s->name, worker->name, PROXY_WORKER_MAX_NAME_SIZE); |
1865 |
|
1891 |
|
1866 |
worker->s->status |= (worker->status | PROXY_WORKER_INITIALIZED); |
1892 |
worker->s->status |= (worker->status | PROXY_WORKER_INITIALIZED); |
1867 |
|
1893 |
|