Skip to content

Commit 18ce5fb

Browse files
bugfix: didn't use right hostname when the length of hostname is greater than 32.
1 parent 8f3987f commit 18ce5fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngx_http_lua_balancer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
702702
item->host.len = host->len;
703703

704704
} else {
705-
item->host.data = ngx_pstrdup(c->pool, bp->addr_text);
705+
item->host.data = ngx_pstrdup(c->pool, host);
706706
if (item->host.data == NULL) {
707707
ngx_http_lua_balancer_close(c);
708708

@@ -713,7 +713,7 @@ ngx_http_lua_balancer_free_peer(ngx_peer_connection_t *pc, void *data,
713713
return;
714714
}
715715

716-
item->host.len = bp->addr_text->len;
716+
item->host.len = host->len;
717717
}
718718

719719
} else {

0 commit comments

Comments
 (0)