Compare commits

...

No commits in common. 'c9' and 'i8c' have entirely different histories.
c9 ... i8c

2
.gitignore vendored

@ -1 +1 @@
SOURCES/libgdata-0.18.1.tar.xz
SOURCES/libgdata-0.17.9.tar.xz

@ -1 +1 @@
83884ff5defe2c1b3a5f9586d615e21474b608e5 SOURCES/libgdata-0.18.1.tar.xz
942a98ae334d5ac97a041519d64ea48ddc654016 SOURCES/libgdata-0.17.9.tar.xz

@ -0,0 +1,84 @@
From 62a30455c32bdfb2a113d4708ba8dba57decc9e5 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Mon, 20 Jan 2020 13:51:20 +0100
Subject: [PATCH] core: Always refresh authorization when creating streams
Non-resumable upload streams quite often fail with authorization errors
as we are probably hitting some limits. The only way currently to deal
with them is to refresh authorization manually and upload everything
again as it is not possible to resume the transfer. This is big issue
for streaming operations provided by GVfs. I have made several tests
and realized that if we explicitely refresh the authorization before
the transfer, then those authorization errors doesn't occur. So let's
always refresh the authorization when constructing the streams and do
the same for upload streams as well as they are also affected. In theory,
the resumable streams could solve this better, however they currently
require content size to be specified at the beginning, which is not
usable for the streaming operations in GVfs.
Fixes: https://gitlab.gnome.org/GNOME/libgdata/issues/23
---
gdata/gdata-download-stream.c | 13 +++++++++++++
gdata/gdata-upload-stream.c | 14 ++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/gdata/gdata-download-stream.c b/gdata/gdata-download-stream.c
index 5bfd7048..a797de68 100644
--- a/gdata/gdata-download-stream.c
+++ b/gdata/gdata-download-stream.c
@@ -855,11 +855,24 @@ static gpointer
download_thread (GDataDownloadStream *self)
{
GDataDownloadStreamPrivate *priv = self->priv;
+ GDataAuthorizer *authorizer;
g_object_ref (self);
g_assert (priv->network_cancellable != NULL);
+ /* FIXME: Refresh authorization before sending message in order to prevent authorization errors during transfer.
+ * See: https://gitlab.gnome.org/GNOME/libgdata/issues/23 */
+ authorizer = gdata_service_get_authorizer (priv->service);
+ if (authorizer) {
+ g_autoptr(GError) error = NULL;
+
+ gdata_authorizer_refresh_authorization (authorizer, priv->cancellable, &error);
+ if (error != NULL)
+ g_debug ("Error returned when refreshing authorization: %s", error->message);
+ else
+ gdata_authorizer_process_request (authorizer, priv->authorization_domain, priv->message);
+ }
/* Connect to the got-headers signal so we can notify clients of the values of content-type and content-length */
g_signal_connect (priv->message, "got-headers", (GCallback) got_headers_cb, self);
g_signal_connect (priv->message, "got-chunk", (GCallback) got_chunk_cb, self);
diff --git a/gdata/gdata-upload-stream.c b/gdata/gdata-upload-stream.c
index 85807fec..85738fd3 100644
--- a/gdata/gdata-upload-stream.c
+++ b/gdata/gdata-upload-stream.c
@@ -1147,9 +1147,23 @@ static gpointer
upload_thread (GDataUploadStream *self)
{
GDataUploadStreamPrivate *priv = self->priv;
+ GDataAuthorizer *authorizer;
g_assert (priv->cancellable != NULL);
+ /* FIXME: Refresh authorization before sending message in order to prevent authorization errors during transfer.
+ * See: https://gitlab.gnome.org/GNOME/libgdata/issues/23 */
+ authorizer = gdata_service_get_authorizer (priv->service);
+ if (authorizer) {
+ g_autoptr(GError) error = NULL;
+
+ gdata_authorizer_refresh_authorization (authorizer, priv->cancellable, &error);
+ if (error != NULL)
+ g_debug ("Error returned when refreshing authorization: %s", error->message);
+ else
+ gdata_authorizer_process_request (authorizer, priv->authorization_domain, priv->message);
+ }
+
while (TRUE) {
GDataServiceClass *klass;
gulong wrote_headers_signal, wrote_body_data_signal;
--
2.36.0

@ -1,14 +1,16 @@
Name: libgdata
Version: 0.18.1
Version: 0.17.9
Release: 4%{?dist}
Summary: Library for the GData protocol
License: LGPLv2+
URL: https://wiki.gnome.org/Projects/libgdata
Source0: https://download.gnome.org/sources/%{name}/0.18/%{name}-%{version}.tar.xz
Source0: https://download.gnome.org/sources/%{name}/0.17/%{name}-%{version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=2046098
Patch0: core-Always-refresh-authorization-when-creating-stre.patch
BuildRequires: gcr-devel
BuildRequires: gettext
BuildRequires: glib2-devel
BuildRequires: gnome-online-accounts-devel
BuildRequires: gobject-introspection-devel
@ -16,10 +18,12 @@ BuildRequires: gtk-doc
%if ! 0%{?rhel}
BuildRequires: uhttpmock-devel
%endif
BuildRequires: intltool
BuildRequires: json-glib-devel
BuildRequires: liboauth-devel
BuildRequires: libsoup-devel
BuildRequires: libxml2-devel
BuildRequires: meson
BuildRequires: vala-devel
BuildRequires: vala
%if 0%{?fedora}
@ -43,21 +47,17 @@ developing applications that use %{name}.
%autosetup -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%meson \
%configure \
%if 0%{?rhel}
-Dalways_build_tests=false \
%else
-Dalways_build_tests=true \
--disable-always-build-tests \
%endif
-Dinstalled_tests=false \
-Dgtk_doc=true \
-Doauth1=disabled \
%{nil}
%meson_build
--disable-silent-rules \
--disable-static
make %{?_smp_mflags} CFLAGS="$CFLAGS -fno-strict-aliasing"
%install
%meson_install
%make_install
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%find_lang gdata
@ -68,7 +68,9 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
#cd gdata/tests
#./general
%ldconfig_scriptlets
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f gdata.lang
@ -88,59 +90,14 @@ export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%{_datadir}/vala/
%changelog
* Sun Aug 22 2021 Debarshi Ray <rishi@fedoraproject.org> - 0.18.1-4
- Drop the unused BuildRequires on liboauth
Resolves: #1996380
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.18.1-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.18.1-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Mar 05 2021 Kalev Lember <klember@redhat.com> - 0.18.1-1
- Update to 0.18.1
* Wed Feb 17 2021 Kalev Lember <klember@redhat.com> - 0.18.0-1
- Update to 0.18.0
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Dec 12 2020 Debarshi Ray <rishi@fedoraproject.org> - 0.17.13-2
- Remove uhttpmock-devel from BuildRequires on RHEL 9
* Thu Sep 03 2020 Kalev Lember <klember@redhat.com> - 0.17.13-1
- Update to 0.17.13
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 16 2020 Merlin Mathesius <mmathesi@redhat.com> - 0.17.12-2
- Minor conditional fixes for ELN
* Mon Mar 02 2020 Kalev Lember <klember@redhat.com> - 0.17.12-1
- Update to 0.17.12
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Aug 21 2019 Kalev Lember <klember@redhat.com> - 0.17.11-1
- Update to 0.17.11
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jul 08 2019 Kalev Lember <klember@redhat.com> - 0.17.10-1
- Update to 0.17.10
- Switch to the meson build system
* Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 0.17.9-4
- Rebuilt for MSVSphere 8.8
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jul 13 2022 Tomas Popela <tpopela@redhat.com> - 0.17.9-4
- Switch to using autosetup so we don't forget to apply patches (#2046098)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon May 09 2022 Ondrej Holy <oholy@redhat.com> - 0.17.9-3
- Always refresh authorization when creating streams (#2046098)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

Loading…
Cancel
Save