Add Af-Trigger
This commit is contained in:
@ -16,7 +16,7 @@ static void http_write_response(
|
||||
fprintf(stream, "HTTP/1.1 %s\r\n", status ? status : "200 OK");
|
||||
fprintf(stream, "Content-Type: %s\r\n", content_type ? content_type : "text/plain");
|
||||
if (content_length > 0)
|
||||
fprintf(stream, "Content-Type: %d\r\n", content_length);
|
||||
fprintf(stream, "Content-Length: %d\r\n", content_length);
|
||||
fprintf(stream, "\r\n");
|
||||
if (body) {
|
||||
fwrite(body, 1, content_length, stream);
|
||||
@ -41,6 +41,11 @@ void http_content(http_worker_t *worker, FILE *stream)
|
||||
}
|
||||
}
|
||||
|
||||
void http_200(FILE *stream, const char *data)
|
||||
{
|
||||
http_write_response(stream, "200 OK", NULL, data ? data : "Nothing here.\n", 0);
|
||||
}
|
||||
|
||||
void http_404(FILE *stream, const char *data)
|
||||
{
|
||||
http_write_response(stream, "404 Not Found", NULL, data ? data : "Nothing here.\n", 0);
|
||||
|
Reference in New Issue
Block a user