Skip to content

Commit

Permalink
Update client-handshake.c
Browse files Browse the repository at this point in the history
Fix Redirects always connecting to the original address
- We now reset our getaddrinfo results when we are redirected
  • Loading branch information
Epic-RobCannaday committed Apr 19, 2021
1 parent 059e1bc commit 76ae91b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libwebsockets-3.0/lib/roles/http/client/client-handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,13 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port,
}
#endif

//@UE4 BEGIN - connect using getaddrinfo results
if (wsi->gai_results) {
freeaddrinfo(wsi->gai_results);
wsi->gai_results = NULL;
}
//@UE4 END - connect using getaddrinfo results

wsi->desc.sockfd = LWS_SOCK_INVALID;
lwsi_set_state(wsi, LRS_UNCONNECTED);
wsi->protocol = NULL;
Expand Down

0 comments on commit 76ae91b

Please sign in to comment.