If file non existant crashing resolved
This commit is contained in:
@@ -11,12 +11,19 @@ typedef struct {
|
||||
HttpContentType content_type;
|
||||
size_t content_length;
|
||||
char *body;
|
||||
bool body_in_heap;
|
||||
} HttpResponse;
|
||||
|
||||
// It will create a string respecting the Hypertext Transfer Protocol.
|
||||
//
|
||||
// To then be sent to the client.
|
||||
bool construct_response(HttpResponse __res, char *out);
|
||||
|
||||
void http_respond(HttpResponse __res, int clientfd);
|
||||
// Respond a http response to the client (clientfd);
|
||||
void http_respond(HttpResponse *__res, int clientfd);
|
||||
// Read a file from a specified path
|
||||
char *read_file(const char *__path);
|
||||
// Given a path will return a HttpResponse
|
||||
HttpResponse *from_file(const char *__path);
|
||||
void free_response(HttpResponse *__res);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user