summaryrefslogtreecommitdiff
path: root/socket/http.c
Commit message (Collapse)AuthorAgeFilesLines
* socket: Assert trying to use free'd socketOlivier Crête2016-06-021-6/+4
| | | | | Cleanly returnign makes no sense and may hide worse problems.
* socket: refactor nice_socket_is_base_of()Jakub Adam2016-04-041-5/+6
| | | | | | | | | | | | | | • 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: add nice_socket_is_base_of()Jakub Adam2015-09-111-0/+10
| | | | | | | | 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
* socket: Return early from socket functions if the socket is closedPhilip Withnall2014-09-021-0/+9
| | | | | | | | Explicitly check whether the socket is closed (universally represented as sock->priv == NULL) before doing anything else in the socket methods. This should safely return from unusual situations where the socket has been closed and part-destroyed but still ends up having send() or recv() called on it.
* Add a nice_socket_can_send and nice_socket_set_writable_callback APIsYouness Alaoui2014-05-171-0/+22
|
* Factor out the add_to_be_sent into a helper API for socketsYouness Alaoui2014-05-151-75/+5
| | | | | | 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-3/+30
| | | | | | | | | | | | | | 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.
* Allow tcp-bsd to act as reliable or non reliable transport and fix ↵Youness Alaoui2014-05-151-1/+3
| | | | is_reliable on other sockets
* Add a socket type for socket layerYouness Alaoui2014-05-151-1/+1
|
* Remove the "length" parameter from NiceOutputMessageOlivier Crête2014-01-311-6/+5
| | | | It was used correctly only half the time anyway
* Remove the "to" parameter from NiceOutputMessageOlivier Crête2014-01-311-15/+14
| | | | | 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-26/+62
| | | | | | | | | | | | | | | | | 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-82/+287
| | | | | | | | | | | | 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.
* socket: Add missing switch casesPhilip Withnall2014-01-311-0/+1
| | | | | | | | This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
* Fix variable shadowingPhilip Withnall2013-12-181-7/+7
|
* Return real origin when using a proxy (fixes detecting TURN sockets)Youness Alaoui2012-02-131-1/+4
| | | | | | If using a proxy, the 'from' of all packets were of the proxy server instead of the turn server, causing the check for turn to fail. Thanks to Madaro Livio.
* Adding HTTP proxy supportYouness Alaoui2008-12-191-0/+411