sip: get local TCP address in establish handler (#146)

After calling tcp_connect(), the address returned by
tcp_conn_local_get() is 0.0.0.0 on some platforms (Windows).

The local address of the TCP-connection is not available
until the TCP connection is fully established, so fetch the
address again in the established handler.

Reference: https://github.com/alfredh/baresip/issues/431
This commit is contained in:
Alfred E. Heggestad 2018-06-19 08:51:58 +02:00 committed by Richard Aas
parent 055195d2ea
commit 4ded6cbcc9

View file

@ -459,6 +459,10 @@ static void tcp_estab_handler(void *arg)
struct le *le;
int err;
#ifdef WIN32
tcp_conn_local_get(conn->tc, &conn->laddr);
#endif
conn->established = true;
le = list_head(&conn->ql);