head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.50 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.48 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.46 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.44 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.42 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.40 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.38 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.36 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.34 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.32 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.30 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.28 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.26 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.24 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.22 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.20 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.18 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.16 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.14 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.12 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.10 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.8 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.6 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.4 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.2 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.1.0.6 pkgsrc-2004Q1-base:1.1 pkgsrc-2003Q4:1.1.0.4 pkgsrc-2003Q4-base:1.1 netbsd-1-6-1:1.1.0.2 netbsd-1-6-1-base:1.1; locks; strict; comment @# @; 1.2 date 2004.05.06.14.48.57; author drochner; state dead; branches; next 1.1; 1.1 date 2002.10.14.09.47.00; author rh; state Exp; branches; next ; desc @@ 1.2 log @update to 1.2.10 changes: -bugfixes -IPv6 support integrated -new translations -minor feature additions @ text @$NetBSD: patch-at,v 1.1 2002/10/14 09:47:00 rh Exp $ --- Input/vorbis/http.c.orig Thu Jan 3 00:21:21 2002 +++ Input/vorbis/http.c @@@@ -287,8 +287,13 @@@@ static void *http_buffer_loop(void *arg) gint cnt, written, error, err_len, port, cport; gboolean redirect; fd_set set; +#ifdef USE_IPV6 + struct addrinfo hints, *res, *res0; + char service[6]; +#else struct hostent *hp; struct sockaddr_in address; +#endif struct timeval tv; url = (gchar *) arg; @@@@ -310,6 +315,44 @@@@ static void *http_buffer_loop(void *arg) chost = vorbis_cfg.use_proxy ? vorbis_cfg.proxy_host : host; cport = vorbis_cfg.use_proxy ? vorbis_cfg.proxy_port : port; +#ifdef USE_IPV6 + snprintf(service, 6, "%d", cport); + memset(&hints, 0, sizeof(hints)); + hints.ai_socktype = SOCK_STREAM; + if (! getaddrinfo(chost, service, &hints, &res0)) { + eof = TRUE; + for (res = res0; res; res = res->ai_next) { + if ((sock = socket (res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) + continue; + fcntl(sock, F_SETFL, O_NONBLOCK); + status = g_strdup_printf(_("CONNECTING TO %s:%d"), chost, cport); + vorbis_ip.set_info_text(status); + g_free(status); + ((struct sockaddr_in6 *)res->ai_addr)->sin6_port = htons(cport); + if (connect(sock, res->ai_addr, res->ai_addrlen) < 0) { + if (errno != EINPROGRESS) { + close(sock); + continue; + } + } + eof = FALSE; + break; + } + freeaddrinfo(res0); + if (eof) { + status = g_strdup_printf(_("Couldn't connect to host %s:%d"), chost, cport); + vorbis_ip.set_info_text(status); + g_free(status); + eof = TRUE; + break; + } + } else { + status = g_strdup_printf(_("Couldn't look up host %s"), chost); + vorbis_ip.set_info_text(status); + g_free(status); + eof = TRUE; + } +#else sock = socket(AF_INET, SOCK_STREAM, 0); fcntl(sock, F_SETFL, O_NONBLOCK); address.sin_family = AF_INET; @@@@ -327,9 +370,11 @@@@ static void *http_buffer_loop(void *arg) vorbis_ip.set_info_text(NULL); eof = TRUE; } +#endif if (!eof) { +#ifndef USE_IPV6 memcpy(&address.sin_addr.s_addr, *(hp->h_addr_list), sizeof (address.sin_addr.s_addr)); address.sin_port = g_htons(cport); @@@@ -348,6 +393,7 @@@@ static void *http_buffer_loop(void *arg) eof = TRUE; } } +#endif while (going) { tv.tv_sec = 0; @ 1.1 log @Add support for IPv6, mainly using the patches from http://www.version6.net/ Bump PKGREVISION. This closes PR pkg/17771 by Tomi Nylund @ text @d1 1 a1 1 $NetBSD$ @