Changeset 2173
- Timestamp:
- 05/22/2008 03:41:17 AM (3 months ago)
- Location:
- branches/lighttpd-1.4.x/src
- Files:
-
- 2 modified
-
mod_fastcgi.c (modified) (1 diff)
-
mod_scgi.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.4.x/src/mod_fastcgi.c
r2163 r2173 3504 3504 /* check if we have at least one server for this extension up and running */ 3505 3505 for (k = 0; k < extension->used; k++) { 3506 host= extension->hosts[k];3506 fcgi_extension_host *h = extension->hosts[k]; 3507 3507 3508 3508 /* we should have at least one proc that can do something */ 3509 if (host->active_procs == 0) { 3510 host = NULL; 3511 3509 if (h->active_procs == 0) { 3512 3510 continue; 3513 3511 } 3514 3512 3515 3513 /* we found one host that is alive */ 3514 host = h; 3516 3515 break; 3517 3516 } -
branches/lighttpd-1.4.x/src/mod_scgi.c
r2172 r2173 234 234 buffer *key; /* like .php */ 235 235 236 int note_is_sent; 236 237 scgi_extension_host **hosts; 237 238 … … 2669 2670 size_t s_len; 2670 2671 int used = -1; 2671 int ndx;2672 2672 size_t k; 2673 2673 buffer *fn; … … 2714 2714 2715 2715 /* get best server */ 2716 for (k = 0, ndx = -1; k < extension->used; k++) { 2717 scgi_extension_host *host = extension->hosts[k]; 2718 2719 /* we should have at least one proc that can do somthing */ 2720 if (host->active_procs == 0) continue; 2721 2722 if (used == -1 || host->load < used) { 2723 used = host->load; 2724 2725 ndx = k; 2726 } 2727 } 2728 2729 /* found a server */ 2730 if (ndx == -1) { 2731 /* no handler found */ 2716 for (k = 0; k < extension->used; k++) { 2717 scgi_extension_host *h = extension->hosts[k]; 2718 2719 /* we should have at least one proc that can do something */ 2720 if (h->active_procs == 0) { 2721 continue; 2722 } 2723 2724 if (used == -1 || h->load < used) { 2725 used = h->load; 2726 2727 host = h; 2728 } 2729 } 2730 2731 if (!host) { 2732 /* sorry, we don't have a server alive for this ext */ 2732 2733 buffer_reset(con->physical.path); 2733 2734 con->http_status = 500; 2734 2735 2735 log_error_write(srv, __FILE__, __LINE__, "sb", 2736 "no fcgi-handler found for:", 2737 fn); 2736 /* only send the 'no handler' once */ 2737 if (!extension->note_is_sent) { 2738 extension->note_is_sent = 1; 2739 2740 log_error_write(srv, __FILE__, __LINE__, "sbsbs", 2741 "all handlers for ", con->uri.path, 2742 "on", extension->key, 2743 "are down."); 2744 } 2738 2745 2739 2746 return HANDLER_FINISHED; 2740 2747 } 2741 2748 2742 host = extension->hosts[ndx]; 2749 /* a note about no handler is not sent yet */ 2750 extension->note_is_sent = 0; 2743 2751 2744 2752 /* … … 2770 2778 2771 2779 if (con->conf.log_request_handling) { 2772 log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_scgi"); 2780 log_error_write(srv, __FILE__, __LINE__, "s", 2781 "handling it in mod_fastcgi"); 2773 2782 } 2774 2783 2775 2784 /* the prefix is the SCRIPT_NAME, 2776 * ever thing from start to the next slash2785 * everything from start to the next slash 2777 2786 * this is important for check-local = "disable" 2778 2787 * … … 2805 2814 } 2806 2815 } 2807 return HANDLER_GO_ON;2808 2816 } else { 2809 2817 handler_ctx *hctx; … … 2827 2835 log_error_write(srv, __FILE__, __LINE__, "s", "handling it in mod_fastcgi"); 2828 2836 } 2829 2830 return HANDLER_GO_ON; 2831 } 2837 } 2838 2832 2839 return HANDLER_GO_ON; 2833 2840 }

