diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2015-08-20 18:01:33 +0200 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2015-08-20 18:01:33 +0200 |
commit | e9a7dab950797403bb5ba42a23d2845c50bdb8c6 (patch) | |
tree | d9003fece096b4d58aa018dc74eed643dcf9dd4f /tinySIP/src | |
parent | a6c2cf6a7456b3d04f15b216ef15c67e61ff5a7d (diff) | |
download | doubango-e9a7dab950797403bb5ba42a23d2845c50bdb8c6.zip doubango-e9a7dab950797403bb5ba42a23d2845c50bdb8c6.tar.gz |
Fix issue reported at https://groups.google.com/forum/#!topic/doubango/oeg-OBEH0G4
Diffstat (limited to 'tinySIP/src')
-rw-r--r-- | tinySIP/src/transports/tsip_transport.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tinySIP/src/transports/tsip_transport.c b/tinySIP/src/transports/tsip_transport.c index ac1c8d1..f86f718 100644 --- a/tinySIP/src/transports/tsip_transport.c +++ b/tinySIP/src/transports/tsip_transport.c @@ -647,8 +647,13 @@ int tsip_transport_add_stream_peer_2(tsip_transport_t *self, tnet_fd_t local_fd, tsip_transport_stream_peers_lock(self); if(tsip_transport_have_stream_peer_with_local_fd(self, local_fd)){ - // could happen if the closed socket haven't raise "close event" yet and new own added : Windows only + TSK_DEBUG_INFO("Peer with local fd=%d already exist", local_fd); +#if TSIP_UNDER_WINDOWS + // could happen if the closed socket haven't raised "close event" yet and new one added : Windows only tsip_transport_remove_stream_peer_by_local_fd(self, local_fd); +#else + peer = tsip_transport_pop_stream_peer_by_local_fd(self, local_fd); +#endif } if(tsk_strnullORempty(remote_host) || !remote_port){ @@ -665,7 +670,7 @@ int tsip_transport_add_stream_peer_2(tsip_transport_t *self, tnet_fd_t local_fd, goto bail; } - if(!(peer = tsk_object_new(tsip_transport_stream_peer_def_t))){ + if(!peer && !(peer = tsk_object_new(tsip_transport_stream_peer_def_t))){ TSK_DEBUG_ERROR("Failed to create network stream peer"); ret = -4; goto bail; |