platform/upstream/libnice.git
10 years agoAdd support for MS-ICE2 candidate priorization for OC2007R2 compatibility
Youness Alaoui [Wed, 9 Apr 2014 23:47:54 +0000 (19:47 -0400)]
Add support for MS-ICE2 candidate priorization for OC2007R2 compatibility

10 years agoRename turn files and API to be UDP specific
Youness Alaoui [Wed, 9 Apr 2014 03:58:01 +0000 (23:58 -0400)]
Rename turn files and API to be UDP specific

The TURN-TCP RFC is very different from TURN-UDP, the current turn and tcp-turn
files were only for UDP TURN RFC and UDP TURN using TCP transport.
When we implement TCP-TURN, we'll need a different algorithm, so I
renamed the files and API to avoid any confusion.

10 years agoFix crash when discovering peer reflexive candidates in RFC compat
Youness Alaoui [Wed, 9 Apr 2014 03:56:39 +0000 (23:56 -0400)]
Fix crash when discovering peer reflexive candidates in RFC compat

10 years agotest-fullmode: protect against ready->connected->ready state change and accept data...
Youness Alaoui [Wed, 9 Apr 2014 03:55:00 +0000 (23:55 -0400)]
test-fullmode: protect against ready->connected->ready state change and accept data reception on connected state

10 years agoMake OC2007 relay candidates use TCP_ACTIVE and TCP_PASSIVE candidate types when...
Youness Alaoui [Wed, 9 Apr 2014 02:11:19 +0000 (22:11 -0400)]
Make OC2007 relay candidates use TCP_ACTIVE and TCP_PASSIVE candidate types when using TCP TURN

10 years agoDo not add server-reflexive from TURN if using a TCP connection
Youness Alaoui [Wed, 9 Apr 2014 01:42:02 +0000 (21:42 -0400)]
Do not add server-reflexive from TURN if using a TCP connection

10 years agoRemove priority functions from public header file and move to agent-priv.h
Youness Alaoui [Wed, 9 Apr 2014 01:31:11 +0000 (21:31 -0400)]
Remove priority functions from public header file and move to agent-priv.h

10 years agoChange priority algorithm for better values
Youness Alaoui [Wed, 9 Apr 2014 01:26:42 +0000 (21:26 -0400)]
Change priority algorithm for better values

Now we will always give a handicap to UDP candidates, but still give
relays the lower priority. We have the following priorities now :
In reliable mode :
TCP Host : 120
TCP peer-refl : 110
TCP nat-assist : 105
TCP srv-refl : 100
UDP Host : 60
UDP peer-refl : 55
UDP nat-assist : 52
UDP srv-refl : 50
TCP relay : 10
UDP relay : 5

In unreliable mode :
UDP Host : 120
UDP peer-refl : 110
UDP nat-assist : 105
UDP srv-refl : 100
TCP Host : 60
TCP peer-refl : 55
TCP nat-assist : 52
TCP srv-refl : 50
UDP relay : 10
TCP relay : 5

10 years agotest-priority: Unit test various configurations of candidate priorities
Youness Alaoui [Wed, 9 Apr 2014 00:48:15 +0000 (20:48 -0400)]
test-priority: Unit test various configurations of candidate priorities

10 years agoFix peer reflexive priority depending on transport and compatibility
Youness Alaoui [Wed, 9 Apr 2014 00:26:09 +0000 (20:26 -0400)]
Fix peer reflexive priority depending on transport and compatibility

10 years agoAdd support for ice-tcp priorities, udp-tunneled and nat-assisted priorities
Youness Alaoui [Wed, 9 Apr 2014 00:21:55 +0000 (20:21 -0400)]
Add support for ice-tcp priorities, udp-tunneled and nat-assisted priorities

10 years agoUse nice_candidate_ice_priority instead of _full variant when possible
Youness Alaoui [Tue, 8 Apr 2014 23:10:36 +0000 (19:10 -0400)]
Use nice_candidate_ice_priority instead of _full variant when possible

10 years agoAdd support for MS-TURN in OC2007 compatibility turn usage
Youness Alaoui [Tue, 8 Apr 2014 07:58:15 +0000 (03:58 -0400)]
Add support for MS-TURN in OC2007 compatibility turn usage

10 years agoDo not enable keepalives for tcp candidates
Youness Alaoui [Tue, 8 Apr 2014 07:57:43 +0000 (03:57 -0400)]
Do not enable keepalives for tcp candidates

10 years agodo not set socket tos if fileno == NULL
Youness Alaoui [Tue, 8 Apr 2014 07:37:59 +0000 (03:37 -0400)]
do not set socket tos if fileno == NULL

10 years agoAdd support for tcp candidates in sdp generation
Youness Alaoui [Tue, 8 Apr 2014 06:54:19 +0000 (02:54 -0400)]
Add support for tcp candidates in sdp generation

10 years agoAdd candidate type to debug
Youness Alaoui [Tue, 8 Apr 2014 06:53:50 +0000 (02:53 -0400)]
Add candidate type to debug

10 years agoAdd a sockptr to CandidateCheckPair, will be required for tcp-active
Youness Alaoui [Tue, 8 Apr 2014 06:05:37 +0000 (02:05 -0400)]
Add a sockptr to CandidateCheckPair, will be required for tcp-active

10 years agoDo not attach to sockets with fileno == NULL (requires for tcp-active)
Youness Alaoui [Tue, 8 Apr 2014 05:28:55 +0000 (01:28 -0400)]
Do not attach to sockets with fileno == NULL (requires for tcp-active)

10 years agoOnly check selected pair for writability in gio outputstream
Youness Alaoui [Tue, 8 Apr 2014 03:14:42 +0000 (23:14 -0400)]
Only check selected pair for writability in gio outputstream

10 years agoDo not retransmit connection checks on reliable transport
Jakub Adam [Thu, 2 Jun 2011 21:04:44 +0000 (23:04 +0200)]
Do not retransmit connection checks on reliable transport

10 years agoUse local candidate foundation as CANDIDATE-IDENTIFIER when creating
Jakub Adam [Sun, 22 May 2011 12:30:06 +0000 (14:30 +0200)]
Use local candidate foundation as CANDIDATE-IDENTIFIER when creating
STUN_BINDING requests.

Candidate check pair foundation was used - a combination of local
and remote candidates' foundation, which does not correspond with
[MS-ICE2] 2.2.2.1 0x8054 CANDIDATE-IDENTIFIER

10 years agoDisable TURN refresh in MSOC compatibility mode
Jakub Adam [Sun, 26 Aug 2012 18:10:47 +0000 (20:10 +0200)]
Disable TURN refresh in MSOC compatibility mode

At least temporary, maybe it is not used at all. TURN refresh messages
were not seen in the packet capture.

10 years agoIf allow_partial, then allow a return 0 from the socket
Youness Alaoui [Sat, 5 Apr 2014 09:54:01 +0000 (05:54 -0400)]
If allow_partial, then allow a return 0 from the socket

10 years agoOnce a ice-tcp connection is established, it should work like any other, so just...
Youness Alaoui [Sat, 5 Apr 2014 09:53:31 +0000 (05:53 -0400)]
Once a ice-tcp connection is established, it should work like any other, so just send to it

10 years agoGenerate valid TCP connection check pairs
Youness Alaoui [Sat, 5 Apr 2014 07:41:48 +0000 (03:41 -0400)]
Generate valid TCP connection check pairs

10 years agoRefactor discovery/agent to add support for non-udp candidates
Youness Alaoui [Sat, 5 Apr 2014 07:15:23 +0000 (03:15 -0400)]
Refactor discovery/agent to add support for non-udp candidates

10 years agoFix indentation for _set_remote_candidates_locked
Youness Alaoui [Sat, 5 Apr 2014 03:54:12 +0000 (23:54 -0400)]
Fix indentation for _set_remote_candidates_locked

10 years agoSmall refactoring of agent, loop on component id from 1
Youness Alaoui [Sat, 5 Apr 2014 03:56:53 +0000 (23:56 -0400)]
Small refactoring of agent, loop on component id from 1

10 years agoAdd support for MS-TURN in tcp-turn
Youness Alaoui [Fri, 4 Apr 2014 11:18:44 +0000 (07:18 -0400)]
Add support for MS-TURN in tcp-turn

10 years agoAdd support for MS Office Communicator pseudossl compatibility
Youness Alaoui [Sat, 5 Apr 2014 03:56:16 +0000 (23:56 -0400)]
Add support for MS Office Communicator pseudossl compatibility

10 years agoFactor out pseudotcp so it's not used if the transport is already reliable
Youness Alaoui [Fri, 4 Apr 2014 06:12:02 +0000 (02:12 -0400)]
Factor out pseudotcp so it's not used if the transport is already reliable

10 years agoAdd a nice_socket_send_reliable API for internal use.
Youness Alaoui [Sat, 5 Apr 2014 04:29:54 +0000 (00:29 -0400)]
Add a nice_socket_send_reliable API for internal use.

One issue with tcp-bsd is that it will queue messages when the tcp socket
is not writable, but it will also drop messages when the queue is full.
If we want to do proper reliable ice-tcp, we need to make sure that
messages don't get dropped, also, this would affect http/socks5/pseudossl
if their messages get dropped. For ice-tcp, when the socket is not writable
we want to return 0, not queue the message.
The change here is to allow connchecks and other important protocol messages
to be sent as 'reliable' on tcp transports by queuing them and in the various
socket layers and to never drop them, but all user messages will be dropped.

if the tcp socket is not writable.

10 years agoturn: In case of error, don't just pass through the data, return an error
Youness Alaoui [Sat, 5 Apr 2014 04:27:59 +0000 (00:27 -0400)]
turn: In case of error, don't just pass through the data, return an error

10 years agoReturn number of sent messages in socket_send_messages when an error happens part-way
Youness Alaoui [Sat, 5 Apr 2014 04:21:02 +0000 (00:21 -0400)]
Return number of sent messages in socket_send_messages when an error happens part-way

10 years agoFix return value of send_messages in socks5
Youness Alaoui [Sat, 5 Apr 2014 04:14:18 +0000 (00:14 -0400)]
Fix return value of send_messages in socks5

10 years agoAllow tcp-bsd to act as reliable or non reliable transport and fix is_reliable on...
Youness Alaoui [Thu, 3 Apr 2014 01:53:12 +0000 (21:53 -0400)]
Allow tcp-bsd to act as reliable or non reliable transport and fix is_reliable on other sockets

10 years agoAdd a socket type for socket layer
Youness Alaoui [Tue, 1 Apr 2014 01:30:29 +0000 (21:30 -0400)]
Add a socket type for socket layer

10 years agoSome refactoring to allow for ice-tcp (non pseudotcp reliable)
Youness Alaoui [Tue, 1 Apr 2014 01:13:14 +0000 (21:13 -0400)]
Some refactoring to allow for ice-tcp (non pseudotcp reliable)

10 years agoFix documentation in preparation for ice-tcp support
Youness Alaoui [Tue, 1 Apr 2014 00:24:58 +0000 (20:24 -0400)]
Fix documentation in preparation for ice-tcp support

10 years agoAdd ICE-TCP candidate transport types
Youness Alaoui [Wed, 22 Aug 2012 19:55:03 +0000 (15:55 -0400)]
Add ICE-TCP candidate transport types

10 years agoSmall documentation fix
Youness Alaoui [Tue, 25 Mar 2014 02:35:52 +0000 (22:35 -0400)]
Small documentation fix

10 years agoagent: Use 1280 instead of 65536 buffer size to send STUN Message
Olivier Crête [Mon, 12 May 2014 23:40:08 +0000 (19:40 -0400)]
agent: Use 1280 instead of 65536 buffer size to send STUN Message

RFC 5389 says:
   All STUN messages sent over UDP SHOULD be less than the path MTU, if
   known.  If the path MTU is unknown, messages SHOULD be the smaller of
   576 bytes and the first-hop MTU for IPv4 [RFC1122] and 1280 bytes for
   IPv6 [RFC2460].

So sending 65536 bytes is always wrong

10 years agoVersion 0.1.7.1
Olivier Crête [Mon, 5 May 2014 19:02:48 +0000 (15:02 -0400)]
Version 0.1.7.1

10 years agoVersion 0.1.7 0.1.7
Olivier Crête [Mon, 5 May 2014 18:58:12 +0000 (14:58 -0400)]
Version 0.1.7

10 years agostunmessage: Revert another function to use sockaddr
Olivier Crête [Fri, 2 May 2014 21:53:40 +0000 (17:53 -0400)]
stunmessage: Revert another function to use sockaddr

The farstream unit tests were using it.

10 years agothreaded-example: Make sure the foundation string is NULL terminated
Olivier Crête [Tue, 29 Apr 2014 03:10:54 +0000 (23:10 -0400)]
threaded-example: Make sure the foundation string is NULL terminated

10 years agoVersion 0.1.6.1
Olivier Crête [Tue, 29 Apr 2014 01:05:34 +0000 (21:05 -0400)]
Version 0.1.6.1

10 years agoVersion 0.1.6 0.1.6
Olivier Crête [Tue, 29 Apr 2014 00:39:31 +0000 (20:39 -0400)]
Version 0.1.6

10 years agoFix udp-turn returning wrong message length in socket_recv_messages.
Youness Alaoui [Mon, 28 Apr 2014 21:21:04 +0000 (17:21 -0400)]
Fix udp-turn returning wrong message length in socket_recv_messages.

When using optimal path where recv message has only one buffer, the
buffer length was set to the size of the buffer, not its length, which was
causing the wrong message length to be returned causing the agent to
discard STUN messages because their size doesn't match received data
length.

10 years agoagent: Add a missing forward declaration
Philip Withnall [Fri, 25 Apr 2014 07:21:55 +0000 (08:21 +0100)]
agent: Add a missing forward declaration

10 years agoagent: Simplify gathering-done stage of UPnP handling
Philip Withnall [Thu, 24 Apr 2014 15:11:03 +0000 (16:11 +0100)]
agent: Simplify gathering-done stage of UPnP handling

This introduces no functional changes, but consolidates and documents
the code a bit more.

10 years agoagent: Tidy up upnp_mapping handling
Philip Withnall [Thu, 24 Apr 2014 14:59:24 +0000 (15:59 +0100)]
agent: Tidy up upnp_mapping handling

Use a NULL check to determine if upnp_mapping is an empty list (rather
than counting every element). Use g_slist_free_full() where appropriate.

This introduces no functional changes.

10 years agoagent: Document units for NiceAgent::upnp-timeout property
Philip Withnall [Thu, 24 Apr 2014 14:58:01 +0000 (15:58 +0100)]
agent: Document units for NiceAgent::upnp-timeout property

It’s in milliseconds.

10 years agostunagent: Only declare the long term key valid if the username/realm coudl be read
Olivier Crête [Fri, 25 Apr 2014 01:32:40 +0000 (21:32 -0400)]
stunagent: Only declare the long term key valid if the username/realm coudl be read

10 years agoexample: Prevent possible non-NULL terminated string
Olivier Crête [Fri, 25 Apr 2014 01:32:12 +0000 (21:32 -0400)]
example: Prevent possible non-NULL terminated string

10 years agoaddress: Correctly identify ipv6 link local
Olivier Crête [Fri, 25 Apr 2014 01:27:29 +0000 (21:27 -0400)]
address: Correctly identify ipv6 link local

The test for fe80::/10 always returned FALSE.

10 years agoadd nice_agent_forget_relays()
Guillaume Desmottes [Tue, 15 Apr 2014 13:57:55 +0000 (15:57 +0200)]
add nice_agent_forget_relays()

10 years agocomponent: Clear turn local candidates when clearing turn servers
Olivier Crête [Wed, 16 Apr 2014 02:52:30 +0000 (22:52 -0400)]
component: Clear turn local candidates when clearing turn servers

But keep the turn connection that's currently being used if it is
the selected candidate. Also clear the TURN candidate refresh.

10 years agoagent: Make the TurnServer structure refcounted
Olivier Crête [Tue, 22 Apr 2014 21:05:57 +0000 (17:05 -0400)]
agent: Make the TurnServer structure refcounted

Instead of just blindling assuming that all of the pointers are valid
until the end.

10 years agodiscovery: Use g_slist_free_full for candidate refresh list
Olivier Crête [Tue, 22 Apr 2014 21:10:28 +0000 (17:10 -0400)]
discovery: Use g_slist_free_full for candidate refresh list

10 years agodiscovery: Use g_slist_free_full for discovery list
Olivier Crête [Tue, 22 Apr 2014 21:03:03 +0000 (17:03 -0400)]
discovery: Use g_slist_free_full for discovery list

10 years agodiscovery: Remove never used and leaked msn_turn_* fields in CandidateDiscovery
Olivier Crête [Tue, 22 Apr 2014 20:47:36 +0000 (16:47 -0400)]
discovery: Remove never used and leaked msn_turn_* fields in CandidateDiscovery

10 years agodiscovery: Remove never used and leaked msn_turn_* fields in CandidateRefresh
Olivier Crête [Tue, 22 Apr 2014 20:47:36 +0000 (16:47 -0400)]
discovery: Remove never used and leaked msn_turn_* fields in CandidateRefresh

10 years agoagent: Factor out creating the TurnServer structure
Olivier Crête [Tue, 22 Apr 2014 20:25:26 +0000 (16:25 -0400)]
agent: Factor out creating the TurnServer structure

10 years agodiscovery: Remove duplicated element between CandidateRefresh and NiceCandidate
Olivier Crête [Tue, 22 Apr 2014 20:13:52 +0000 (16:13 -0400)]
discovery: Remove duplicated element between CandidateRefresh and NiceCandidate

10 years agodiscovery: Store NiceCandidate in CandidateRefresh
Olivier Crête [Tue, 22 Apr 2014 20:02:32 +0000 (16:02 -0400)]
discovery: Store NiceCandidate in CandidateRefresh

10 years agocomponent: Make detach_source close the socket
Olivier Crête [Wed, 16 Apr 2014 02:44:52 +0000 (22:44 -0400)]
component: Make detach_source close the socket

10 years agocomponent: Make is possible to remove a socket
Olivier Crête [Wed, 16 Apr 2014 02:21:07 +0000 (22:21 -0400)]
component: Make is possible to remove a socket

Change the SocketSource handling to make it possible
to remove a source, not only to add one.

10 years agofactor out: component_clean_turn_servers()
Guillaume Desmottes [Tue, 15 Apr 2014 13:50:39 +0000 (15:50 +0200)]
factor out: component_clean_turn_servers()

10 years agostream: No need to pass RNG to stream_restart()
Olivier Crête [Fri, 25 Apr 2014 00:55:17 +0000 (20:55 -0400)]
stream: No need to pass RNG to stream_restart()

It can now take it from the agent.

10 years agoconncheck: Only print debug message if actually freeing something
Olivier Crête [Fri, 25 Apr 2014 00:53:09 +0000 (20:53 -0400)]
conncheck: Only print debug message if actually freeing something

10 years agoconncheck: Don't fail a stream that has on-going discovery
Olivier Crête [Thu, 24 Apr 2014 02:03:29 +0000 (22:03 -0400)]
conncheck: Don't fail a stream that has on-going discovery

10 years agoagent: Add nice_agent_restart_stream() to restart a single stream
Olivier Crête [Wed, 16 Apr 2014 00:19:18 +0000 (20:19 -0400)]
agent: Add nice_agent_restart_stream() to restart a single stream

10 years agostream: Clear connchecks on restart inside stream
Olivier Crête [Wed, 16 Apr 2014 00:14:16 +0000 (20:14 -0400)]
stream: Clear connchecks on restart inside stream

10 years agoconncheck: Use g_slist_free_full() for conncheck list
Olivier Crête [Fri, 25 Apr 2014 00:40:09 +0000 (20:40 -0400)]
conncheck: Use g_slist_free_full() for conncheck list

Skips one iterator over g_slist_foreach() + g_slist_free(). It is also easier
to read.

10 years agoconncheck: Make conn_check_free_item() static
Olivier Crête [Fri, 25 Apr 2014 00:39:20 +0000 (20:39 -0400)]
conncheck: Make conn_check_free_item() static

It is never used outside of this file.

10 years agoconncheck: Only stop conncheck timer if no stream has pending conn checks
Olivier Crête [Fri, 25 Apr 2014 00:33:33 +0000 (20:33 -0400)]
conncheck: Only stop conncheck timer if no stream has pending conn checks

10 years agoconncheck: Remove useless return value on conn_check_prune_stream
Olivier Crête [Fri, 25 Apr 2014 00:31:44 +0000 (20:31 -0400)]
conncheck: Remove useless return value on conn_check_prune_stream

10 years agoconncheck: Factor out stopping connectivity checks
Olivier Crête [Fri, 25 Apr 2014 00:27:38 +0000 (20:27 -0400)]
conncheck: Factor out stopping connectivity checks

10 years agocomponent: Remove return value from *_restart() functions, they can't fail
Olivier Crête [Tue, 15 Apr 2014 23:54:45 +0000 (19:54 -0400)]
component: Remove return value from *_restart() functions, they can't fail

10 years agocomponent: socket has been renamed nicesock
Olivier Crête [Thu, 24 Apr 2014 03:30:34 +0000 (23:30 -0400)]
component: socket has been renamed nicesock

10 years agoAdd more debug info when adding relays
Youness Alaoui [Sat, 19 Apr 2014 01:45:12 +0000 (21:45 -0400)]
Add more debug info when adding relays

10 years agoProtect test-dribble against read->connected->ready state changes
Youness Alaoui [Wed, 16 Apr 2014 22:50:10 +0000 (18:50 -0400)]
Protect test-dribble against read->connected->ready state changes

10 years agoReturn the correct originating IP on TURN
Youness Alaoui [Sat, 19 Apr 2014 04:44:53 +0000 (00:44 -0400)]
Return the correct originating IP on TURN

If doing a recv on UDP-TURN, the 'from' address was kept set to
the turn server which causes connchecks to fail with "mismatched address"
error. This fixes it

10 years agoadd nice_component_state_to_string()
Guillaume Desmottes [Wed, 23 Apr 2014 12:39:59 +0000 (14:39 +0200)]
add nice_component_state_to_string()

Nice to make debug logs more friendly to read.

10 years agopseudotcp: Fix partial acknowledgement of segments
Philip Withnall [Wed, 16 Apr 2014 11:44:32 +0000 (12:44 +0100)]
pseudotcp: Fix partial acknowledgement of segments

If an incoming ACK acknowledges part of a pending SSegment, correctly
increment the base offset of that SSegment before attempting to transmit
it. Otherwise, the wrong data will be transmitted and the offset passed
to packet() will be incorrect.

10 years agopseudotcp: Fix an assertion on an invalid calculated RTT
Philip Withnall [Wed, 16 Apr 2014 11:43:20 +0000 (12:43 +0100)]
pseudotcp: Fix an assertion on an invalid calculated RTT

If a packet has an invalid tsecr field, invalid (e.g. negative) RTTs may
be calculated from it. If so, discard the packet as invalid.

10 years agotests: Add a test-pseudotcp-fuzzy test for fuzzing PseudoTcpSocket
Philip Withnall [Wed, 16 Apr 2014 11:41:47 +0000 (12:41 +0100)]
tests: Add a test-pseudotcp-fuzzy test for fuzzing PseudoTcpSocket

As documented at the top of the file, this creates two PseudoTcpSockets
in a loopback configuration, and mutates the raw packets which are sent
between them, hoping to cause assertion failures and illegal memory
accesses in the pseudotcp code.

Best run under Valgrind or GDB.

10 years agoagent: Fix leaks if a component is removed during a recv() call
Philip Withnall [Wed, 16 Apr 2014 18:09:06 +0000 (19:09 +0100)]
agent: Fix leaks if a component is removed during a recv() call

If the error handling block in the middle of the recv() loop is hit,
various things were previously leaked (context, cancellable_source) and
the return values were potentially incorrect.

Fix the break out of the error handling block to clean up correctly.

10 years agostun: Restore argument type to stun_usage_bind_process(), it's used outside libnice
Olivier Crête [Wed, 16 Apr 2014 03:18:21 +0000 (23:18 -0400)]
stun: Restore argument type to stun_usage_bind_process(), it's used outside libnice

10 years agoagent: Factor out a tiny bit of common code
Philip Withnall [Fri, 14 Mar 2014 09:24:08 +0000 (09:24 +0000)]
agent: Factor out a tiny bit of common code

10 years agoagent: Limit printed length of uname and password in debug output
Philip Withnall [Fri, 14 Mar 2014 09:20:53 +0000 (09:20 +0000)]
agent: Limit printed length of uname and password in debug output

At this point in the code, neither the username nor password are
nul-terminated, so printing them in the debug output as nul-terminated
strings can easily result in rubbish being printed after them.

Fix this by specifying the string length in the printf() format string.
Finally my terminal will no longer ask me to install N’Ko fonts when
running the libnice tests.

10 years agoagent: Fix a leak in nice_output_stream_write() with a NULL cancellable
Philip Withnall [Tue, 15 Apr 2014 17:06:44 +0000 (18:06 +0100)]
agent: Fix a leak in nice_output_stream_write() with a NULL cancellable

If @cancellable is NULL in a call to nice_output_stream_write(), the
WriteData struct is created with a reference count of 4, but only two
operations are scheduled which will result in its reference count being
decremented. The third operation is only scheduled if @cancellable is
non-NULL (and the final reference is dropped unconditionally at the end
of the function).

Fix this by properly implementing reference counting for WriteData,
rather than hard-coding the expected number of references in a fragile
and unmaintainable way.

10 years agotcp-bsd: Don't clear error that hasn't been set
Olivier Crête [Wed, 2 Apr 2014 15:25:27 +0000 (11:25 -0400)]
tcp-bsd: Don't clear error that hasn't been set

10 years agoagent: Don't return the socket to the app in any reliable case
Olivier Crête [Wed, 9 Apr 2014 03:10:34 +0000 (23:10 -0400)]
agent: Don't return the socket to the app in any reliable case

10 years agoNo need to strdup foundation in new_selected_pair since we queue signal
Youness Alaoui [Tue, 8 Apr 2014 01:30:49 +0000 (21:30 -0400)]
No need to strdup foundation in new_selected_pair since we queue signal

10 years agopseudotcp: Also cause Writable callback to be emitted if can_send() says no
Olivier Crête [Wed, 9 Apr 2014 02:43:30 +0000 (22:43 -0400)]
pseudotcp: Also cause Writable callback to be emitted if can_send() says no

The GOutputStream based systems can sometimes call this, decide the stream is
not writable and then poll for it. We have to make sure that poll is woken up.

10 years agoFix TCP TURN for Google compatibility. Message length was sent uninitialized
Youness Alaoui [Fri, 4 Apr 2014 06:43:20 +0000 (02:43 -0400)]
Fix TCP TURN for Google compatibility. Message length was sent uninitialized

10 years agoSmall cleaning of tcp-bsd.c
Youness Alaoui [Tue, 1 Apr 2014 00:36:58 +0000 (20:36 -0400)]
Small cleaning of tcp-bsd.c