[libnice] bug fix pseudo tcp session close not signalled to other peer

Philip Withnall philip at tecnocode.co.uk
Thu Oct 30 02:14:58 PDT 2014

On Wed, 2014-10-29 at 12:06 +0100, Klaus Kranz wrote:
> when calling nice_agent_remove_stream() a WARNING message can be
> observed “failed to send pseudo-TCP packet from agent as no pair has
> been selected yet”, which originates from agent.c
> pseudo_tcp_socket_write_packet().
> This prevents signaling session close to the other peer.

Thanks for reminding me of this. I was aware of the issue before, but
could not make time to implement the necessary fix (see below).

For the moment, I’ve filed a bug so it doesn’t get forgotten, and
committed your suggested change since it does improve things a bit:

> It was found that in component.c component_close() candidates are
> remove before calling pseudo_tcp_socket_close().
> Moving calling pseudo_tcp_socket_close() to the beginning of that
> function solves that issue.

Unfortunately it doesn’t solve the issue, just mitigates it in certain
pseudo-TCP states. pseudo_tcp_socket_close() does not block on
completing the FIN handshake, so moving it further up component_close()
means the handshake is started, but not finished. That’s better than
before, but not perfect.

The correct fix requires making all that API blocking and asynchronous,
so that at the point ncie_agent_remove_stream_async() completes, we can
guarantee that the pseudo-TCP socket FIN handshake has completed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/nice/attachments/20141030/c1bd6d7e/attachment.sig>

More information about the nice mailing list