summaryrefslogtreecommitdiff
path: root/libsoup/soup-misc.h
Commit message (Collapse)AuthorAgeFilesLines
* session: make message queue handling thread safeCarlos Garcia Campos2022-06-081-0/+1
| | | | | Ensure that queue items are only processed in the same thread they were created.
* logger: handle all possible HTTP versions in SoupHTTPVersionPatrick Griffis2021-05-091-0/+2
|
* Stop using emacs indent-tabs-modeCarlos Garcia Campos2021-03-181-1/+1
| | | | We prefer spaces now instead of tabs.
* Replace SoupURI with GUriPatrick Griffis2020-11-141-6/+0
|
* Minor header reorganizationPatrick Griffis2020-11-131-5/+4
|
* Change soup_add_completion() to not return a GSourcePatrick Griffis2020-11-131-1/+1
| | | | This was an unref'd source that confused some static analysis.
* misc: Remove unused functionsPatrick Griffis2020-11-131-8/+0
|
* Delete SoupAddressPatrick Griffis2020-09-191-2/+0
|
* Move accept_languages_from_system() to soup-miscPatrick Griffis2020-09-191-0/+2
|
* Make more APIs privatePatrick Griffis2020-09-191-20/+39
|
* Reorganize source treePatrick Griffis2020-09-191-3/+1
|
* Do not include the header exclusion guards in the introspectionCorentin Noël2018-06-131-3/+3
|
* Mark all remaining methods with SOUP_AVAILABLE_IN_2_4Ignacio Casal Quinteiro2015-11-091-3/+9
| | | | | | | | This way we can as well redefine _SOUP_EXTERN on msvc builds with the right extern value needed for it. This is the same we do on glib and gtk+ https://bugzilla.gnome.org/show_bug.cgi?id=757146
* Add per-version deprecation/availability warningsDan Winship2012-11-081-1/+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.
* Use GTlsDatabase, add new SoupSession properties for itDan Winship2011-09-291-10/+1
| | | | | | | | | | Now that we have GTlsFileDatabase, we can use that to validate certificates when the caller sets SoupSession:ssl-ca-file, rather than doing it the slow hacky way we had been. Also, add two new properties, SoupSession:tlsdb, to set an arbitrary GTlsDatabase on the session, and SoupSession:use-system-ca-file, to tell it to use the default GTlsDatabase.
* soup-gnutls: return SOUP_SSL_ERROR, not G_IO_ERROR, on handshake failureDan Winship2010-05-221-1/+2
| | | | Part of https://bugzilla.gnome.org/show_bug.cgi?id=615535
* Add macros for checking character classes. Eg, soup_char_is_token()Dan Winship2010-04-091-0/+15
| | | | | | Move the existing URI character class table from soup-uri.c to soup-misc.c, and update for that. Also add soup_char_is_token(), to determine if a character can be used in a token or not.
* Changes to SoupConnection and SoupSession for debuggingDan Winship2009-11-221-0/+9
| | | | | | | | Specifically, to help epiphany's soup-fly extension track connection usage. Patch from José Millán Soto, https://bugzilla.gnome.org/show_bug.cgi?id=598163
* _SOUP_ATOMIC_INTERN_STRING: cast result to (const char *)Dan Winship2009-09-111-1/+1
| | | | http://bugzilla.gnome.org/show_bug.cgi?id=594508
* Re-fix _SOUP_ATOMIC_INTERN_STRING to not cause strict-aliasing warningsDan Winship2009-07-311-1/+1
| | | | http://bugzilla.gnome.org/show_bug.cgi?id=588771
* Fix the SOUP_METHOD_* and SOUP_URI_SCHEME_* defines to be threadsafeDan Winship2009-07-021-0/+2
| | | | Also fix/optimize a few other things in URI scheme canonicalization
* libsoup/soup-auth-manager-ntlm.c libsoup/soup-auth-manager.cDan Winship2008-09-261-1/+1
| | | | | | | | | | | | | | | | | | * libsoup/soup-auth-manager-ntlm.c * libsoup/soup-auth-manager.c * libsoup/soup-cookie-jar.c * libsoup/soup-dns.c * libsoup/soup-logger.c: * libsoup/soup-message-body.h: * libsoup/soup-message.h * libsoup/soup-misc.h: * libsoup/soup-xmlrpc.h: * tests/continue-test.c: * tests/ntlm-test.c: Fix warnings pointed out by gcc -pedantic. #553976, Sander Dijkhuis. svn path=/trunk/; revision=1167
* Add this to schedule a callback in a GMainContext "right away", as opposedDan Winship2008-07-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-misc.c (soup_add_completion): Add this to schedule a callback in a GMainContext "right away", as opposed to soup_add_idle(), which uses a lower priority and therefore may not end up calling the callback for a long time if the application is busy with I/O. #536676, Benjamin Otte. * libsoup/soup-dns.c (resolver_thread, async_cancel) (soup_dns_lookup_resolve_async): * libsoup/soup-message-io.c (soup_message_io_unpause): * libsoup/soup-session-sync.c (queue_message_thread): * libsoup/soup-session-async.c (do_idle_run_queue): * libsoup/soup-socket.c (async_cancel) (soup_socket_connect_async): * tests/test-utils.c (test_server_shutdown): Use soup_add_completion() rather than soup_add_idle(). * docs/reference/libsoup-2.4-sections.txt: add soup_add_completion svn path=/trunk/; revision=1147
* remove prototype for soup_signal_connect_once, which is only used byDan Winship2008-02-091-5/+2
| | | | | | | | | | | * libsoup/soup-misc.h: remove prototype for soup_signal_connect_once, which is only used by soup-connection now, and will go away once that code is rewritten. * libsoup/soup-connection.c: prototype it here now (the definition is still in soup-misc.c) svn path=/trunk/; revision=1081
* mark the DES magic number arrays constDan Winship2008-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-auth-manager-ntlm.c: mark the DES magic number arrays const * libsoup/soup-date.c (months, days): add an extra "const" to each of these declarations, as one "const" is apparently not enough. (soup_date_to_time_t): remove redundant copy of days_before array. * libsoup/soup-dns.c (soup_dns_init): use g_once_init_enter/leave * libsoup/soup-gnutls.c (soup_ssl_supported) (soup_gnutls_channel_funcs): Mark these const (soup_gnutls_init, init_dh_params): Use g_once_init_enter/leave * libsoup/soup-status.c (reason_phrases): mark this const * tests/ssl-test.c: Remove the workaround for soup_gnutls_init() not being thread-safe, since it is now. svn path=/trunk/; revision=1080
* Merge libsoup-2.4 branch to trunkDan Winship2008-01-151-38/+10
| | | | | | * Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
* add G_BEGIN_DECLS / G_END_DECLS to all installed headers so that libsoupJonathon Jongsma2007-06-011-0/+4
| | | | | | | | | 2007-05-16 Jonathon Jongsma <jjongsma@gnome.org> * libsoup/*.h: add G_BEGIN_DECLS / G_END_DECLS to all installed headers so that libsoup can be used from C++ programs. #438776 svn path=/trunk/; revision=925
* require glib 2.12. check for timegm().Dan Winship2007-03-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: require glib 2.12. check for timegm(). * libsoup/soup-date.c (soup_mktime_utc): Use timegm if available. (soup_date_iso8601_parse): use g_time_val_from_iso8601. #337010, patch from Emmanuele Bassi. * libsoup/soup-types.h: remove local copy of G_GNUC_NULL_TERMINATED since we now depend on a new-enough copy of glib. * libsoup/soup-misc.c (soup_base64_encode_close) (soup_base64_encode_step, soup_base64_encode) (soup_base64_decode_step): Make these just be wrappers around the glib base64 methods. (For now; eventually they'll just go away.) * libsoup/soup-auth-basic.c (authenticate): * libsoup/soup-auth-digest.c (authenticate): * libsoup/soup-connection-ntlm.c (soup_ntlm_parse_challenge) (soup_ntlm_response): * libsoup/soup-server-auth.c (soup_server_auth_new): * libsoup/soup-soap-message.c (soup_soap_message_write_base64): * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_write_base64): * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_base64): Use glib base64 methods svn path=/trunk/; revision=921
* new method to find a "real" (ie, not comment or whitespace) xml nodeDan Winship2006-11-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-misc.c (soup_xml_real_node): new method to find a "real" (ie, not comment or whitespace) xml node * libsoup/soup-soap-response.c (parse_parameters) (soup_soap_response_from_string) (soup_soap_parameter_get_first_child) (soup_soap_parameter_get_next_child): Use soup_xml_real_node. Based on a patch from Andrew W. Nosenko. * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_from_string): don't call xmlKeepBlanksDefault, which changes libxml's behavior globally! Instead, use soup_xml_real_node() when traversing the xml tree. * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_response_from_string): don't call xmlKeepBlanksDefault. (exactly_one_child): rewrite in terms of soup_xml_real_node() (which means it handles comments now as well) (soup_xmlrpc_value_get_struct) (soup_xmlrpc_value_array_get_iterator) (soup_xmlrpc_value_array_iterator_prev) (soup_xmlrpc_value_array_iterator_next): Use soup_xml_real_node.
* bump version to 2.2.90. This will not be officially released, but onceDan Winship2005-11-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | * configure.in: bump version to 2.2.90. This will not be officially released, but once these patches have gotten some testing they may be pulled up to the gnome-2-12 branch. * libsoup/soup-connection.c: * libsoup/soup-server.c: * libsoup/soup-session.c: * libsoup/soup-socket.c: add an "async-context" property, which gets passed from server to socket, and session to connection to socket, allowing async usage outside the main thread. Based on patches from Armin Bauer and Jürg Billeter. * libsoup/soup-misc.c (soup_add_io_watch, soup_add_idle, soup_add_timeout): utility routines to add watches, idles, and timeouts to non-default GMainContexts. * libsoup/soup-message-io.c (io_write): set the read state appropriately after writing a "100 Continue" response (io_read): More 100-Continue stuff. I don't think this is quite right so it will probably change again later.
* add/fix gtk-doc comments, make functions match prototypes, etcDan Winship2005-06-141-2/+5
| | | | | | | * libsoup/*.[ch]: add/fix gtk-doc comments, make functions match prototypes, etc * docs/reference/*: update, fix, etc
* Change G_LOG_DOMAIN to "libsoup". Remove unused defines.Dan Winship2003-11-181-1/+1
| | | | | | | | | | | | | | | | | | | * libsoup/Makefile.am (INCLUDES): Change G_LOG_DOMAIN to "libsoup". Remove unused defines. * libsoup/soup-connection.c: Fix doc comments * libsoup/soup-message.c: Likewise * libsoup/soup-misc.c: Likewise * libsoup/soup-socket.c: Likewise * libsoup/soup-uri.c: Likewise * libsoup/soup-address.h: Fixes to please gtk-doc * libsoup/soup-connection.h: Likewise * libsoup/soup-message.h: Likewise * libsoup/soup-message-private.h: Likewise * libsoup/soup-misc.h: Likewise * libsoup/soup-server-auth.h: Likewise * libsoup/soup-socket.h: Likewise
* declare soup_ssl_supported.Dan Winship2003-11-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-misc.h: declare soup_ssl_supported. * libsoup/soup-gnutls.c: add soup_ssl_supported declaration. * libsoup/soup-nossl.c: Not an SSL implementation, built if HAVE_SSL is not defined. * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): add soup-nossl.c * libsoup/soup-socket.c (soup_socket_start_ssl): Return success or failure. (listen_watch): Deal with soup_socket_start_ssl failing. * libsoup/soup-connection.c (tunnel_connect_finished, socket_connect_result, soup_connection_connect_sync): Deal with the soup_socket_start_ssl failing. * libsoup/soup-server.c (soup_server_new): Deal with soup_ssl_get_server_credentials failing
* Remove refcounting, but note whether or not the CA file has been loaded.Dan Winship2003-09-231-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but note whether or not the CA file has been loaded. (SoupGNUTLSChannel): add a "hostname" field. (verify_certificate): Remove the comment about not being able to verify the hostname because of soup problems. Now it's because of GNUTLS problems instead. (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel, and takes a hostname and a creds argument now. (soup_ssl_get_client_credentials, soup_ssl_get_server_credentials): Return client/server credentials structures. (soup_ssl_free_client_credentials, soup_ssl_free_server_credentials): and free them. * libsoup/soup-session.c (class_init, set_property, get_property): add ssl_ca_file property (get_host_for_message): when returning an SSL host for the first time, create a client credentials structure for the session. (run_queue): Pass the ssl creds to the new connection. Also fix an unrelated bug that caused infinite loops on "bad hostname". * libsoup/soup-server.c: Use GObject properties, including ssl_cert_file and ssl_key_file properties. (soup_server_new): Remove "protocol" argument; if the cert file and key file properties were set, create a server credential structure from them and pass that to soup_socket_server_new. * libsoup/soup-connection.c (SoupConnectionPrivate): Rename dest_uri to origin_uri to match RFC 2616 terminology. Add an "ssl_creds" field. (class_init, set_property, get_property): add SSL_CREDS property (soup_connection_connect_async, soup_connection_connect_sync): Pass ssl_creds to soup_socket_client_new calls. * libsoup/soup-socket.c: Use GObject properties, including an ssl_creds property (soup_socket_set_flags): Gone (replaced with boolean properties) (soup_socket_new): Make this take a list of properties (listen_watch): copy ssl creds from listener to new socket (soup_socket_start_ssl): Pass remote hostname and socket creds structure to soup_ssl_wrap_iochannel. (soup_socket_client_new_async, soup_socket_client_new_sync, soup_socket_server_new): Replace the SSL boolean with an ssl_creds structure. * libsoup/soup-misc.c (soup_set_ssl_ca_file, soup_set_ssl_cert_files, soup_get_ssl_ca_file, soup_get_ssl_cert_files): Gone. SSL state is now per-session or per-server. * tests/get.c: add a "-c CAfile" argument, for loading a CA certificate file to validate https connections against * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile" arguments for loading an SSL server certificate. Only start an SSL server if those arguments were used. * tests/test-cert.pem: * tests/test-key.pem: SSL certificate for testing simple-httpd * tests/revserver.c: Update for API changes * tests/simple-proxy.c: Likewise
* Move RESPONSE_BLOCK_SIZE #define here from soup-private.hDan Winship2003-09-221-55/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here from soup-private.h * libsoup/soup-misc.c (soup_load_config, etc): Remove all this. (soup_set_security_policy, soup_get_security_policy): Remove, since the GNUTLS backend doesn't actually implement it. (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra stuff. * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from soup-private.h * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and soup_ssl_get_server_iochannel into a single function that takes a SoupSSLType. * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference. (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel. (soup_gnutls_set_security_policy): Gone * libsoup/soup-gnutls.h * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for soup-gnutls.c now * libsoup/soup-socket.c: Move soup_sockaddr_max #define here from soup-private.h (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel prototype. * libsoup/soup-private.h: Gone * libsoup/soup-address.c: Fix #includes for soup-private.h and soup-misc.h changes * libsoup/soup-auth-digest.c: Likewise * libsoup/soup-auth.c: Likewise * libsoup/soup-connection-ntlm.c: Likewise * libsoup/soup-connection.c: Likewise * libsoup/soup-dns.c: Likewise * libsoup/soup-gnutls.c: Likewise * libsoup/soup-headers.c: Likewise * libsoup/soup-message-client-io.c: Likewise * libsoup/soup-message-handlers.c: Likewise * libsoup/soup-message-io.c: Likewise * libsoup/soup-message-server-io.c: Likewise * libsoup/soup-message.c: Likewise * libsoup/soup-server-message.c: Likewise * libsoup/soup-server.c: Likewise * libsoup/soup-session.c: Likewise * libsoup/soup-socket.c: Likewise * tests/auth-test.c: Likewise
* Add "authenticate" and "reauthenticate" signals. (invalidate_auth): RemoveDan Winship2003-09-101-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-session.c: Add "authenticate" and "reauthenticate" signals. (invalidate_auth): Remove the call to soup_auth_invalidate. (authenticate_auth): soup_auth_fn is gone. If the URI doesn't contain authentication, then emit "authenticate" or "reauthenticate" (depending on whether or not this is the first time we've asked for a password for this auth). (update_auth_internal): If the server rejects our username/password, don't bail out immediately. Try doing a "reauthenticate" first. * libsoup/soup-misc.c (soup_set_authorize_callback): Gone * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the "pref" arg. (soup_auth_invalidate): Remove this; it doesn't actually do anything useful for us. * libsoup/soup-auth-basic.c (invalidate): Remove * libsoup/soup-auth-digest.c: (invalidate): Remove * libsoup/soup-auth-ntlm.c: (invalidate): Remove * libsoup/soup-uri.c: Remove all references to "authmech". (soup_uri_set_auth): Remove this too. * tests/auth-test.c: Update to use the "authenticate" and "reauthenticate" signals instead of encoding usernames and passwords in the URIs. Add a few more test cases.
* Move a bunch of logic here from soup-context. Now the session keeps trackDan Winship2003-09-051-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-session.c: Move a bunch of logic here from soup-context. Now the session keeps track of hosts (instead of having a global soup_hosts hash) and their connections. (soup_session_new_with_proxy, soup_session_new_full): New session constructors to specify a proxy or a proxy and connection limits (send_request): Add Authorization and Proxy-Authorization headers before sending off the request. (soup_session_queue_message, et al): Improve the way this works. There's no need to use timeouts to wait for connections to become free; we *know* when they become free. * libsoup/soup-private.h: Remove SoupHost and some other no-longer-used stuff. * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy, soup_set_connection_limit, soup_set_connection_limit): Gone. These are all per-session now. * libsoup/soup-message.c: Remove all SoupContext references (mostly replaced with SoupUri references) (cleanup_message): priv->connect_tag and priv->connection are gone now, so this was just soup_message_io_cancel(). So remove cleanup_message and replace it with that everywhere. (soup_message_disconnect): Gone. (soup_message_set_uri): Replaces soup_message_set_context. (soup_message_set_connection, soup_message_get_connection): Gone * libsoup/soup-message-server-io.c (parse_request_headers): s/soup_message_set_context/soup_message_set_uri/ * libsoup/soup-message-private.h (SoupMessagePrivate): Remove connect_tag, context, and connection. * libsoup/soup-message-client-io.c (encode_http_auth): Gone. * libsoup/soup-context.c: Gone * tests/auth-test.c (identify_auth): update for session/context changes
* First draft at the new object to maintain formerly-global state. (Not yetDan Winship2003-09-021-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-session.c: First draft at the new object to maintain formerly-global state. (Not yet complete; still need to get rid of SoupContext). * libsoup/soup-message-queue.c: Data structure used by SoupSession * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but some bits went into soup-connection. * libsoup/soup-connection.c (soup_connection_send_request): New, to send a request on a connection. The connection updates its internal state and then hands off to soup_message_send_request. (request_done): Callback set up by soup_connection_send_request. Marks the connection as no-longer-in-use, and disconnects it if the message says to. (soup_connection_set_in_use, soup_connection_mark_old): No longer needed; the connection takes care of this itself now. (soup_connection_new_proxy): New, to create a new connection that is explicitly marked as being through an HTTP proxy. (soup_connection_new_tunnel): New, to create a new HTTPS connection through a proxy. (Includes the code to send the CONNECT.) * libsoup/soup-context.c (try_existing_connections): Don't need to call soup_connection_set_in_use. (try_create_connection): Use soup_connection_new, soup_connection_new_proxy, or soup_connection_new_tunnel as appropriate. * libsoup/soup-message.c (soup_message_prepare): Replaces queue_message. (soup_message_queue, soup_message_requeue, soup_message_prepare): Gone. This must be done via a SoupSession now. (soup_message_set_connection): don't need to mark in_use/not in_use. Also, msg->priv->socket is gone now. (soup_message_get_socket): Gone. * libsoup/soup-message-handlers.c (soup_message_run_handlers): Remove references to global handlers. (redirect_handler, authorize_handler): Moved to soup-session.c. * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the session to shut down now. * libsoup/soup.h: add soup-session.h * libsoup/Makefile.am: updates * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use SoupSession.
* Make this more like a struct sockaddr again (like it used to be). InDan Winship2003-08-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-address.c (SoupAddressPrivate): Make this more like a struct sockaddr again (like it used to be). In particular, add back the "port" field. Add a bunch of macros to try (and fail) to simplify some of the code. (soup_address_new): Now returns a SoupAddress directly rather than a random handle, and the caller can just use g_object_unref to cancel the lookup. Also, the callback now uses a SoupKnownErrorCode rather than a special-purpose address-lookup error code. (soup_address_new_cancel): No longer needed. (soup_address_new_sync): Removed (soup_address_new_any): Replaces soup_address_ipv4_any and soup_address_ipv6_any. (soup_address_get_name, etc): Gone. Use soup_address_resolve() now. (soup_address_get_physical): Renamed from soup_address_get_canonical_name. (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr() * libsoup/soup-socket.c: Update for SoupAddress changes and make similar changes here. (soup_socket_new): Just creates a generic SoupSocket now. (soup_socket_connect): Client setup (soup_socket_listen): Server setup. Now also sets up an iochannel listening for connects and emits a "new_connection" signal as they come in. (soup_socket_start_ssl): Turns on SSL. (soup_socket_client_new, soup_socket_server_new): Utility functions that wrap the above. (soup_socket_new_cancel, soup_socket_new_sync): Gone (soup_socket_server_accept, soup_socket_server_try_accept): No longer needed. (soup_socket_get_iochannel): No longer adds a ref when returning the iochannel. Also, we set it to "close_on_unref" so that if a caller adds a ref to it, the connection will actually remain open even after the SoupSocket is destroyed. (soup_socket_get_local_address, soup_socket_get_remote_address): Let the caller get both of these. * libsoup/soup-connection.c: Don't keep a private copy of the socket's iochannel. (soup_connection_new): Don't need to set socket options here. SoupSocket does it. (soup_connection_start_ssl): Just call soup_socket_start_ssl. (soup_connection_get_iochannel): Just return the socket's iochannel (and don't ref it) * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and SOUP_ERROR_CANT_RESOLVE_PROXY * libsoup/soup-dns.c (soup_ntop): Make the address arg const. Remove the "FIXME add a CANT_RESOLVE error" and return SOUP_ERROR_CANT_RESOLVE instead. * libsoup/soup-server.c: Update for socket/address changes. Don't poke into SoupSocket's private fields. (soup_server_run_async): Just connect to the socket's "new_connection" signal. * libsoup/soup-context.c (try_create_connection, soup_context_connect_cb): Update for socket changes. Replace SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes. * libsoup/soup-misc.c (soup_signal_connect_once): Utility function to connect to a signal handler and connect another function to clean up the first signal handler after its first invocation. (Lets us use signals to replace one-off callbacks.) * libsoup/soup-private.h: Remove SoupSocketPrivate since it is actually private now. (struct _SoupServer): Remove accept_tag. * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request): Don't unref the iochannel. (soup_queue_connect_cb): Takes a SoupKnownErrorCode now. * libsoup/soup-socks.c: Update for socket/address changes * tests/simple-httpd.c (main): s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/ * tests/simple-proxy.c (main): Likewise * tests/timeserver.c: Update for SoupSocket's "new_connection" signal, and for SoupAddress changes.
* Make this an abstract GObject. Tweak some of the interfaces around aDan Winship2003-08-121-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some of the interfaces around a little bit. * libsoup/soup-auth-basic.c: subclass for Basic auth * libsoup/soup-auth-digest.c: subclass for Digest auth * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of the code from soup-ntlm.c here, and make it private. * libsoup/soup-ntlm.c: gone * libsoup/soup-misc.h: Remove the definition of SoupAuthType from here, and change the signature of SoupAuthorizeFn. * libsoup/soup-context.c: Use g_object_unref to free auths, use methods instead of directly access private fields. * libsoup/soup-queue.c: Likewise * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all NTLM references. We have no plans to implement server-side NTLM auth. * tests/auth-test.c (identify_auth): Update for auth api changes
* Change old Helix Code refs to Ximian (and update copyright dates).Dan Winship2002-11-151-1/+1
| | | | | * libsoup/*: Change old Helix Code refs to Ximian (and update copyright dates).
* Split libsoup out of soup. ChangeLog.old contains the original soupDan Winship2002-11-051-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | * Split libsoup out of soup. ChangeLog.old contains the original soup ChangeLog. * Makefile.am, etc: Fix things up to work with the new directory layout. Disable docs until we fix them. * autogen.sh: Use gnome-autogen.sh * configure.in: Require autoconf 2.53. Remove stuff that was only needed for httpd or wsdl code. Remove glib1 support. Bump version to 2.0. * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes in ${includedir}/soup-2.0 * libsoup/*: Merge soup-0-7 back onto the trunk. Remove SOAP-specific stuff, Windows support, and other things that weren't being maintained. * soup-config.in, soupConf.sh: Kill these. We only support pkg-config now.
* Bump development version to 0.7.99.Alex Graveley2002-03-121-0/+28
| | | | | | | | | 2002-03-11 Alex Graveley <alex@ximian.com> * configure.in, src/libsoup/soup-private.h: Bump development version to 0.7.99. * Merge all changes from soup-0-6 branch.
* Call soup_auth_fn if we don't have auth data in the URI, then callAlex Graveley2001-10-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | 2001-10-29 Alex Graveley <alex@ximian.com> * src/libsoup/soup-message.c (authorize_handler): Call soup_auth_fn if we don't have auth data in the URI, then call soup_auth_initialize if the callback set authenticate data on the passed uri. * src/libsoup/soup-auth.h: Make type be SoupAuthType. * src/libsoup/soup-auth.c (soup_auth_initialize): Impl. To be called after SoupAuth creation to apply auth data to the SoupAuth. This allows us to parse the Authenticate headers to figure out which auth scheme and realm is being used, and pass this to the auth callback. * src/libsoup/soup-misc.c (soup_set_authorize_callback): Impl. * src/libsoup/soup-misc.h: Add SoupAuthType enum here. * src/libsoup/soup-server.h: Use SoupAuthType. Remove SoupServerAuthType.
* Rewritten for the new apis, and to be more clean, and to have manyAlex Graveley2001-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-09-07 Alex Graveley <alex@ximian.com> * tests/stress-test.c: Rewritten for the new apis, and to be more clean, and to have many settings for varying simultaneous messages, message counts, iterations, posting of data, etc. * tests/simple-test.c: Rewritten for the new apis, and to be more clean. * tests/server-test.c (main): Added. Simple test for standalone dynamic servers. * tests/mod-server-test.c (callback): Added. Simple test for soup-httpd/apache server modules. * tests/handler-test.c: Added. Stress test for SoupMessage handlers. * tests/cgi-test.c: Added. Simple test for CGI serving. * src/soup-httpd/soup-httpd.c: Use libsoup's SoupServer code for all request processing. soup-httpd becomes a wrapper for module loading and logging. * src/libwsdl/Makefile.am (INCLUDES): Remove WSDL_CFLAGS. * src/libsoup/soup-socket.c (soup_socket_server_accept): Set O_NONBLOCK on the returned SoupSocket. (soup_socket_server_try_accept): Ditto. * src/libsoup/soup-server.c: Reimplement for independent SoupServer support. Remove separate authorization handler concept. Process based on request paths. Import code from soup-httpd to allow standalone dynamic servers, and cgi support. * src/libsoup/soup-queue.c (soup_check_used_headers): Remove special handling of SOAPAction. (soup_queue_connect_cb): Start listening for reads immediately so that we cna process HTTP 1xx intermediate responses. (soup_queue_message): Rename from soup_message_queue. soup_message_queue is now in soup-message.c and simply calls this. * src/libsoup/soup-private.h (RESPONSE_BLOCK_SIZE): Rename existing SoupServer to SoupHost. Create new SoupServer struct. Add server and server_sock elements to SoupMessagePrivate. Move SoupServerHandler definition to soup-server.h. Move define for soup_queue_shutdown to new soup-queue.h. * src/libsoup/soup-ntlm.c: Add mojo for getting a portable alloca. * src/libsoup/soup-message.h: Remove SoupErrorCode. Add SoupKnownErrorCode and SoupErrorClass enums. Add SOUP_ERROR_CANT_CONNECT_PROXY and SOUP_ERROR_CANT_AUTHENTICATE_PROXY for errors related directly to proxy communications. * src/libsoup/soup-message.c (soup_message_new): Take the HTTP method name as the second argument. Remove per-message handlers for authentication and redirection. (soup_message_issue_callback): Uses finalize_message to avoid double cleanup. Remove error argument, as they should be set using soup_message_set_error. (soup_message_run_handlers): Run per-message handlers followed by global handlers, if a handler requeues a message we stop processing. If the invoke_type is POST_BODY, we issue the final callback. (soup_message_remove_handler): Make public. (soup_message_set_error): Impl (soup_message_set_error_full): Impl (soup_message_set_handler_error): Impl (soup_get_error_phrase): Impl (soup_get_error_class): Impl * src/libsoup/soup-dav-server.c: Add a reference to the SoupServer we are registered with. Use soup_message_set_error throughout. (i_copy): Fix assignment causing this loop to never run. (soup_dav_server_register): Add SoupServer and required authtypes parameters. * src/libsoup/soup-context.c: Replace references to SoupServer with SoupHost, so we don't clash with the SoupServer from soup-server.h. Rename soup_servers to soup_hosts. * src/libsoup/Makefile.am (libsoup_la_SOURCES): Add soup-queue.h. * configure.in (SOUP_CURRENT): Add some helpful comments and bump to '3'. Bump version to 0.5.99 (0.6 development). Use AC_FUNC_ALLOCA instead of just checking for alloca.h. Remove WSDL_CFLAGS.
* Fix headers for new layout. Ditto.Alex Graveley2001-08-291-4/+3
| | | | | | | | | | | | | | | | | | | | | | | 2001-08-29 Alex Graveley <alex@ximian.com> * src/*/*.h: Fix headers for new layout. * tests/*.c: Ditto. * tests/Makefile.am (LDFLAGS): Use libtool to link with built libsoup and libwsdl. (libstockquote2_la_LIBADD): Ditto for libsoup-apache. * tests/stockquote2.wsdl: Indent prettily. * src/Makefile.am (SUBDIRS): Update for new source layout. * configure.in (SOUP_INCLUDEDIR): Use @includedir@/soup. (SOUP_WSDL_LIBS): include $SOUP_LIBS. (CFLAGS): Add Makefiles for new layout. * soup-config.in: Use @includedir@/soup. * soup.pc.in (Cflags): Use @includedir@/soup.
* impl. (soup_set_ssl_ca_dir): impl. (soup_set_ssl_cert_files): impl.Alex Graveley2001-08-261-0/+9
| | | | | | | | | | | | | | | 2001-08-26 Alex Graveley <alex@ximian.com> * src/soup-core/soup-misc.c (soup_set_ssl_ca_file): impl. (soup_set_ssl_ca_dir): impl. (soup_set_ssl_cert_files): impl. * src/soup-core/soup-openssl.c (soup_openssl_init): Load cert authority files found in HTTPS_CA_DIR and HTTPS_CA_FILE. (soup_openssl_get_iochannel): Load certificate found in HTTPS_CERT_FILE and private key from file in HTTPS_KEY_FILE. Client certificates thanks to Scott Hutton (shutton@pobox.com).
* Correctly note copyright for soup_base64_encode() to the FSF, and creditAlex Graveley2001-06-011-2/+2
| | | | | | | | 2001-06-01 Alex Graveley <alex@ximian.com> * src/soup-core/soup-misc.c: Correctly note copyright for soup_base64_encode() to the FSF, and credit Chris Blizzard as the actual author.
* Fixed all gtk-doc moans in soup-core documentationDick Porter2001-05-171-1/+1
| | | | | | 2001-05-17 Dick Porter <dick@ximian.com> * Fixed all gtk-doc moans in soup-core documentation
* remove hack to look at internals of GNET by using the new forked GNET :)Alex Graveley2001-03-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-21 Alex Graveley <alex@ximian.com> * src/soup-core/soup-socks.c: remove hack to look at internals of GNET by using the new forked GNET :) * tests/stress-test.c: use soup_message_queue (). * tests/simple-test.c: use soup_message_queue (). * src/soup-core/soup-private.h: Added SoupAddress and SoupSocket. * src/soup-core/soup-misc.c (soup_shutdown): Added, just calls soup_queue_shutdown. * src/soup-core/soup-queue.h: Removed. Added to soup-message.h. * src/soup-core/soup-queue.c (soup_queue_message): rename to (soup_message_queue): this. * src/soup-core/soup-message.h: move SoupErrorCode, SoupCallbackFn, and soup_message_queue() here. * src/soup-core/soup-message.c (soup_message_free): Free msg->response if buffer is system owned. (soup_message_issue_callback): set msg->priv->errorcode so syncronous soup_message_send can check for completion. (soup_message_send): Added: Synchronous message send. Queues the message as per usual, then call g_main_iteration() until them essage returns. * src/soup-core/soup-context.c: API Document. Switch gnet calls to their soup-socket replacement. (soup_context_get_connection): Remove environment check for syncronous connect method. * src/soup-core/Makefile.am (INCLUDES): replace GNET_CFLAGS with GLIB_CFLAGS. (libsoup_la_LIBADD): replace GNET_LIBS with GLIB_LIBS. (soupinclude_HEADERS): Remove soup-queue.h. Add soup-socket.h. (libsoup_la_SOURCES): Add soup-socket.c. * soup.spec.in (Requires): remove GNET. Add libxml. * soup.pc.in (Libs): remove GNET. (Cflags): ditto. * soup-config.in (depend_libs): remove GNET. (depend_cflags): ditto. * configure.in: remove gnet references, look for libnsl and libresolv, add checking to determine gethostbyname_r possibility. * acconfig.h: Add undefs for all the gethostbyname_r variants. * src/soup-core/soup-socket.[ch]: Fork of GNET, minus synchronous bits. Removes dependency on GNET; we now only rely on Glib and libXml.