40 Commits
Author SHA1 Message Date
Patrick Griffis 379d1d1b2d examples: Update get to use client certificate API 2021-07-28 11:59:37 -05:00
Carlos Garcia Campos 69b885d2e8 examples: do not add SoupContentDecoder feature to the session in get
It's added by default to the sessionm adding it again we end up decoding
twice.
2021-05-25 12:04:29 +02:00
Carlos Garcia Campos a94a3a9a6b Stop using emacs indent-tabs-mode
We prefer spaces now instead of tabs.
2021-03-18 14:00:35 +01:00
Robert Ancell 8e7652a2f9 Add a method to override the remote connection.
This allows using a Unix socket to communicate on.

Fixes https://gitlab.gnome.org/GNOME/libsoup/-/issues/75
2021-03-05 09:07:02 +00:00
Carlos Garcia Campos 25013fed40 examples: use soup_session_send in get example
Instead of the basic API that will be removed soon. Also bring back the
head command line option now that we create the message again.
2021-03-04 18:18:46 +01:00
Carlos Garcia Campos 587e43cf50 session: add public getters and setters for the SoupSession properties
Also make max-conns and max-conns-per-host construct only and ensure all
setters emit the GObject::notify signal when the value changes.
2021-02-23 12:58:09 +01:00
Patrick Griffis 46555718fa examples: Rewrite proxy example 2021-01-18 12:23:04 -06:00
Patrick Griffis 8cfc309f05 examples: Fix simple-httpd 2021-01-09 14:40:18 -06:00
Patrick Griffis 9eb8f2faa5 examples: Change get to use high level API 2020-12-13 19:32:41 +00:00
Patrick Griffis 05c0418ae7 Rewrite get example using new API 2020-12-13 19:32:41 +00:00
Patrick Griffis 737eef099c Replace SoupURI with GUri 2020-11-14 19:07:24 +00:00
Patrick Griffis d9bd561c34 Remove properties that behave as functions
This goes against all convention and isn't binding friendly.
2020-11-05 15:02:05 -06:00
Patrick Griffis 0120f183ca Make SoupMessage a private and final type 2020-10-28 12:52:49 -05:00
Patrick Griffis 533e53b211 Remove property aliases
This was an oddity of libsoup that no other GObject library does.

The downsides are mostly that tooling doesn't expect it so its
easy to not document them or not define them and developers don't
expect them so they don't realize the defines are just property names
or search codebases for one but miss the other.

It just doesn't follow convention.
2020-10-28 07:50:40 +00:00
Patrick Griffis 4b43e15879 Replace SoupBuffer with GBytes 2020-09-19 15:41:25 -07:00
Patrick Griffis 423572c6ee Remove SoupSessionAsync 2020-09-19 15:41:24 -07:00
Patrick Griffis 12083398e7 Remove deprecated proxy APIs 2020-09-19 15:41:24 -07:00
Claudio Saavedra b88978b0a1 examples/get: pull a leak with the GOptionContext 2019-09-11 09:28:41 +00:00
Seungha Yang f3eb1887a2 meson: Check TLS support only when external glib dependency is available
meson does not allow compile with internal dependency (i.e., fallback dependency)
2019-05-03 14:03:18 +09:00
Tomas Popela 855f6e274e Remove the Autotools build system files
The main build system of the libsoup project is now Meson. Also remove
the TAP support files.

Closes: #12
2019-01-11 10:49:56 +00:00
Mooffie a77b81901d examples/simple-httpd.c: Fix handling of directories
A bug introduced in commit 53a3dd24e5 (a
copy/paste mistake has replaced a variable name) causes the example
httpd to not handle directories correctly.

Additionally, we add a comment recommending programmers to provide a
descriptive error message. This could give users and programmers a hint
as to what went wrong.

Fixes #2
2018-07-01 22:23:53 +03:00
Tomas Popela 63de523094 Address review comments from Iñigo Martínez
https://bugzilla.gnome.org/show_bug.cgi?id=784212#c31
2018-04-11 12:39:20 +02:00
Tomas Popela af5186fdc1 Add Meson port files to the Autotools EXTRA_DIST
So it's possible to build with the Meson from the tarball that is
produced by Autotools
2018-04-11 12:39:20 +02:00
Sebastian Dröge 942c9abe6d Initial meson support
Does not build libsoup-gnome and exclude gssapi and ntlm_auth, and also
misses other features of the autotools build system. But generates a
useable library.
2018-04-11 12:39:19 +02:00
Sebastian Dröge ad434349d7 Only set "ssl-ca-file" in examples/get if provided on the commandline
Otherwise the default system CA database is not going to be used if
nothing is given on the commandline, and certificate verification fails.

https://bugzilla.gnome.org/show_bug.cgi?id=784259
2017-07-04 09:11:07 +03:00
Tomas Popela 97a69ff9d3 Don't leak the SoupMessage and SoupSession objects in the examples/get utility 2017-06-22 15:50:58 +02:00
Colin Walters 99d140332d examples/get: Add TLS client certificate support
I'm trying to debug an ostree issue with client cert interaction with
a specific server, and it's easier to drop ostree out of the picture
and use this libsoup equivalent of `curl`.

https://bugzilla.gnome.org/show_bug.cgi?id=768524
2016-07-12 09:50:40 -04:00
Chun-wei Fan 53a3dd24e5 examples/simple-httpd.c: Make it work better for Windows
Replace dirent calls and POSIX file API calls with GLib calls, so that
the code will build and work better across different platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=758759
2016-03-15 16:49:37 +08:00
6a8826f0d2 Bug 587145 - Add GSS-Negotiate support
If a "WWW-Authenticate: Negotiate" HTTP header is spotted libsoup will check if
the host is on blacklist and the authentication fails if so. Otherwise the host
is compared against a trusted URIs (if the trusted URIs list is not set all
the HTTPS requests are trusted by default) and then processed. The trusted URIs
list and blacklist are both created when a SoupNegotiateAuth is created. The
trusted URIs list (blacklist) is parsed from the SOUP_GSSAPI_TRUSTED_URIS (
SOUP_GSSAPI_BLACKLIST_URIS) environment variable that expects the URIs be comma
separated (e.g. "http://www.example.com,https://www.test.com:80"). Then the
request is processed by the GSS library (the SPNEGO mechanism is used) which
produces a token that is send back to the server in the next request. The reply
is then again processed by the GSS library and the authentication succeeds by
receiving the GSS_S_COMPLETE status or we continue negotiating when the
GSS_S_CONTINUE_NEEDED is received.

The SoupAuth object is marked as not authenticated if a user will try to call
the soup_auth_authenticate() with the credentials provided as this is not
supported.

If the libsoup is configured with GSS-Negotiate support, a Kerberos library with
GSSAPI support needs to be available on the system (MIT Kerberos was tested
while working on this). Developers can check whether the libsoup was
compiled with the GSS-Negotiate support enabled by checking the
soup_auth_negotiate_supported() function.

To easily test the GSS-Negotiate functionality a new argument "N" was added to
the examples/get utility.

A support for NTLMSSP is provided by this patch given that a Kerberos library
supports NTLMSSP mechanism via GSSAPI. For MIT Kerberos one can use gss-ntlmssp
module, https://fedorahosted.org/gss-ntlmssp/.

Co-Authored-By: Tomas Popela <[email protected]>
Co-Authored-By: David Woodhouse <[email protected]>
Co-Authored-By: Dan Winship <[email protected]>
2016-03-14 15:04:35 +01:00
Ignacio Casal Quinteiro 9aaa13affd Mark old session-(async|sync) methods as deprecated
They were not marked as deprecated yet to give people time to port over
without getting annoying warnings. Now that we are at the start
of a cycle let's mark them.
Fix all the consequent deprecation warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=757146
2015-11-22 11:34:54 -05:00
Dan Winship 17bbf1197b soup-server: add soup_client_context_steal_connection()
Add a method to allow a SoupServer handler to steal the connection
from the server, and use this in simple-proxy to implement CONNECT.

Incorporates a patch from Lionel Landwerlin.
2015-03-01 10:36:27 -05:00
Dan Winship 1c71cb223b soup-server: add new-and-improved APIs
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
2014-05-02 09:13:14 -04:00
Dan Winship c6ca559e4e examples: fix simple-proxy
startup error checking was busted, making this not even work
2014-01-07 13:19:09 -05:00
Dan Winship 761ab8aac9 get: fix to not send the request twice 2013-08-18 11:23:26 -04:00
Dan Winship e7f1e5ae3e examples: port get to plain SoupSession 2013-07-13 11:19:11 -04:00
Dan Winship 312dbe87cc build: use AM_CPPFLAGS rather than INCLUDES
to make automake 1.13 happy
2013-07-10 09:08:35 -04:00
Andres Gomez 0972754530 [examples] "get" uses -o to save to a file
The "get" example is now able to handle a new "-o"
parameter specifying the path of a file in which
to write the received body of a "GET" operation.

If the file exists, it will be overwritten.

https://bugzilla.gnome.org/show_bug.cgi?id=703229
2013-07-03 10:53:29 +03:00
Andres Gomez 037c1f9267 [examples] Added SoupLogger to get example
Now, instead of printing the debug information
manually we use SoupLogger for this with the "-d"
flag.

https://bugzilla.gnome.org/show_bug.cgi?id=703231
2013-07-03 10:45:17 +03:00
Dan Winship 342e1b6f37 examples: use GOptionContext (finally) 2013-02-23 12:01:01 +01:00
Dan Winship 4c7d4c4cd4 examples: move examples from tests/ to examples/
get, simple-httpd, and simple-proxy are more example code than test
programs, so move them into a separate directory.

Also, remove "dns", which was once a sort-of test of SoupAddress, but
is now just a redundant sort-of test of GResolver.
2013-02-23 12:01:01 +01:00