Fix ipv6 in mod_proxy (fixes #2043)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2605 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.24
Stefan Bühler 14 years ago
parent ed417a04d6
commit a1862cc809

@ -31,6 +31,7 @@ NEWS
* Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040)
* Remove adaptive spawning code from fastcgi (was disabled for a long time)
* Allow mod_mysql_vhost to use stored procedures (fixes #2011, thx Ben Brown)
* Fix ipv6 in mod_proxy (fixes #2043)
- 1.4.23 - 2009-06-19
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)

@ -756,12 +756,15 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
switch(hctx->state) {
case PROXY_STATE_INIT:
#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
if (strstr(host->host->ptr,":")) {
if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
return HANDLER_ERROR;
}
} else {
} else
#endif
{
if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
return HANDLER_ERROR;

Loading…
Cancel
Save