[Pkg-owncloud-commits] [owncloud-client] 60/89: Do not error out on ETag if the status klass is != 2.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Dec 14 01:02:37 UTC 2013
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit b68e721f05c623828339206f620682e009ede5f4
Author: Klaas Freitag <freitag at owncloud.com>
Date: Wed Dec 11 12:59:01 2013 +0100
Do not error out on ETag if the status klass is != 2.
---
src/mirall/owncloudpropagator.cpp | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index db5e75e..3c1146e 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -605,14 +605,25 @@ private:
return;
}
- QByteArray etag = parseEtag(ne_get_response_header(req, "etag"));;
+ if( ne_get_status(req)->klass != 2 ) {
+ qDebug() << "Request class != 2, aborting.";
+ ne_add_response_body_reader( req, do_not_accept,
+ do_not_download_content_reader,
+ (void*) that );
+ return;
+ }
+
+ QByteArray etag = parseEtag(ne_get_response_header(req, "etag"));
+ if(etag.isEmpty())
+ etag = parseEtag(ne_get_response_header(req, "ETag"));
+
if (etag.isEmpty()) {
qDebug() << Q_FUNC_INFO << "No E-Tag reply by server, considering it invalid" << ne_get_response_header(req, "etag");
that->errorString = QLatin1String("No E-Tag received from server, check Proxy/Gateway");
ne_set_error(that->_propagator->_session, "No E-Tag received from server, check Proxy/Gateway");
ne_add_response_body_reader( req, do_not_accept,
- do_not_download_content_reader,
- (void*) that );
+ do_not_download_content_reader,
+ (void*) that );
return;
} else if (!that->_expectedEtagForResume.isEmpty() && that->_expectedEtagForResume != etag) {
qDebug() << Q_FUNC_INFO << "We received a different E-Tag for resuming!"
@@ -621,8 +632,8 @@ private:
that->errorString = QLatin1String("We received a different E-Tag for resuming. Retrying next time.");
ne_set_error(that->_propagator->_session, "We received a different E-Tag for resuming. Retrying next time.");
ne_add_response_body_reader( req, do_not_accept,
- do_not_download_content_reader,
- (void*) that );
+ do_not_download_content_reader,
+ (void*) that );
return;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list