summaryrefslogtreecommitdiff
path: root/socket/socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix queue_clear replaced by queue_free errorNicolas Dufresne2018-06-181-1/+2
| | | | | | | | | There was two cases where instead of freeing the queue, we actually clear the queue so it's ready for reused. Notably in nice_socket_free_send_queue(), a missed name function and nicesrc element state change. This regression was introduced by: fa783b1dd727a6ee2b99a111ca24790ae850c2f7
* Fix cast-function-type warning introduced in GCC 8Nicolas Dufresne2018-06-121-4/+3
| | | | | | This is new warning introduced with GCC 8. This is being fixed by using appropriate function, like g_queue_free_full/g_list_free_full or by casting to GCallback before casting to the target function signature. Closes: #46
* socket: refactor nice_socket_is_base_of()Jakub Adam2016-04-041-3/+3
| | | | | | | | | | | | | | • rename to nice_socket_is_based_on() and swap the order of arguments accordingly; the implementation doesn't have to use the confusing 'return other->is_base_of()' pattern anymore • fix potential NULL dereferences The argument order in agent_recv_message_unlocked() was already wrongly swapped in 1732c7d6 and thus this commit isn't changing it back because that order has become the correct one. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D866
* socket: fix wrong function called in nice_socket_is_base_of()Jakub Adam2016-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | We have to call is_base_of "virtual function pointer" of 'other' object, not 'sock', since 'other' is the structure whose base NiceSocket we need to get from its private data. For instance calling nice_socket_is_base_of() with 'sock' and 'other' being respectively pseudo-SSL and UDP-TURN-over-TCP invoked is_base_of variant for pseudo-SSL, casting other->priv into PseudoSSLPriv *, but other->priv is actually TurnTcpPriv *. It must be called the other way around. https://phabricator.freedesktop.org/T7335 https://phabricator.freedesktop.org/T7336 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com> Reviewed-by: Philip Withnall <philip@tecnocode.co.uk> Reviewed-by: José Antonio Santos Cadenas <santoscadenas@gmail.com> Differential Revision: https://phabricator.freedesktop.org/D785
* socket: add nice_socket_is_base_of()Jakub Adam2015-09-111-0/+8
| | | | | | | | 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
* Add a nice_socket_can_send and nice_socket_set_writable_callback APIsYouness Alaoui2014-05-171-0/+16
|
* Add a nice_socket_recv convenience function similar to nice_socket_sendYouness Alaoui2014-05-151-0/+17
|
* Factor out the add_to_be_sent into a helper API for socketsYouness Alaoui2014-05-151-0/+187
| | | | | | The add_to_be_sent was duplicated in http/socks5/pseudossl/tcp-bsd and had some small differences. It's better to factor it out so bug fixes get applied to all of them and code is cleaner.
* Add a nice_socket_send_reliable API for internal use.Youness Alaoui2014-05-151-0/+56
| | | | | | | | | | | | | | 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.
* Remove the "length" parameter from NiceOutputMessageOlivier Crête2014-01-311-2/+1
| | | | It was used correctly only half the time anyway
* Remove the "to" parameter from NiceOutputMessageOlivier Crête2014-01-311-5/+5
| | | | | We never send multiple messages to separate targets in practice, so this will simplify the code
* socket: Add vectored I/O support for sending on socketsPhilip Withnall2014-01-311-4/+59
| | | | | | | | | | | | | | | | | Replace the send() API with a send_messages() API, which supports sending multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceOutputMessage, which is analogous to struct mmsghdr and NiceInputMessage. This includes updates to the test-bsd test to cover the changed API. The existing nice_socket_send() API has been retained as a thin wrapper around nice_socket_send_messages(), for convenience only. It’s hoped that internal usage of this API will decline to the point where it can be removed.
* socket: Add vectored I/O support for receiving on socketsPhilip Withnall2014-01-311-2/+46
| | | | | | | | | | | | Replace the recv() API with a recv_messages() API, which supports receiving multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceInputMessage, which is analogous to struct mmsghdr. This includes updates to the test-bsd test to cover the changed API.
* Fix copyright headers for all filesYouness Alaoui2010-02-161-5/+4
|
* Socket layer refactorising and adding of tcp-bsd, pseudossl, and moved the ↵Youness Alaoui2008-12-081-10/+3
| | | | tcp stuff from tcp-turn and made udp-turn into turn since it's generic
* make nice_socket_send return a boolean so we can know whether or not the ↵Youness Alaoui2008-11-041-2/+2
| | | | send worked
* Add an else to HAVE_CONFIG_H in order to define NICEAPI_EXPORT. Also removed ↵Youness Alaoui2008-11-031-4/+4
| | | | that define from not public functions and removed them from libnice.sym
* remove unnecessary inclusion of socket files in some files, and make glib ↵Youness Alaoui2008-10-281-1/+0
| | | | included before stdlib.h because it redefines atexit
* Add nice_socket_is_reliable to the APIYouness Alaoui2008-10-081-0/+6
|
* Much better NiceSocket API now, no more need for a socket factoryYouness Alaoui2008-10-071-48/+0
|
* new NiceSocket APIYouness Alaoui2008-10-061-15/+52
|
* Renamed udp-generic into socket.cYouness Alaoui2008-10-061-0/+87