Permalink
Browse files

drizzle_status: fixed a bug that may cause segfaults: we should have …

…skipped implicit upstream specified directly by the fastcgi_pass, proxy_pass, and similar directives.
  • Loading branch information...
1 parent b063433 commit bc4cd7d81730467a9424679a8bd38e6842587196 @agentzh agentzh committed Feb 28, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/ngx_http_drizzle_handler.c
@@ -388,6 +388,13 @@ ngx_http_drizzle_status_handler(ngx_http_request_t *r)
for (i = 0; i < umcf->upstreams.nelts; i++) {
uscf = uscfp[i];
+ if (uscf->srv_conf == NULL) {
+ /* skip implicit upstream specified directly by the fastcgi_pass,
+ * proxy_pass, and similar directives */
+
+ continue;
+ }
+
dscf = ngx_http_conf_upstream_srv_conf(uscf, ngx_http_drizzle_module);
if (dscf == NULL || dscf->servers == NULL) {
@@ -492,6 +499,13 @@ ngx_http_drizzle_status_handler(ngx_http_request_t *r)
for (i = 0; i < umcf->upstreams.nelts; i++) {
uscf = uscfp[i];
+ if (uscf->srv_conf == NULL) {
+ /* skip implicit upstream specified directly by the fastcgi_pass,
+ * proxy_pass, and similar directives */
+
+ continue;
+ }
+
dscf = ngx_http_conf_upstream_srv_conf(uscf, ngx_http_drizzle_module);
if (dscf == NULL || dscf->servers == NULL) {

0 comments on commit bc4cd7d

Please sign in to comment.