Skip to content

Commit

Permalink
Set name_len after setting name
Browse files Browse the repository at this point in the history
  • Loading branch information
steelman committed Apr 17, 2022
1 parent 0722c4b commit ee138e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ void uwsgi_add_socket_from_fd(struct uwsgi_socket *uwsgi_sock, int fd) {
uwsgi_sock->family = AF_INET;
uwsgi_sock->bound = 1;
uwsgi_sock->name = uwsgi_concat2(computed_addr, "");
uwsgi_sock->name_len = strlen(uwsgi_sock->name);
if (uwsgi.zerg) {
uwsgi_log("uwsgi zerg socket %d attached to INET address %s fd %d\n", uwsgi_get_socket_num(uwsgi_sock), computed_addr, uwsgi_sock->fd);
}
Expand Down Expand Up @@ -1222,6 +1223,7 @@ void uwsgi_add_socket_from_fd(struct uwsgi_socket *uwsgi_sock, int fd) {
uwsgi_sock->family = AF_INET6;
uwsgi_sock->bound = 1;
uwsgi_sock->name = uwsgi_concat2(computed_addr, "");
uwsgi_sock->name_len = strlen(uwsgi_sock->name);
if (uwsgi.zerg) {
uwsgi_log("uwsgi zerg socket %d attached to INET6 address %s fd %d\n", uwsgi_get_socket_num(uwsgi_sock), computed_addr, uwsgi_sock->fd);
}
Expand Down

0 comments on commit ee138e6

Please sign in to comment.