summaryrefslogtreecommitdiff
path: root/libsoup/soup-socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Always use G_PARAM_STATIC_STRINGSNiels De Graef2020-01-131-18/+36
| | | | This prevents some unnecessary string copies and a tiny bit of memory.
* socket: Remove soup_socket_is_readable()Michael Catanzaro2019-02-251-11/+0
| | | | | I removed the only usage of this function in b609d44e so time for it to go.
* soup-socket: fix critical warning when the peer-certificate changes after ↵Carlos Garcia Campos2018-04-201-0/+1
| | | | | | | | | disconnect (process:15586): GLib-GIO-CRITICAL **: 12:14:39.627: g_tls_connection_get_peer_certificate_errors: assertion 'G_IS_TLS_CONNECTION (conn)' failed We should disconnect the signal on disconnect_internal before clearing the connection object.
* Port more classes to the new private apiIgnacio Casal Quinteiro2016-12-031-50/+67
| | | | | Now only SoupMessage is missing since the private from this class is accessed from other classes.
* Use Unicode in translatable stringsPiotr Drąg2016-10-271-2/+2
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772217
* Add soup_socket_listen_full() internal API which returns an errorStef Walter2016-04-251-3/+20
| | | | | | | The fact that soup_socket_listen() doesn't return a proper error masks real failure modes. https://bugzilla.gnome.org/show_bug.cgi?id=764057
* libsoup: Remove unnecessary break statementSaurav Babu2015-06-251-1/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=751421
* soup-socket: remove close-on-disposeDan Winship2015-03-021-17/+18
| | | | | | | | | | Setting close-on-dispose=FALSE on a socket would cause it to leak its GSocket. Indeed, there is no way to avoid this, since freeing the GSocket will always close it. Work around the problem in a different way by having the steal() methods steal the GSocket from the SoupSocket, and ensure that it gets freed later along with the stolen GIOStream.
* SoupSocket: if :use-thread-context, hold a ref on itDan Winship2015-02-281-13/+18
| | | | | | | | | If :use-thread-context is set on a socket, then hold a ref on the thread-default GMainContext for the life of the socket. In particular, this fixes a race condition in the test-utils server code that sometimes shows up in context-test. https://bugzilla.gnome.org/show_bug.cgi?id=744862
* soup-connection: remove usage of GSocket directlyMarc-André Lureau2015-02-211-0/+11
| | | | | | | | Not strictly required since it's client-side code, but potentially SoupSocket could not have GSocket anymore, and it seems better to use more abstract pollable stream methods. https://bugzilla.gnome.org/show_bug.cgi?id=744186
* soup-socket: fix disconnecting with iostream based socketsMarc-André Lureau2015-02-211-3/+5
| | | | | | | Rely on priv->conn to decide whether to call disconnect_internal() or not. https://bugzilla.gnome.org/show_bug.cgi?id=744186
* soup-socket: add GIOStream based SoupSocket supportMarc-André Lureau2015-02-211-7/+28
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744186
* SoupConnection: fix connection in TLS_HANDSHAKING event signalDan Winship2014-11-231-6/+26
| | | | | | | | | | | | | | | | | | SoupConnection was generating its own :event signals for TLS_HANDSHAKING/TLS_HANDSHAKED, since we don't use GSocketClient's TLS negotiation, and so just re-emitting the socket client signal won't cover that. However, it ended up emitting it before the SoupSocket had even created the GTlsClientConnection, and so was emitting it with the GTcpConnection, contrary to the documentation. Fix this by making the SoupSocket generate those event signals at the correct time, and having SoupConnection just re-emit them. Also, add code to connection-test to verify that each even is emitted with the expected kind of GIOStream. https://bugzilla.gnome.org/show_bug.cgi?id=739951
* Add missing array annotations for binary dataEvan Nemerson2014-11-231-3/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=729987
* Pop the thread default main context not from the callback but from where it ↵Sebastian Dröge2014-05-071-4/+3
| | | | | | | | | was pushed Based on a patch by Dmitry Shatrov <shatrov@gmail.com>, see http://mail.gnome.org/archives/libsoup-list/2011-November/msg00000.html https://bugzilla.gnome.org/show_bug.cgi?id=729737
* Add tls-interaction property to SoupSessionDan Winship2014-05-031-0/+14
| | | | | | | | | | | | This can be used by applications to do client-side certificates via the new g_tls_interaction_request_certificate(). Will be used by OSTree at least. Also add a test to tls-test. Based on a patch from Colin Walters. https://bugzilla.gnome.org/show_bug.cgi?id=334021
* soup-server: add new-and-improved APIsDan Winship2014-05-021-0/+26
| | | | | | | | | | Add new APIs to SoupServer, allowing multiple listening sockets on a server, and listening on an existing fd or GSocket, and with better error handling. https://bugzilla.gnome.org/show_bug.cgi?id=522519 https://bugzilla.gnome.org/show_bug.cgi?id=561547 https://bugzilla.gnome.org/show_bug.cgi?id=621138
* soup-socket: add properties to create a SoupSocket from an fd or GSocketDan Winship2014-05-021-15/+127
|
* soup-socket: add flag close_on_dispose to SoupSocketDirkjan Ochtman2014-05-021-1/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=721343
* soup-socket: Add SoupSocketProperties to transfer props from session to socketDan Winship2014-05-021-23/+38
| | | | | | There are a large number of SoupSession properties that need to be propagated through the SoupConnection to the SoupSocket. Wrap them all up into a single struct for ease of carrying.
* Add soup-socket-private.hDan Winship2014-05-021-1/+1
| | | | | SoupSocket-related stuff made up more than half of soup-misc-private.h. Split it out into its own header.
* soup-socket: fixed leak in new_socket_client()Slava Monich2014-03-161-2/+7
|
* SoupSocket: set TCP_NODELAY on socketsDan Winship2013-12-101-0/+1
| | | | | | | The old SoupSocket did this but it accidentally got removed in the GSocket port because I thought it didn't matter. It does. Noticed by Andy Wingo.
* socket: Don't leak GTasksChristophe Fergeau2013-11-041-0/+3
| | | | | | | | GTask needs to be unreffed after calling g_task_return_* when we don't use async methods which take ownership of it (as g_task_run_in_thread() does). https://bugzilla.gnome.org/show_bug.cgi?id=711085
* SoupConnection: make methods gio-likeDan Winship2013-10-191-54/+117
| | | | | | | Port the SoupConnection methods to be gio-like, using GAsyncReadyCallback for the async ones, and returning GErrors rather than libsoup status codes. Add internal-gio-like SoupSocket connect methods for the SoupConnection methods to use.
* SoupSocket: make handshaking methods gio-likeDan Winship2013-10-191-78/+77
| | | | and update SoupConnection to use them
* use libfffi-based generic marshaller instead of glib-genmarshalOlivier Blin2013-06-081-5/+4
| | | | | | | g_cclosure_marshal_generic() is the default signal handler starting from glib 2.29.12. libsoup already requires glib 2.33.1. https://bugzilla.gnome.org/show_bug.cgi?id=686042
* soup-socket: fix another leak in soup_socket_get_http_proxy_uri()Dan Winship2013-06-081-1/+4
| | | | | | | Add a test for the leak in bug 700472, which also turned up another leak. https://bugzilla.gnome.org/show_bug.cgi?id=700472
* soup-socket: fix a memory leakRichard Röjfors2013-05-211-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=700472
* Fix build on Windows, deprecate soup-portability.hDan Winship2013-04-191-0/+2
| | | | | | | | | | | | | | | | | | soup-portability.h created portability problems (ha!) because the windows headers do "#define interface struct", conflicting with variable names elsewhere. The only thing that needed soup-portability.h in the public headers was soup-address.h, which uses struct sockaddr. But we can just do a forward declaration of that type rather than actually pulling in the headers. Then soup-address.h can stop including soup-portability.h, and we can use gio/gnetworking.h in the handful of other places that need networking-related includes. This may possibly break some other modules that depended on implicitly getting network includes as a side effect of including soup.h... https://bugzilla.gnome.org/show_bug.cgi?id=692134
* Add SoupSession:proxy-resolverDan Winship2013-03-071-14/+17
| | | | | | | | | | | | | Now that GSocketClient lets you override its proxy resolver, allow setting a GProxyResolver on a SoupSession, to eventually pass on to the GSocketClient. (In the interest of not breaking things this late in the release cycle, all of the old SoupProxyURIResolver code still exists as well, in parallel, but in 2.43 it will be removed and replaced with GProxyResolver-based backward-compat stuff.) https://bugzilla.gnome.org/show_bug.cgi?id=680273
* Internal renamings for clarityDan Winship2013-02-161-6/+6
| | | | | | | | | | The GSocketClient::event signal gets proxied from GSocketClient to SoupSocket to SoupConnection to SoupSession to SoupMessage (!) via signal handlers that used to have "proxy" in their names. But that made it sound like they had something to do with network proxies. So rename them all (to "re_emit"). https://bugzilla.gnome.org/show_bug.cgi?id=680273
* SoupSocket: Use the local socket, when available, even on client side.Jonh Wendell2013-02-061-0/+3
| | | | This allows binding the client connection to a specific local address.
* SoupSocket: Move the creation of socket clients to a single placeJonh Wendell2013-02-061-18/+20
| | | | Thus avoiding duplication of code in sync and async functions.
* docs: Lots of minor fixes and additionsDan Winship2012-12-271-0/+11
|
* Add per-version deprecation/availability warningsDan Winship2012-11-081-2/+2
| | | | | | | | | | | Add SOUP_VERSION_X_XX, SOUP_VERSION_MIN_REQUIRED, and SOUP_VERSION_MAX_ALLOWED, to enable version-based warnings. Tag all functions with appropriate SOUP_AVAILABLE_IN_ and SOUP_DEPRECATED_IN_ macros. Also, fix up some "Since" tags to not refer to unstable releases or non-.0 point releases.
* Make it possibe to request the boundary be discarded by SoupFilterInputStreamGustavo Noronha Silva2012-08-201-1/+1
| | | | | | | This makes it easier to implement streams that discard the boundary, like SoupMultipartInputStream. https://bugzilla.gnome.org/show_bug.cgi?id=656684
* valgrindageDan Winship2012-08-111-1/+3
|
* soup-socket.c: fix a use-after-free of a GCancellableDan Winship2012-08-061-1/+2
|
* SoupSocket: local, remote address are undefined if unconnectedSimon McVittie2012-08-061-2/+32
| | | | | | | | Warn and return NULL deterministically, rather than warning and returning uninitialized stack garbage, but document it as "undefined"; these methods were never meant to be valid in this situation, apparently. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=673083
* SoupSocket: don't emit "readable" on disconnect for blocking socketsDan Winship2012-07-191-2/+4
| | | | | | | | | | | | "readable" and "writable" are only supposed to be emitted for non-blocking sockets, but we were emitting "readable" on disconnect for all sockets. In libsoup 2.38 and earlier, this could cause a crash if a message in a SoupSessionSync failed at certain points, since the code wasn't expecting to end up in io_read(). The current code no longer has this problem (since soup-message-io no longer uses the SoupSocket signals), but other external users of SoupSocket might.
* Clean up includesDan Winship2012-07-131-8/+1
| | | | | | | | Especially, include soup.h rather than individually including a bunch of other public soup-*.h files. Remove unnecessary system includes (many are leftovers from code that has moved down into glib).
* Reorganize files to need fewer forward declarationsDan Winship2012-07-131-136/+131
| | | | | Also, prefix virtual method implementation names with the class name, to be consistent with other code.
* Use g_clear_object(), g_clear_pointer()Dan Winship2012-07-131-6/+3
|
* Reorganize proxy resolution, and support SOCKS and other proxy typesDan Winship2012-04-281-0/+44
| | | | | | | | | | Push the proxy resolution code from SoupSession down into SoupConnection and SoupSocket. If using a SoupProxyResolverDefault, just enable proxy support on the GSocketClient instead (after adding "http" as an application protocol). This way we get support for SOCKS proxies (and any other proxies supported by GProxy types). https://bugzilla.gnome.org/show_bug.cgi?id=553269
* Move SoupSocket stuff out of soup-message-io.cDan Winship2012-04-281-40/+29
| | | | | | Add a new SoupIOStream, which wraps the SoupFilterInputStream and GOutputStream that SoupSocket exposes. Pass that to soup-message-io rather than the SoupSocket, and update various other things for this.
* soup-message-io: use gio streams rather than SoupSocketDan Winship2012-04-171-2/+16
| | | | | | | | | | | Use the socket's input/output streams for the base I/O, and add new SoupBodyInputStream and SoupBodyOutputStream that can be created from them to handle the body of a single message (including handling chunked encoding/decoding). Update chunk-test, which was assuming that the chunk_allocator callback would never be called if the message had a 0-length body; that's no longer true.
* Add SoupFilterInputStreamDan Winship2012-04-171-102/+61
| | | | | | | | SoupFilterInputStream is basically a subset of GDataInputStream, plus non-blocking read_line()/read_until(). Wrap the existing socket istream member with a SoupFilterInputStream, and use its buffering rather than doing the buffering in SoupSocket.
* Fix some problems with cancelling an async socket connect opDan Winship2012-04-021-8/+19
| | | | | | | | | Cancelling a message while it was still connecting could result in an (erroneous) warning about "disposing socket while still connected", or an (accurate) warning about passing NULL to g_tls_connection_handshake_finish(). Fix both of these. Pointed out on the mailing list by Sven Neumann.
* Use Makefile.glibDan Winship2012-02-081-4/+4
| | | | | Test drive Makefile.glib from bug 654395 (excepted distributed with the tarball rather than using one installed with glib).