You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

diff -up openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c.orig openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c
--- openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c.orig 2016-07-27 16:03:55.000000000 +0200
+++ openwsman-4391e5c68d99c6239e1672d1c8a5a16d7d8c4c2b/src/server/wsmand-listener.c 2018-01-22 13:05:04.478923300 +0100
@@ -344,6 +344,35 @@ DONE:
if (fault_reason == NULL) {
// this is a way to segfault, investigate
//fault_reason = shttpd_reason_phrase(status);
+ // ugly workaround follows...
+ switch (status) {
+ case 200:
+ fault_reason = "OK";
+ break;
+ case 400:
+ fault_reason = "Bad request";
+ break;
+ case 401:
+ fault_reason = "Unauthorized";
+ break;
+ case 403:
+ fault_reason = "Forbidden";
+ break;
+ case 404:
+ fault_reason = "Not found";
+ break;
+ case 500:
+ fault_reason = "Internal Error";
+ break;
+ case 501:
+ fault_reason = "Not implemented";
+ break;
+ case 415:
+ fault_reason = "Unsupported Media Type";
+ break;
+ default:
+ fault_reason = "";
+ }
}
debug("Response status=%d (%s)", status, fault_reason);