| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
| |
It has been deprecated for a long while, and we were only using it for
proxy support. However, now that we switched to using SoupSession rather
than SoupSession{Sync,Async}, a default proxy resolver will be used, so
we don't need to set it explicitly.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes:
==16342== 93 (64 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 211 of 278
==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==16342== by 0x5F5CE58: g_malloc (gmem.c:94)
==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025)
==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519)
==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
==16342== by 0x4009E6: test_url_fragment_no_access_token (oauth2.c:36)
==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158)
==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596)
==16342== by 0x400B64: main (oauth2.c:65)
==16342==
==16342== 133 (64 direct, 69 indirect) bytes in 1 blocks are definitely lost in loss record 262 of 278
==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==16342== by 0x5F5CE58: g_malloc (gmem.c:94)
==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025)
==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519)
==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
==16342== by 0x400A25: test_access_token_simple (oauth2.c:44)
==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158)
==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596)
==16342== by 0x400B64: main (oauth2.c:65)
==16342==
==16342== 137 (64 direct, 73 indirect) bytes in 1 blocks are definitely lost in loss record 263 of 278
==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==16342== by 0x5F5CE58: g_malloc (gmem.c:94)
==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025)
==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051)
==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283)
==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519)
==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384)
==16342== by 0x400A97: test_url_encoding_access_token (oauth2.c:51)
==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158)
==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241)
==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253)
==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328)
==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596)
==16342== by 0x400B64: main (oauth2.c:65)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current code is using xml = g_strconcat (xml, ...) which is causing
some leaks as g_strconcat returns a newly allocated string. Using
GString avoids this issue without constantly freeing the intermediate
strings.
This fixes multiple leaks like:
==16611== 18 bytes in 1 blocks are definitely lost in loss record 124 of 301
==16611== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==16611== by 0x5F5CE58: g_malloc (gmem.c:94)
==16611== by 0x5F75B8E: g_strconcat (gstrfuncs.c:585)
==16611== by 0x4E450CF: rest_xml_node_print (rest-xml-node.c:287)
==16611== by 0x4E451DA: rest_xml_node_print (rest-xml-node.c:305)
==16611== by 0x4E450F8: rest_xml_node_print (rest-xml-node.c:292)
==16611== by 0x4009A0: main (xml.c:40)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
soup_form_request_new_from_hash can return NULL, e.g. if the given url
is malformed.
|
|
|
|
|
| |
priv->session was a SoupSession since the last commit, which also
removed every practical usage or priv->session_sync.
|
| |
|
|
|
|
| |
Based on initial work from Timm Bäder <mail@baedert.org>
|
| |
|
| |
|
|
|
|
| |
Where the checked version is < 2.36, which we now require
|
| |
|
| |
|
|
|
|
| |
An equivalent _parse_token_response exists that does not contain a typo.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=658725
|
|
|
|
|
|
|
|
| |
steal_oauth_params() creates a list of strdup'ed strings containing the
name of the ouath parameters which should be stolen from the call
arguments. However, the code makes sure to free the list, but never
frees its content, causing a leak. This commit makes sure the dup'ed
strings are freed.
|
|
|
|
|
|
|
|
| |
This prevents a crash due to cur_node being NULL.
Found by scan-build.
https://bugzilla.gnome.org/show_bug.cgi?id=719550
|
|
|
|
|
| |
It can be helpful when handling the "authenticate" signal to allow
to cancel the authentication instead of failing with an error.
|
|
|
|
| |
These errors should only be shown if REST_DEBUG=xml-parser is set.
|
|
|
|
|
| |
This would result in an inappropriate debug message appearing on valid
text data.
|
|
|
|
| |
This fixes a compilation warning about a missing prototype.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=735922
|
|
|
|
|
|
| |
This is deprecated and causes a compile warning
https://bugzilla.gnome.org/show_bug.cgi?id=735921
|
|
|
|
|
|
|
|
| |
It was in a separate rest-proxy-call.h header which allowed derived
classes to access RestProxyCall private data without any control.
Better to go through explicit methods to do that.
https://bugzilla.gnome.org/show_bug.cgi?id=735919
|
|
|
|
|
|
|
|
| |
OAuthProxyCall was directly accessing private RestProxyCall data. The
same functionality can be achieved using only librest public API, so
let's use that instead.
https://bugzilla.gnome.org/show_bug.cgi?id=735919
|
|
|
|
|
|
|
|
|
|
|
|
| |
The oauth "prepare" step needs RestProxyCall::url to be set, but since
commit c66b6d this is only set after the "prepare" and
"serialize_headers" methods have been called. As it's
better if OAuthProxyCall do not directly access RestProxyCall private
data, this commit adds a getter to RestProxyCall which will be used
to make sure RestProxyCall::url is set when OAuthProxyCall::prepare
needs it.
https://bugzilla.gnome.org/show_bug.cgi?id=708359
|
| |
|
|
|
|
|
|
|
| |
Since the public API now references a type from libsoup, we need
to add Soup-2.4.gir to Rest_@API_VERSION_AM@_gir_INCLUDES.
https://bugzilla.gnome.org/show_bug.cgi?id=728340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function can be helpful if one wants more control over libsoup
features than what librest simple API provide. For example, to get full
access to libsoup cookie API (say to be able to add arbitrary cookies to
the soup session), one can do:
RestProxy *proxy = g_object_new(REST_TYPE_PROXY,
"url-format", url,
"disable-cookies", TRUE,
NULL);
SoupSessionFeature *cookie_jar = SOUP_SESSION_FEATURE(soup_cookie_jar_new ());
rest_proxy_add_soup_feature(proxy, cookie_jar);
It's then possible to use all the soup_cookie_* methods to deal with
cookies.
https://bugzilla.gnome.org/show_bug.cgi?id=728340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RestProxyCall::prepare_message() calls the serialize_params vfunc
so that child classes can serialize the call parameters in whichever
way they want.
One way of doing that could be to append the parameters to the URI
that is called (http://example.com?param1=value1;param2=value2).
However, the URI to call is determined at the beginning of
prepare_message(), and is not refreshed after calling
RestProxyCall::serialize_params(), so it's not possible to
append parameters to the URI that is going to be called.
This commit rebuilds the URI to call after calling serialize_params()
in case it has changed.
https://bugzilla.gnome.org/show_bug.cgi?id=708359
|
|
|
|
|
|
|
|
| |
There are rest_proxy_call_[gs]et_method() methods, a
rest_proxy_call_set_function() method, but no corresponding getter.
Adding it makes the API more consistent.
https://bugzilla.gnome.org/show_bug.cgi?id=708358
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building the HTTP URL to access for a REST operation,
RestProxyCall::prepare_message, a '/' at the end of the base URL
is ignored, but a '/' at the beginning of the REST function is not.
When interacting with the oVirt REST API, I often end up building calls
with for example 'https://ovirt.example.com' as the base URI, and '/api/vms/'
as the function, which then leads to an URI with 2 '/':
'https://ovirt.example.com//api/vms'
https://bugzilla.gnome.org/show_bug.cgi?id=728952
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rest_params_add() is currently using g_hash_table_insert() to add
the passed in parameter in the parameter hash table. The key which
is used is owned by the associated value.
When using rest_params_add to replace an already existing parameter,
the existing value will be freed with rest_param_unref().
However, g_hash_table_insert() does not replace the key when it already
exists in the hash table: "If the key already exists in the GHashTable
its current value is replaced with the new value... If you supplied a
key_destroy_func when creating the GHashTable, the passed key is freed
using that function."
This means that after replacing an already existing parameter, the
corresponding key will still be the old one, which is now pointing
at freed memory as the old value was freed.
g_hash_table_replace() ensures that the key will still be valid, even
when replacing existing parameters:
"Inserts a new key and value into a GHashTable similar to
g_hash_table_insert(). The difference is that if the key already exists
in the GHashTable, it gets replaced by the new key."
https://bugzilla.gnome.org/show_bug.cgi?id=665716
|
|
|
|
|
|
| |
If given a URI it can't parse, soup_error_new() will return NULL.
https://bugzilla.gnome.org/show_bug.cgi?id=728953
|
|
|
|
|
|
|
| |
Both pause() and unpause() are referenced elsewhere in the API
reference, but have no formal documentation annotations.
https://bugzilla.gnome.org/show_bug.cgi?id=712747
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=712747
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=712747
|