Changeset 2037
- Timestamp:
- 01/16/2008 01:00:32 AM (6 months ago)
- Files:
-
- branches/lighttpd-1.4.x/NEWS (modified) (1 diff)
- branches/lighttpd-1.4.x/src/mod_fastcgi.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/lighttpd-1.4.x/NEWS
r2035 r2037 13 13 * fixed a bug that made /-prefixed extensions being handled also when 14 14 matching the end of the uri in fcgi,scgi and proxy modules (#1489) 15 * Print error if X-LIGHTTPD-send-file cannot be done; reset header 16 Content-Length for send-file. Patches by Stefan B� 15 * print error if X-LIGHTTPD-send-file cannot be done; reset header 16 Content-Length for send-file. Patches by Stefan B� * prevent crash in certain php-fcgi configurations (#841) 17 17 18 - 1.4.18 - 2007-09-09 18 19 branches/lighttpd-1.4.x/src/mod_fastcgi.c
r2034 r2037 163 163 * whole connection is local 164 164 * 165 * if tcp/ip should be used host AND port have166 * to be specified165 * if port is not 0, and host is not specified, 166 * "localhost" (INADDR_LOOPBACK) is assumed. 167 167 * 168 168 */ … … 824 824 825 825 if (buffer_is_empty(host->host)) { 826 fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ ANY);826 fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 827 827 } else { 828 828 struct hostent *he; 829 829 830 830 /* set a useful default */ 831 fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_ ANY);831 fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 832 832 833 833 … … 859 859 860 860 buffer_copy_string(proc->connection_name, "tcp:"); 861 buffer_append_string_buffer(proc->connection_name, host->host); 861 if (!buffer_is_empty(host->host)) { 862 buffer_append_string_buffer(proc->connection_name, host->host); 863 } else { 864 buffer_append_string(proc->connection_name, "localhost"); 865 } 862 866 buffer_append_string(proc->connection_name, ":"); 863 867 buffer_append_long(proc->connection_name, proc->port); … … 1688 1692 } else { 1689 1693 fcgi_addr_in.sin_family = AF_INET; 1690 if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) { 1691 log_error_write(srv, __FILE__, __LINE__, "sbs", 1692 "converting IP address failed for", host->host, 1693 "\nBe sure to specify an IP address here"); 1694 1695 return -1; 1694 if (!buffer_is_empty(host->host)) { 1695 if (0 == inet_aton(host->host->ptr, &(fcgi_addr_in.sin_addr))) { 1696 log_error_write(srv, __FILE__, __LINE__, "sbs", 1697 "converting IP address failed for", host->host, 1698 "\nBe sure to specify an IP address here"); 1699 1700 return -1; 1701 } 1702 } else { 1703 fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK); 1696 1704 } 1697 1705 fcgi_addr_in.sin_port = htons(proc->port); … … 1703 1711 /* on remote spawing we have to set the connection-name now */ 1704 1712 buffer_copy_string(proc->connection_name, "tcp:"); 1705 buffer_append_string_buffer(proc->connection_name, host->host); 1713 if (!buffer_is_empty(host->host)) { 1714 buffer_append_string_buffer(proc->connection_name, host->host); 1715 } else { 1716 buffer_append_string(proc->connection_name, "localhost"); 1717 } 1706 1718 buffer_append_string(proc->connection_name, ":"); 1707 1719 buffer_append_long(proc->connection_name, proc->port); … … 2733 2745 int ret; 2734 2746 2735 /* sanity check */ 2747 /* sanity check: 2748 * - host != NULL 2749 * - either: 2750 * - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK) 2751 * - unix socket 2752 */ 2736 2753 if (!host || 2737 ( (!host->host->used || !host->port)&& !host->unixsocket->used)) {2754 (!host->port && !host->unixsocket->used)) { 2738 2755 log_error_write(srv, __FILE__, __LINE__, "sxddd", 2739 2756 "write-req: error",

