From f70bc36953d83daf54df12a7b83cd169ecaadd11 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Thu, 25 Sep 2003 13:42:19 +0000 Subject: =?UTF-8?q?IPv6=20patch=20from=20Nj=C3=A5l=20T.=20Borch=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVS patchset: 5413 CVS date: 2003/09/25 13:42:19 --- src/input/input_http.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/input/input_http.c') diff --git a/src/input/input_http.c b/src/input/input_http.c index ea87ccbe7..d785b52ac 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -19,7 +19,7 @@ * * input plugin for http network streams * - * $Id: input_http.c,v 1.63 2003/08/21 00:37:29 miguelfreitas Exp $ + * $Id: input_http.c,v 1.64 2003/09/25 13:42:19 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -205,7 +205,32 @@ static int http_plugin_parse_url (char *urlbuf, char **user, char **password, } else if (host != NULL) *host = start; - + +#ifdef ENABLE_IPV6 + // Add support for RFC 2732 + { + char *hostbracket, *hostendbracket; + + hostbracket = strchr(start, '['); + if (hostbracket != NULL) { + + hostendbracket = strchr(hostbracket, ']'); + + if (hostendbracket != NULL) { + + *hostendbracket = '\0'; + *host = (hostbracket + 1); + + // Might have a trailing port + + if (*(hostendbracket+1) == ':') { + portcolon = (hostendbracket + 1); + } + } + } + } +#endif + if (slash != 0) { *slash = '\0'; -- cgit v1.2.3