summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* agent: Use provided CandidatePair rather than re-finding a pairwip/phab/T3557-non-unique-pair-foundationsPhilip Withnall2016-02-051-4/+7
| | | | | | | | | | | | | | | | | | In priv_update_selected_pair(), commit 57393333 changed the code to re-find a CandidatePair matching the given lfoundation and rfoundation. However, the foundation does not uniquely identify candidate pairs, and if we’re aiming to set a specific candidate pair as the selected pair, this could result in the wrong pair being selected. This can happen when handling multiple similar candidate pairs, such as when generating peer reflexive candidates from multiple sources. See https://tools.ietf.org/html/rfc5245#section-2.4. Originally spotted by Fabrice Bellet in https://phabricator.freedesktop.org/T3557. Differential Revision: https://phabricator.freedesktop.org/D742
* agent: Fix not setting UPnP timeout on second gather_candidates()Mike Ruprecht2016-01-181-3/+3
| | | | | | | | | | | | | | | | If the first call to nice_agent_gather_candidates() partially succeeds (setting a UPnP agent and timeout), then fails before starting gathering, a second call to nice_agent_gather_candidates() would fail to set a new UPnP timeout because the UPnP initialisation block would be skipped. That means gathering would never succeed due to timing out on UPnP. Fix that by setting the UPnP timeout whenever a new pending UPnP mapping is added. https://phabricator.freedesktop.org/T3534 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* configure.ac: Update glib versionJose Antonio Santos Cadenas2015-12-031-2/+2
| | | | | | | | | As udp-bsd.ccode is using G_IO_ERROR_CONNECTION_CLOSED glib 2.44 is required. Change-Id: I1bb63f2484c513c58eeec312ba0835164604c40c Reviewed-by: Philip Withnall <philip@tecnocode.co.uk> https://phabricator.freedesktop.org/T3492
* pseudotcp: Use labs() rather than abs() for handling long integersPhilip Withnall2015-10-211-1/+1
| | | | | | | This fixes a compiler warning and prevents a possible truncation. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D345
* tests: Enable G_MESSAGES_DEBUG for all unit testsPhilip Withnall2015-10-181-0/+4
| | | | | | | | | Now that we’re using automake’s parallel test harness, it automatically redirects all the debug log spew away from the console, so we should always have it enabled. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D292
* build: Set repository callsign in .arcconfigPhilip Withnall2015-10-011-1/+2
| | | | | This fixes `arc diff` to select the right repository when submitting patches.
* agent: Correctly namespace Component and its methodsPhilip Withnall2015-10-0112-261/+235
| | | | | | | | Remove all references to the old, unnamespaced versions. This should cause no functional changes. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D309
* agent: Correctly namespace Stream and its methodsPhilip Withnall2015-10-0112-180/+165
| | | | | | | | Remove all references to the old, unnamespaced versions. This should cause no functional changes. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D308
* agent: Turn Component into a GObjectPhilip Withnall2015-10-012-67/+263
| | | | | | | | | | | | | This makes it reference-counted. This will be useful for allowing GDatagramBased and GIOStream objects to hold references to the stream and component they are interested in, allowing removal of the global NiceAgent lock previously needed to look up the component for every I/O operation. Deprecate all the old methods until it’s properly namespaced. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D307
* agent: Turn Stream into a GObjectPhilip Withnall2015-10-012-15/+77
| | | | | | | | | | | | | | This makes it reference-counted. This will be useful for allowing GDatagramBased and GIOStream objects to hold references to the stream and component they are interested in, allowing removal of the global NiceAgent lock previously needed to look up the component for every I/O operation. It also means that nice_stream_close() could eventually become asynchronous, which would fix a few race conditions. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D306
* tests: Update expected priority values in test-priorityPhilip Withnall2015-10-011-4/+4
| | | | | | | | | This is a follow up to T3324, to update the test case to match the new values generated. Bug: https://phabricator.freedesktop.org/T3324 Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D301
* tests: Use g_assert_cmpuint() to make test failures easier to diagnosePhilip Withnall2015-10-011-9/+9
| | | | | | | Now we can actually see the priority numbers which are unequal. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D300
* tests: Set candidate addresses in test-priorityPhilip Withnall2015-10-011-1/+4
| | | | | | | | This avoids an assertion failure in nice_address_to_string() when the addresses are compared for priority. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D299
* agent: Remove redundant GLIB_CHECK_VERSION macrosPhilip Withnall2015-10-016-45/+1
| | | | | | | | We depend on GLib 2.36.0, which is a higher version than any of these version checks cared about, so they were all trivially true or false. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D298
* tests: Remove g_thread_init() callsPhilip Withnall2015-10-0118-48/+8
| | | | | | | | We depend on GLib 2.36.0; g_thread_init() has been deprecated since 2.32.0, when thread initialisation was changed to happen automatically. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D297
* tests: Remove g_type_init() callsPhilip Withnall2015-10-0126-40/+0
| | | | | | | | We depend on GLib 2.36.0, which deprecated g_type_init() since GType initialisation is now done automatically. Reviewed-by: Olivier Crête <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D296
* conncheck: rename priv_process_response_check_for_peer_reflexive()Jakub Adam2015-09-111-3/+3
| | | | | | | | | | | | Renamed the function to priv_process_response_check_for_reflexive() because it now checks also for server reflexive candidates. Updated the documentation to indicate that the function never returns NULL. Maniphest Tasks: https://phabricator.freedesktop.org/T115 Differential Revision: https://phabricator.freedesktop.org/D243 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* conncheck: generate candidate pair for valid srflx candidateJakub Adam2015-09-111-14/+16
| | | | | | | | | | | | | | | | | | In priv_process_response_check_for_peer_reflexive(), mere presence of a candidate in local_candidates doesn't mean there's also some candidate pair in conncheck_list using it - for instance that candidate may be server reflexive, for which no check pairs are initially created (see conn_check_add_for_candidate_pair()). If we fail to find corresponding pair upon receiving such candidate's IP in a conncheck response's XOR-MAPPED-ADDRESS attribute, we shall add a new one in a similar way we would add a new pair for a just discovered peer reflexive candidate. Previous priv_process_response_check_for_peer_reflexive() implementation would return NULL, causing a CandidateCheckPair with local candidate of type HOST to be wrongly selected even though the local host IP might not be directly accessible by the remote counterpart (e.g. it's an address on a private network segment). In practice this was coming through as a duplex connection that libnice was reporting as properly established, but only one direction of the communication was actually working. Maniphest Tasks: https://phabricator.freedesktop.org/T115 Differential Revision: https://phabricator.freedesktop.org/D242 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* agent: check for base socket in _tcp_sock_is_writable()Jakub Adam2015-09-111-1/+1
| | | | | | | | | | | The argument passed into the callback is always a base (TCP/UDP) socket, which can't be directly compared with local candidate's sockptr (may be TURN, http, or other socket wrapping another one). We're in fact interested whether sock is a base socket of sockptr. Maniphest Tasks: T114 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D241
* socket: add nice_socket_is_base_of()Jakub Adam2015-09-117-0/+74
| | | | | | | | This will be used in the next commit. Maniphest Tasks: T114 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D240
* build: Bump GLib dependency to 2.36Philip Withnall2015-09-041-2/+2
| | | | | | | This is needed for G_IO_ERROR_BROKEN_PIPE, which is used in the I/O stream code. Reported by Emanuele Bizzarri <emabiz76@gmail.com> on the mailing list.
* stun: Disable debug by defaultPhilip Withnall2015-09-041-1/+1
| | | | | | | To match debug_enable in agent/debug.c. Debug can still be enabled by calling stun_debug_enable() or nice_debug_enable(). Spotted on the mailing list by Tom Chen.
* agent: Add assertions to check component state transitions are validPhilip Withnall2015-09-035-19/+119
| | | | | | | | There is no point in the NiceComponents having a state machine if the state transition graph is not documented or enforced. Document and enforce it. http://phabricator.freedesktop.org/T120
* ms-ice: ensure distinct candidate priority for multihomed hostsPhilip Withnall2015-09-023-17/+57
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Offering multiple host candidates with equal priorities could lead to unpredictable candidate pair selection by our counterparty. Fixes call disconnection by MS Lync client after 30 seconds while VPN (2nd IP) was active on libnice host. Maniphest Tasks: T3324 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D234
| * candidate: use distinct priority also for non-MS compatibilitiesJakub Adam2015-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Maniphest Tasks: T3324 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Differential Revision: https://phabricator.freedesktop.org/D239
| * conncheck: give temporary candidate_priority a base_addrJakub Adam2015-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes "(nice_address_to_string): should not be reached" errors when calling nice_candidate_ms_ice_priority() because of invalid NiceAddress. Maniphest Tasks: T3324 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D238
| * ms-ice: ensure distinct candidate priority for multihomed hostsJakub Adam2015-09-021-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Offering multiple host candidates with equal priorities could lead to unpredictable candidate pair selection by our counterparty. Fixes call disconnection by MS Lync client after 30 seconds while VPN (2nd IP) was active on libnice host. Maniphest Tasks: T3324 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D234
| * discovery: assign candidate priority after base_addr is setJakub Adam2015-09-021-15/+15
|/ | | | | | | | | | | | | | | | Summary: So that we can take the base address into account in the calculation. Maniphest Tasks: T3324 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D235
* ms-turn: don't wait for a reply to STUN_SEND requestPhilip Withnall2015-09-022-3/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Maniphest Tasks: T126 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D223
| * ms-turn: don't wait for a reply to STUN_SEND requestJakub Adam2015-09-022-3/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | As per [MS-TURN] Section 2.2.1, TURN message type 0x0104 "Send request response" isn't supported and the TURN server MUST NOT send them. Thus, libnice should not remember Send requests in agent->sent_ids because without replies coming, the number of allowed pending transaction gets quickly exhausted, causing our data packets to be dropped until a request timeout frees some space in the queue. This behavior resulted in choppy reception of our audio on a Lync client when connected via Lync Edge (TURN) Server. Maniphest Tasks: T126 Reviewers: pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall Differential Revision: https://phabricator.freedesktop.org/D223
* Creating TCP sockets with TCP_NODELAY option set to TRUEPhilip Withnall2015-08-293-0/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Disable Nagling for underlying TCP sockets used by libnice, because they are typically used for streaming applications, or for pseudo-TCP; the bandwidth in both cases is harmed by Nagling. Based on a patch by Vadim Genkin. Maniphest Tasks: T3317 Reviewers: vadimgenkin, pwithnall Projects: #libnice Reviewed By: pwithnall Subscribers: pwithnall, vadimgenkin Differential Revision: https://phabricator.freedesktop.org/D230
| * Creating TCP sockets with TCP_NODELAY option set to TRUEPhilip Withnall2015-08-293-0/+24
|/ | | | | | | | | | | | | | | | | | Disable Nagling for underlying TCP sockets used by libnice, because they are typically used for streaming applications, or for pseudo-TCP; the bandwidth in both cases is harmed by Nagling. Based on a patch by Vadim Genkin. Maniphest Tasks: T3317 Reviewers: pwithnall Projects: #libnice Subscribers: pwithnall, vadimgenkin Differential Revision: https://phabricator.freedesktop.org/D230
* Fix agent leak in case component socket is reset remotelyPhilip Withnall2015-08-291-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch fixes the issue where agent reference count is not properly decremented causing instance leak in cases where component's socket is reset remotely. Reviewers: #libnice, pwithnall Projects: #libnice Reviewed By: #libnice, pwithnall Subscribers: pwithnall, maximgolunov Differential Revision: https://phabricator.freedesktop.org/D236
| * Fix agent leak in case component socket is reset remotelyPhilip Withnall2015-08-291-1/+2
|/ | | | | | | | | | | | | | Summary: The patch fixes the issue where agent reference count is not properly decremented causing instance leak in cases where component's socket is reset remotely. Reviewers: #libnice, pwithnall Projects: #libnice Reviewed By: #libnice, pwithnall Subscribers: pwithnall, maximgolunov Differential Revision: https://phabricator.freedesktop.org/D236
* build: Update .gitignorePhilip Withnall2015-08-191-0/+1
| | | | Add stun/usages/.dirstamp.
* build: Fix multiple definition of CLEANFILESPhilip Withnall2015-08-191-1/+1
| | | | It’s already defined in common.mk.
* build: Add .arcconfig filePhilip Withnall2015-08-191-0/+5
| | | | | | | This completes the transition to Phabricator; everyone should be using the same project settings now. https://phabricator.freedesktop.org/tag/libnice/
* socket: Handle ECONNRESET as EWOULDBLOCK on WindowsPhilip Withnall2015-08-191-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some versions of Windows can return ECONNRESET for UDP recvmsg() calls if they would otherwise block. Hence, handle the two equivalently; this should not affect behaviour on Linux, which apparently does not return ECONNRESET for UDP recvmsg() calls at all. https://phabricator.freedesktop.org/T121 Maniphest Tasks: T121 Reviewers: ocrete Projects: #libnice Reviewed By: ocrete Subscribers: stwiname, felixSchl Differential Revision: https://phabricator.freedesktop.org/D227
| * socket: Handle ECONNRESET as EWOULDBLOCK on WindowsPhilip Withnall2015-08-181-1/+4
| | | | | | | | | | | | | | | | | | Some versions of Windows can return ECONNRESET for UDP recvmsg() calls if they would otherwise block. Hence, handle the two equivalently; this should not affect behaviour on Linux, which apparently does not return ECONNRESET for UDP recvmsg() calls at all. https://phabricator.freedesktop.org/T121
* | socket: Close base socket for a TCP passive socket when closing parentPhilip Withnall2015-08-191-0/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Otherwise the base socket will leak. Spotted by Vadim Genkin. https://phabricator.freedesktop.org/T125 Maniphest Tasks: T125 Reviewers: ocrete Projects: #libnice Reviewed By: ocrete Subscribers: vadimgenkin Differential Revision: https://phabricator.freedesktop.org/D228
| * | socket: Close base socket for a TCP passive socket when closing parentPhilip Withnall2015-08-181-0/+6
|/ / | | | | | | | | | | Otherwise the base socket will leak. Spotted by Vadim Genkin. https://phabricator.freedesktop.org/T125
* | agent: Remove unused inet_pton() functionPhilip Withnall2015-08-181-31/+0
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Summary: As spotted by Felix <felixschlitter@gmail.com>. This is a static function which is totally unused in this compilation unit and is causing build failures with `-Werror=unused-function`. Maniphest Tasks: T123 Reviewers: felixSchl, ocrete Projects: #libnice Differential Revision: https://phabricator.freedesktop.org/D221
| * agent: Remove unused inet_pton() functionPhilip Withnall2015-08-181-31/+0
|/ | | | | | | | As spotted by Felix <felixschlitter@gmail.com>. This is a static function which is totally unused in this compilation unit and is causing build failures with -Werror=unused-function. http://phabricator.freedesktop.org/T123
* conncheck: set writable callback to socket from TCP active connectJakub Adam2015-07-033-1/+9
| | | | | | | | | | | | | | | | | A new socket created in nice_tcp_active_socket_connect() should have its writable callback set, because it's possible for it to become a base socket of a peer reflexive candidate, if some is discovered by connection checks on that TCP active candidate. Previously, when such prflx candidate became selected, without write_cb on the socket the agent was never notified about it becoming writable again after the socket's buffer got filled up. This caused the data flow to hang permanently. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Olivier Crête <olivier.crete@collabora.com> http://phabricator.freedesktop.org/T117
* pseudotcp: Only define errnos on Windows if not already definedPhilip Withnall2015-07-011-0/+12
| | | | | | | | | | | | | | Recent versions of MinGW define at least ECONNABORTED and EAFNOSUPPORT, so only define the various socket errnos if they are not defined already. Based on a patch by Alexey Pawlow <alexey.pawlow@gmail.com> and Felix <felixschlitter@gmail.com>. Reviewed-by: Olivier Crete <olivier.crete@collabora.com> Reviewed-by: Felix Schlitter <felixschlitter@gmail.com> http://phabricator.freedesktop.org/T122
* Use G_GSIZE_FORMAT instead of %zuFelix Schlitter2015-06-301-1/+1
| | | | | | | | | The C runtime on windows does not implement a printf that understands %zu and other C99 format specifiers. Use G_GSIZE_FORMAT instead. This is further consistent with the rest of the code base that makes use of G_GSIZE_FORMAT throughout. https://github.com/libnice/libnice/pull/3
* Split "verbose" on-every-packet messages to a verbose logOlivier Crête2015-06-244-30/+56
| | | | This way, the regular log will only contain connection-time information.
* stun: Remove annoying non-error on non-STUN packetOlivier Crête2015-06-241-1/+0
|
* configure: Fix configure failure when building without gstreamer supportTimo Gurr2015-06-011-3/+1
| | | | | | | | | | Error introduced in 20ea22e0a11a9bdfe4d8125b68083249b694338a, resulting in a configure/build error when building without gstreamer: configure: error: conditional "HAVE_GST_CHECK" was never defined. Usually this means the macro was only invoked conditionally. https://bugs.freedesktop.org/show_bug.cgi?id=90801
* build: Auto-generate win32 .def file from libnice.symPhilip Withnall2015-05-083-137/+18
| | | | | | | | | We’ve neglected to manually update this file once too often — it’s been out of date for important new symbols (for example, nice_agent_get_io_stream()) since at least 0.1.11. Since the format is a simple extension of libnice.sym, we might as well automatically generate it at dist time.