|
|
a832b2 |
From ea43ca02cf52d0455c6949683692a95e38ccdf70 Mon Sep 17 00:00:00 2001
|
|
|
a832b2 |
From: Sergio Correia <scorreia@redhat.com>
|
|
|
a832b2 |
Date: Fri, 4 Dec 2020 09:05:19 -0300
|
|
|
a832b2 |
Subject: [PATCH 2/2] Exit with success unless the issue was with with tangd
|
|
|
a832b2 |
itself
|
|
|
a832b2 |
|
|
|
a832b2 |
When an HTTP parser error happens, tangd is currently exiting with an
|
|
|
a832b2 |
error status, which may cause trouble in some scenarios [1].
|
|
|
a832b2 |
|
|
|
a832b2 |
However, we don't exit with an error in situations where we try requests
|
|
|
a832b2 |
that do not exist, for instance. It makes sense to only exit with an
|
|
|
a832b2 |
error when the error was with tangd itself, e.g.: when we are unable to
|
|
|
a832b2 |
read the directory with the keys, not when the actual HTTP operation
|
|
|
a832b2 |
does not succeed for some reason.
|
|
|
a832b2 |
|
|
|
a832b2 |
Upstream: https://github.com/latchset/tang/pull/55
|
|
|
a832b2 |
|
|
|
a832b2 |
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1828558
|
|
|
a832b2 |
---
|
|
|
a832b2 |
src/tangd.c | 2 +-
|
|
|
a832b2 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
a832b2 |
|
|
|
a832b2 |
diff --git a/src/tangd.c b/src/tangd.c
|
|
|
a832b2 |
index b569f38..d40201f 100644
|
|
|
a832b2 |
--- a/src/tangd.c
|
|
|
a832b2 |
+++ b/src/tangd.c
|
|
|
a832b2 |
@@ -225,7 +225,7 @@ main(int argc, char *argv[])
|
|
|
a832b2 |
if (parser.http_errno != 0) {
|
|
|
a832b2 |
fprintf(stderr, "HTTP Parsing Error: %s\n",
|
|
|
a832b2 |
http_errno_description(parser.http_errno));
|
|
|
a832b2 |
- return EXIT_FAILURE;
|
|
|
a832b2 |
+ return EXIT_SUCCESS;
|
|
|
a832b2 |
}
|
|
|
a832b2 |
|
|
|
a832b2 |
memmove(req, &req[r], rcvd - r);
|
|
|
a832b2 |
--
|
|
|
a832b2 |
2.27.0
|
|
|
a832b2 |
|