Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-08-15 23:42:51 +0300
committerEdward Thomson <ethomson@edwardthomson.com>2015-08-15 23:42:51 +0300
commitf594b6ff159960efdc87e769141c34b87f30bbf2 (patch)
tree4afd0a8460842b53127b2fdbec44ecd5e22b5099
parent755004eaed008779bed9e5efb8b539917dbf431b (diff)
parent11bca2d265d7a1136ddf3e34a39263eba6320e20 (diff)
Merge pull request #3383 from libgit2/cmn/http-error
http: propagate the credentials callback's error code
-rw-r--r--src/transports/http.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index e3d90de11..87f3ee816 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -36,6 +36,8 @@ static const char *post_verb = "POST";
#define PARSE_ERROR_GENERIC -1
#define PARSE_ERROR_REPLAY -2
+/** Look at the user field */
+#define PARSE_ERROR_EXT -3
#define CHUNK_SIZE 4096
@@ -78,6 +80,7 @@ typedef struct {
git_vector www_authenticate;
enum last_cb last_cb;
int parse_error;
+ int error;
unsigned parse_finished : 1;
/* Authentication */
@@ -351,7 +354,8 @@ static int on_headers_complete(http_parser *parser)
if (error == GIT_PASSTHROUGH) {
no_callback = 1;
} else if (error < 0) {
- return PARSE_ERROR_GENERIC;
+ t->error = error;
+ return t->parse_error = PARSE_ERROR_EXT;
} else {
assert(t->cred);
@@ -712,6 +716,10 @@ replay:
goto replay;
}
+ if (t->parse_error == PARSE_ERROR_EXT) {
+ return t->error;
+ }
+
if (t->parse_error < 0)
return -1;