fix(handler): print path before free
This commit is contained in:
@@ -50,9 +50,8 @@ cws_response_s *cws_handler_static_file(cws_request_s *request, cws_handler_conf
|
|||||||
}
|
}
|
||||||
|
|
||||||
cws_response_set_body_file(response, path);
|
cws_response_set_body_file(response, path);
|
||||||
string_free(filepath);
|
|
||||||
|
|
||||||
CWS_LOG_DEBUG("Serving file: %s (%zu bytes)", path, response->content_length);
|
CWS_LOG_DEBUG("Serving file: %s (%zu bytes)", path, response->content_length);
|
||||||
|
string_free(filepath);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ static bool parse_method(cws_request_s *req, char **cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s[len] = '\0';
|
s[len] = '\0';
|
||||||
CWS_LOG_DEBUG("method: %s", s);
|
CWS_LOG_DEBUG("Method: %s", s);
|
||||||
req->method = http_parse_method(s);
|
req->method = http_parse_method(s);
|
||||||
*cursor = s + len + 1;
|
*cursor = s + len + 1;
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ static bool parse_location(cws_request_s *req, char **cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s[len] = '\0';
|
s[len] = '\0';
|
||||||
CWS_LOG_DEBUG("location: %s", s);
|
CWS_LOG_DEBUG("Location: %s", s);
|
||||||
string_append(req->path, s);
|
string_append(req->path, s);
|
||||||
*cursor = s + len + 1;
|
*cursor = s + len + 1;
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ static bool parse_version(cws_request_s *req, char **cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s[len] = '\0';
|
s[len] = '\0';
|
||||||
CWS_LOG_DEBUG("version: %s", s);
|
CWS_LOG_DEBUG("Version: %s", s);
|
||||||
string_append(req->http_version, s);
|
string_append(req->http_version, s);
|
||||||
*cursor = s + len + 1;
|
*cursor = s + len + 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user