summaryrefslogtreecommitdiff
path: root/libsoup/soup-server.h
Commit message (Collapse)AuthorAgeFilesLines
* SoupServer: add deprecation tags to deprecated APIserver-apiDan Winship2014-03-151-0/+9
|
* SoupServer: add new-and-improved APIsDan Winship2014-03-151-38/+93
| | | | | | | | 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. FIXME bug numbers
* SoupServer: add :http-aliases and :https-aliases propertiesDan Winship2013-08-261-0/+2
| | | | | | | | | Add :http-aliases and :https-aliases properties to SoupServer, to allow it to handle requests like: GET daap://host:port/path HTTP/1.1 https://bugzilla.gnome.org/show_bug.cgi?id=703694
* Add SoupServer:tls-certificate to go with SoupSession:tlsdbDan Winship2011-09-291-7/+8
|
* Add 'soup_server_disconnect' methodAndreas Rottmann2011-03-121-0/+1
| | | | | | | | This is primarily useful for language bindings, where you don't have explicit control over reference counts, and hence cannot just use 'g_object_unref' on the server object. See https://bugzilla.gnome.org/show_bug.cgi?id=638576
* use an underscore for struct definitions. Fixes bug #518317.Benjamin Otte2008-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | 2008-02-25 Benjamin Otte <otte@gnome.org> * libsoup/soup-address.h: * libsoup/soup-auth-domain.h: * libsoup/soup-auth.h: * libsoup/soup-message.h: * libsoup/soup-server.h: * libsoup/soup-session-async.h: * libsoup/soup-session-sync.h: * libsoup/soup-session.h: * libsoup/soup-socket.h: * libsoup/soup-types.h: * libsoup/soup-uri.h: use an underscore for struct definitions. Fixes bug #518317. svn path=/trunk/; revision=1093
* fix default connections-per-host again; it was defined in two places. AddDan Winship2008-02-031-0/+1
| | | | | | | | | | | | | | * libsoup/soup-session.c: fix default connections-per-host again; it was defined in two places. Add SOUP_SESSION_USER_AGENT property (setup_message): set the User-Agent request header on the request * libsoup/soup-server.c: add SOUP_SERVER_SERVER_HEADER property (start_request): set the Server response header on the request. * tests/get.c: * tests/simple-httpd.c: set the User-Agent/Server headers svn path=/trunk/; revision=1071
* Use GObject properties. (soup_address_new, soup_address_new_from_sockaddr)Dan Winship2008-02-011-4/+8
| | | | | | | | | | | | | | | | | | | | * libsoup/soup-address.c: Use GObject properties. (soup_address_new, soup_address_new_from_sockaddr) (soup_address_new_any): Make these just wrappers around g_object_new. * libsoup/soup-message-body.c (soup_message_body_get_type): * libsoup/soup-message-headers.c (soup_message_headers_get_type): * libsoup/soup-server.c (soup_client_context_get_type): Register these as boxed types, for language bindings. * libsoup/soup-date.c (soup_date_get_type): * libsoup/soup-message-body.c (soup_buffer_get_type): * libsoup/soup-value-utils.c (soup_byte_array_get_type): * libsoup/soup-uri.c (soup_uri_get_type): Upgrade to the latest yummiest type-registering idiom. svn path=/trunk/; revision=1067
* Merge libsoup-2.4 branch to trunkDan Winship2008-01-151-51/+52
| | | | | | * Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
* don't leak the async_contextDan Winship2007-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-message-io.c (soup_message_io_unpause): don't leak the async_context * libsoup/soup-server.c (soup_server_quit): disconnect the "new_connection" handler. (soup_server_get_async_context): Convenience method to return the server's async_context. * libsoup/soup-server-message.c: don't circularly ref the server, there's no need anyway. * libsoup/soup-session.c (soup_session_get_async_context): Convenience method to return the session's async_context. * libsoup/soup-session-async.c (queue_message): call run_queue in the session's async_context, not the main context. (send_message): don't leak the async_context * libsoup/soup-session-sync.c (queue_message_thread): don't leak the async_context * tests/context-test.c: test that SOUP_SESSION_ASYNC_CONTEXT works and doesn't leak svn path=/trunk/; revision=954
* add G_BEGIN_DECLS / G_END_DECLS to all installed headers so that libsoupJonathon Jongsma2007-06-011-0/+3
| | | | | | | | | 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
* bump version to 2.2.90. This will not be officially released, but onceDan Winship2005-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* use G_GNUC_NULL_TERMINATED.Dan Winship2005-08-151-1/+1
| | | | | | | | | | | | * libsoup/soup-connection.h (soup_connection_new): * libsoup/soup-server.h (soup_server_new): * libsoup/soup-session-async.h (soup_session_async_new_with_options): * libsoup/soup-session-sync.h (soup_session_sync_new_with_options): * libsoup/soup-socket.h (soup_socket_new): use G_GNUC_NULL_TERMINATED. * libsoup/soup-types.h (G_GNUC_NULL_TERMINATED): steal the definition of this from glib 2.8 for use when compiling against glib 2.6.
* new method to get the server's listening socket.Dan Winship2005-08-121-0/+2
| | | | | | | | * libsoup/soup-server.c (soup_server_get_listener): new method to get the server's listening socket. * libsoup/soup-socket.c: add a new "cloexec" property, to set FD_CLOEXEC on the socket. Update everything for that.
* require glib-2.0 >= 2.4.0Dan Winship2005-04-111-3/+0
| | | | | | | | | | | | * configure.in: require glib-2.0 >= 2.4.0 * libsoup/*.c: use G_DEFINE_TYPE and g_type_class_add_private/G_TYPE_INSTANCE_GET_PRIVATE * libsoup/soup-types.h: kill SOUP_MAKE_TYPE and SOUP_MAKE_TYPE_WITH_IFACE * tests/revserver.c: use GThread. (patch from tml)
* Remove refcounting, but note whether or not the CA file has been loaded.Dan Winship2003-09-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Major rewrite. There is now only a single IO state object (instead of oneDan Winship2003-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-message-io.c: Major rewrite. There is now only a single IO state object (instead of one for reading and one for writing), and the IO code handles switching back and forth between reading and writing as appropriate (including handling the extra switches needed for "Expect: 100-continue"). (soup_message_io_client, soup_message_io_server): The new entry points. (soup_message_io_cancel): If the caller cancels the IO when we were expecting to read more data, disconnect the socket. * libsoup/soup-message.h (SoupMessageFlags): add SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should do the special expect-continue handling. * libsoup/soup-message.c: Move all the signal stuff here. Remove the "done_reading" and "done_writing" signals and replace them with a single "finished" signal. (A single signal. Say that 10 times fast!) (soup_message_got_headers, etc): Functions to emit signals. (got_headers, got_chunk, got_body): Default signal methods that call soup_message_run_handlers. (finished): Default signal method that replaces soup_message_issue_callback. ([various]): s/soup_message_issue_callback/soup_message_finished/ (soup_message_requeue): There's no soup_message_set_read_callbacks any more, so if the caller requeues while it's still reading, just cancel the read. (soup_message_add_chunk, soup_message_add_final_chunk, soup_message_pop_chunk): Moved here from soup-server-message, although we don't actually quite support using chunked encoding for requests yet. * libsoup/soup-server-message.c (soup_server_message_new): No longer takes a socket argument. (soup_server_message_add_chunk, soup_server_message_get_chunk): Moved into SoupMessage. * libsoup/soup-message-handlers.c (global_handlers): Make these POST_BODY rather than PRE_BODY, so they won't mess up the IO channel when the requeue the message. (soup_message_run_handlers): Don't need to issue the message callback from here any more. (authorize_handler): Just leave the error as 401 or 407 (see soup-error.h change) * libsoup/soup-message-client-io.c (soup_message_send_request): Replaces soup_message_write_request and soup_message_read_response. * libsoup/soup-message-server-io.c: Parallel to soup-message-client-io.c, this defines the server-side header handling. (soup_message_read_request): Its entry point. * libsoup/soup-server.c: Lots of code moved into soup-message-server-io.c. Update for other changes. * libsoup/soup-queue.c: Update for changes * libsoup/soup-socket.c (read_from_network, soup_socket_write): Don't call soup_socket_disconnect() on an error, just return SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit signals that will mess up the caller of the read/write function. * libsoup/soup-connection.c (soup_connection_disconnect): When disconnecting the socket, disconnect from its signals first to prevent bad reentrancy. * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say anything that SOUP_ERROR_UNATHORIZED and SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the "transport" errors actually are transport-related.) * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/ * tests/simple-proxy.c: Complicate this a bunch. In particular, use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and pass the data back to the client in chunked format.
* New header with typedefs, to avoid #include loops among other headers.Dan Winship2003-08-271-7/+3
| | | | | | | | | * libsoup/soup-types.h: New header with typedefs, to avoid #include loops among other headers. * libsoup/Makefile.am (libsoupinclude_HEADERS): add it * libsoup/*.[ch], tests/*.c: Update for soup-types.h
* Make this a GObject. Remove SoupServerMessage code (toDan Winship2003-08-191-65/+52
| | | | | | | | | | | | | | | | | | * libsoup/soup-server.c: Make this a GObject. Remove SoupServerMessage code (to soup-server-message.c). Remove CGI server code (for now?) (soup_server_add_handler, soup_server_remove_handler): Rename (from register/unregister) to make it clearer what they do. * libsoup/soup-server-message.c: Moved out of soup-server.c * libsoup/soup-private.h: Remove SoupServer def * libsoup/Makefile.am (libsoupinclude_HEADERS, libsoup_2_2_la_SOURCES): add soup-server-message.[ch] * tests/simple-httpd.c: * tests/simple-proxy.c: Update for SoupServer changes
* Make this more like a struct sockaddr again (like it used to be). InDan Winship2003-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Added. Starts a server only on the interface specified, instead of allJoe Shaw2002-12-201-0/+4
| | | | | | | | 2002-12-20 Joe Shaw <joe@ximian.com> * libsoup/soup-server.c (soup_server_new_with_host): Added. Starts a server only on the interface specified, instead of all network interfaces.
* Change old Helix Code refs to Ximian (and update copyright dates).Dan Winship2002-11-151-2/+2
| | | | | * 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-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | * 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-74/+64
| | | | | | | | | 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-21/+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.
* Pass protocol to soup_server_new. Ditto.Alex Graveley2001-09-121-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | 2001-09-12 Alex Graveley <alex@ximian.com> * tests/filesys-server.c (main): Pass protocol to soup_server_new. * tests/server-test.c (main): Ditto. * src/soup-wsdl/Makefile.am (soup_wsdl_LDADD): Remove libwsdl.so link. * src/libwsdl/Makefile.am (libwsdl_build_a_SOURCES): Include libwsdl.so sources in libwsdl-build.a so libtool 1.3.5 doesn't ill. Remove libwsdl_build_a_LIBADD. * src/libsoup/soup-server.c (soup_server_new): Take a SoupProtocol argument. * src/libsoup/soup-dav-server.c (move_copy): Serialize multi-status. (i_copy): Fix bug where directory contents were sometimes created before parent. Add multi-status error reporting. * src/libsoup/soup-dav.c (soup_dav_response_new): Remove response_phrase param.
* Rewritten for the new apis, and to be more clean, and to have manyAlex Graveley2001-09-081-32/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Microsoft NTLM authentication support compliments of Dan WinshipAlex Graveley2001-08-231-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 2001-08-23 Alex Graveley <alex@ximian.com> * src/soup-core/soup-ntlm.[ch]: Microsoft NTLM authentication support compliments of Dan Winship (danw@ximian.com). * src/soup-core/Makefile.am (libsoup_la_SOURCES): Add soup-ntlm.[ch] * src/soup-core/soup-auth.c (soup_auth_new_from_header): Set auth context before header parsing. Add NTLM case. Call auth->parse_func instead of hardcoding. (soup_auth_invalidates_prior): add NTLM, which should always invalidate. (ntlm_new): impl. (ntlm_free): impl. (ntlm_parse): impl. Hack to get domain from the uri's authmech field. (ntlm_auth): impl. * src/soup-core/soup-dav-server.c (get_depth): return 0 for unknown value. * src/soup-core/soup-server.h: Remove SoupServerAnonymousToken and add SoupServerNTLMToken.
* gtk-doc fixups.Alex Graveley2001-05-221-3/+1
| | | | | | | | | | 2001-05-21 Alex Graveley <alex@ximian.com> * src/soup-core/soup-queue.c (soup_message_queue): gtk-doc fixups. * src/soup-core/soup-socket.c (soup_socket_server_new): New. (soup_socket_server_accept): New. (soup_socket_server_try_accept): New.
* SoupSocketConnectFn no longer takes a SoupAddress argument, as it can beAlex Graveley2001-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-04-23 Alex Graveley <alex@ximian.com> * src/soup-core/soup-socket.h: SoupSocketConnectFn no longer takes a SoupAddress argument, as it can be fetched from the SoupSocket correctly now. * src/soup-core/soup-socket.c: lots of rewrites. Cache existing SoupAddresses to avoid duplicate lookups. Handles multiple simultaneous requests for the same address. Add syncronous versions of calls which just run the main loop until completion or request. Make SoupContext use a SoupAddress instead of sockaddr. * src/soup-core/soup-uri.h: Add query_elems to SoupUri. Contains a list of query string elements, as delimited by a '&'. SoupUri.protocol is now a SoupProtocol. * src/soup-core/soup-uri.c (soup_uri_new): convert uri_string protocol to SoupProtocol equivalent. * src/soup-core/soup-private.h: remove protocol from SoupContext. Use a SoupAddress instead of a sockaddr in SoupSocket. * src/soup-core/soup-misc.c (soup_load_config_internal): kill tiny (8 byte) mem leak. * src/soup-core/soup-message.h: add SoupOwnership SOUP_BUFFER_STATIC. add SoupErrorCode SOUP_ERROR_CANT_AUTHENTICATE. * src/soup-core/soup-context.h: move SoupProtocol to soup-uri.h. * src/soup-core/soup-context.c (soup_context_new): removed. Protocol is now held only in uri. (soup_context_from_uri): added. (soup_context_get): just calls soup_context_from_uri() after creating uri. (soup_context_unref): don't evaluate a post-decremented refcount. (soup_context_connect_cb): no longer take a SoupAddress arg. (soup_context_get_protocol): removed, use uri. * src/soup-core/soup-apache.c (soup_apache_message_create): use SOUP_BUFFER_STATIC for request buffer. * src/soup-core/md5-utils.c: initial commit. MD5 encryption. * src/soup-core/soup-digest.c: initial commit. no worky. * src/soup-core/Makefile.am (libsoup_la_SOURCES): add md5-utils.h, md5-utils.c, soup-digest.h, soup-digest.c. * tests/stress-test.c (main): handle ugly refcount bug causing extra unrefs of the context.
* Added SoupServerBasicToken, SoupServerDigestToken,Alex Graveley2001-04-181-15/+45
| | | | | | | | | | | | | | | | | | 2001-04-18 Alex Graveley <alex@ximian.com> * src/soup-core/soup-server.h: Added SoupServerBasicToken, SoupServerDigestToken, SoupServerAnonymousToken structs, all with a SoupServerAuthType as the first element. Added SoupServerAuthToken which is a union of all three auth types. * src/soup-core/soup-server.c (soup_server_register_full): Added. Accept method authentication callback and allowed auth types. * src/soup-core/soup-apache.c (soup_apache_handler): Use a SoupServerAuthToken. Log to apache only in error conditions. * src/soup-core/soup-server.c (soup_server_authorize): Accept a SoupServerAuthToken instead of username/pass/realm.
* remove hack to look at internals of GNET by using the new forked GNET :)Alex Graveley2001-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* demonstrate correct behavior here by unref'ing the context after messageAlex Graveley2001-03-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-09 Alex Graveley <alex@ximian.com> * tests/simple-test.c (main): demonstrate correct behavior here by unref'ing the context after message creation. * tests/stress-test.c (main): ditto. * src/soup-core/soup-queue.c (soup_queue_message): set req->priv->recv_buf = NULL here, as the media continues to barrate dangling pointers. * src/soup-core/soup-server.h: make SoupServerAuthorizeFn typedef const correct * src/soup-core/soup-server.c (soup_server_authorize): make const correct. * src/soup-core/soup-message.c (soup_message_cleanup): don't free response phrase. Don't set req->priv->recv_buf = NULL here, as leaking memory continues to be considered "bad". * src/soup-core/soup-headers.c (soup_headers_parse_response): don't alloc status_phrase, just point into buffer. * src/soup-core/soup-cgi.c (soup_cgi_read_cb): deal with response phrase now being const. * src/soup-core/soup-apache.c (soup_apache_message_create): action is already strdup'd in soup_message_new (). response_phrase is now a const string. Remove unneeded content-type header. (soup_apache_read_request): slight reorg, also use ap_palloc() instead of ap_calloc(). (soup_apache_handler): initial authentication handling, only basic auth at this point.
* soup_server_init should be an extern functionJP Rosevear2001-03-071-1/+1
| | | | | | | 2001-03-07 JP Rosevear <jpr@ximian.com> * src/soup-core/soup-server.h: soup_server_init should be an extern function
* add allowable authentication types mask. (soup_server_set_method_auth):Alex Graveley2001-03-071-4/+11
| | | | | | | | | | | | | | | | 2001-03-07 Alex Graveley <alex@ximian.com> * src/soup-core/soup-server.c (soup_server_set_global_auth): add allowable authentication types mask. (soup_server_set_method_auth): ditto. NOTE: This server auth stuff may be removed altogether, so don't rely on it. * src/soup-core/soup-server.h: added SoupServerAuthType, a mask of allowable authentication types. Make soup_server_init an extern declaration instead of a function pointer. * src/soup-core/soup-apache.c (soup_apache_read_request): move chunked data checking to here from soup_apache_handler.
* created. moved cgi-related request processing here. do not use it.Alex Graveley2001-03-071-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-07 Alex Graveley <alex@ximian.com> * src/soup-core/soup-cgi.c: created. moved cgi-related request processing here. do not use it. completely broken. * src/soup-core/soup-apache.c: initial commit of Apache module handling, server registration should be performed in a soup_server_init function. Authorization handling still needs to be written. * src/soup-core/soup-server.c: cleaned up to have only generic server functions. removed extraneous unregister functions. (soup_server_set_global_auth): set the global server authorize function, to be called in the absence of a method-specific authorize function. (soup_server_set_method_auth): set per-method authorize function. * src/soup-core/soup-queue.c (soup_parse_headers): remove unneeded variables. * src/soup-core/soup-private.h: add SoupServerHandler, soup_server_get_handler(), and soup_server_authorize(). * src/soup-wsdl/Makefile.am (INCLUDES): add WSDL_CFLAGS, to get -Werror. * src/soup-core/Makefile.am: add new libsoup-apache.so target. * soup.spec.in: update and remove hardcoded library version. * soup-config.in: add module soup-apache. * configure.in: Fix library versioning. Switch version to 0.2.1. Add APACHE_CFLAGS and APACHE_LIBS, gotten from running `apxs`. Remove -Werror from CFLAGS, as apache_conf.h is missing a prototype. Add WSDL_CFLAGS="-Werror" back. * TODO (TODO): Updated.
* glib idle callback which calls waitpid (nonblockingously) on all theAlex Graveley2001-02-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-02-28 Alex Graveley <alex@ximian.com> * src/soup-core/soup-ssl.c (soup_ssl_idle_waitpid): glib idle callback which calls waitpid (nonblockingously) on all the soup-ssl-proxy children to make sure their resources are freed. (soup_ssl_get_iochannel): execute soup-ssl-proxy, setting up STDIN and STDOUT to point to the fd we will return a GIOChannel for, also passing the security policy and the destination socket fd number in the environments SECURITY_POLICY and SOCKFD, respectively. * src/soup-core/soup-ssl-proxy.c: Created. This is a small SSL proxy executable, licensed GPL, which allows us to use OpenSSL and NSS without requiring applications which link with libsoup to have to comply with the licenses of those SSL libraries. * src/soup-core/soup-server.c (soup_server_register): add handler to list. * src/soup-core/soup-queue.c (soup_queue_write_async): ignore SIGPIPE and handle errno. * src/soup-core/soup-misc.c (soup_set_security_policy): move from soup-ssl.c. (soup_get_security_policy): add. * src/soup-core/soup-context.c (soup_connection_get_iochannel): setup TCP socket before getting an SSL wrapper channel. * src/soup-core/Makefile.am (INCLUDES): add -DBINDIR (libsoup_la_SOURCES): remove ssl backends (soup_ssl_proxy_SOURCES): create soup-ssl-proxy * src/soup-core/.cvsignore: add soup-ssl-proxy
* Initial revision of server side request handling dispatcher.alex2001-02-121-0/+34
2001-02-12 alex <alex@ximian.com> * src/soup-core/soup-server.[ch]: Initial revision of server side request handling dispatcher.