2011年2月28日星期一

Implementation of parsing URL to IPv6

Hey, guys. I've implement a parse URL to IPv6 function which is
discussed in "http://forum.nginx.org/read.php?2,177146,177190". I change
"ngx_parse_url" and add an function "ngx_parse_host" to resolve a host
(IP or text) to either IPv4 or IPv6 functions. And I change
"ngx_inet_resolve_host" to let it accept IPv4/IPv6. Besides I add
another function "ngx_inet_sock_addr" to parse string with format
"ipv4:port" and "[ipv6]:port" to the addr structure. Seems I can't
upload the attachment so I past them here. I've do the unit test to
them. Hope you can take regression test and merge them to the nginx main
branch.

If u wish, I can also past the unit test I write. (I think send via
email would be more convenient)

ngx_int_t
ngx_inet_sock_addr (u_char * p, size_t len, struct sockaddr * sockaddr)
{
u_char *port, *last;
ngx_int_t n;
struct sockaddr_in *sin;

#if (NGX_HAVE_INET6)
struct sockaddr_in6 *sin6;
u_char *q;

没有评论:

发表评论