Test WIP
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
NADAL Jean-Baptiste
2020-01-22 19:07:30 +01:00
parent 75eb680bd8
commit 09d7cce817
9 changed files with 166 additions and 72 deletions

View File

@@ -681,16 +681,19 @@ static int parse_requestline(restd_http_t *http, char *line)
char *uri = strtok_r(NULL, " ", &saveptr);
char *httpver = strtok_r(NULL, " ", &saveptr);
char *tmp = strtok_r(NULL, " ", &saveptr);
printf("=============parse_requestline\n");
if (method == NULL || uri == NULL || httpver == NULL || tmp != NULL)
{
DEBUG("Invalid request line. %s", line);
printf("=============pInvalid request line. %s\n", line);
return RESTD_HTTP_ERROR;
}
// Set request method
http->request.method = qstrupper(strdup(method));
printf("============= SAVE METHOD HTTP: %s\n", http->request.method);
// Set HTTP version
http->request.httpver = qstrupper(strdup(httpver));
if (strcmp(http->request.httpver, HTTP_PROTOCOL_09) && strcmp(http->request.httpver, HTTP_PROTOCOL_10) && strcmp(http->request.httpver, HTTP_PROTOCOL_11))