Commit 9d5750c1 authored by Thomas Milius's avatar Thomas Milius
Browse files

Replace start improved error handling of new SWIs

parent 76103f61
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include "URLclient.h" #include "URLclient.h"
#include "security.h" #include "security.h"
#include "connect.h" #include "connect.h"
#include "Httperror.h"
#include "utils.h"
#include "start.h" #include "start.h"
#define HTTP_OTHER_METHOD_FLAG_TYPE_USER 0 #define HTTP_OTHER_METHOD_FLAG_TYPE_USER 0
...@@ -116,7 +118,7 @@ int string_length; ...@@ -116,7 +118,7 @@ int string_length;
/* Warning: Should not run in parallel! /* Warning: Should not run in parallel!
But how to ensure this at multicore environment? */ But how to ensure this at multicore environment? */
if (r == NULL) return NULL; if (r == NULL) return make_error(HTTP_GENERAL_ERROR, 0);
/* Indicates failure. */ /* Indicates failure. */
r->r[2]=-1; r->r[2]=-1;
if (r->r[0] != NULL) { if (r->r[0] != NULL) {
...@@ -152,9 +154,11 @@ if (r->r[0] != NULL) { ...@@ -152,9 +154,11 @@ if (r->r[0] != NULL) {
r->r[2]=first_unused_method; r->r[2]=first_unused_method;
} }
} }
return NULL;
} }
else return make_error(HTTP_NO_RESOURCES, 0);
} }
return NULL; else return make_error(HTTP_BAD_PARAMETER, 0);
} }
/*************************************************************/ /*************************************************************/
...@@ -173,8 +177,8 @@ int i; ...@@ -173,8 +177,8 @@ int i;
/* Warning: Should not run in parallel! /* Warning: Should not run in parallel!
But how to ensure this at multicore environment? */ But how to ensure this at multicore environment? */
if (r != NULL && if (r == NULL) return make_error(HTTP_GENERAL_ERROR,0);
r->r[0] != NULL) { if (r->r[0] != NULL) {
i=0; i=0;
while (i < 128) { while (i < 128) {
if (http_other_methods[i].usage_counter > 0 && if (http_other_methods[i].usage_counter > 0 &&
...@@ -194,8 +198,9 @@ if (r != NULL && ...@@ -194,8 +198,9 @@ if (r != NULL &&
} }
i++; i++;
} }
return make_error(HTTP_METHOD_UNSUPPORTED,0);
} }
return NULL; else return make_error(HTTP_BAD_PARAMETER,0);
} }
/*************************************************************/ /*************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment