summaryrefslogtreecommitdiffhomepage
path: root/src/http/v2
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2016-06-20 11:50:39 +0300
committerRoman Arutyunyan <arut@nginx.com>2016-06-20 11:50:39 +0300
commit5b201ac31f968d13f1165e7f29967e5826ccb9a1 (patch)
tree61ce22b2491314e54fbcd585a28ffaa39cd49382 /src/http/v2
parent72d4e5d7930a07a8753640061bbe9210c6a1f890 (diff)
downloadnginx-5b201ac31f968d13f1165e7f29967e5826ccb9a1.tar.gz
nginx-5b201ac31f968d13f1165e7f29967e5826ccb9a1.tar.bz2
Introduced ngx_inet_get_port() and ngx_inet_set_port() functions.
Diffstat (limited to 'src/http/v2')
-rw-r--r--src/http/v2/ngx_http_v2_filter_module.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c
index caa835dec..acd049613 100644
--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -137,10 +137,6 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
ngx_http_v2_out_frame_t *frame;
ngx_http_core_loc_conf_t *clcf;
ngx_http_core_srv_conf_t *cscf;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
u_char addr[NGX_SOCKADDR_STRLEN];
static const u_char nginx[5] = "\x84\xaa\x63\x55\xe7";
@@ -280,24 +276,7 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
}
}
- switch (fc->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) fc->local_sockaddr;
- port = ntohs(sin6->sin6_port);
- break;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- port = 0;
- break;
-#endif
- default: /* AF_INET */
- sin = (struct sockaddr_in *) fc->local_sockaddr;
- port = ntohs(sin->sin_port);
- break;
- }
+ port = ngx_inet_get_port(fc->local_sockaddr);
location.len = sizeof("https://") - 1 + host.len
+ r->headers_out.location->value.len;