summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2020-05-01 15:43:07 +0200
committerAki <please@ignore.pl>2020-05-01 16:42:19 +0200
commit922bb99578b881065048102e03c73ff91c5ad30a (patch)
treed2033cf94f7330c194e53f91d8d4bf40d34370ca /plop.c
parent03360ae6aa07289eac060870972d4ba246ca88d3 (diff)
downloadplop-922bb99578b881065048102e03c73ff91c5ad30a.zip
plop-922bb99578b881065048102e03c73ff91c5ad30a.tar.gz
plop-922bb99578b881065048102e03c73ff91c5ad30a.tar.bz2
Moved out http-related functionality out of main file
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/plop.c b/plop.c
index bc30138..16f486c 100644
--- a/plop.c
+++ b/plop.c
@@ -7,6 +7,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include "http.h"
+
/// Tries to create, bind and start listening on INET server socket.
/// \param node Hostname
/// \param service Port
@@ -83,13 +85,7 @@ int handle_client(struct pollfd * pfd, const int shift_by)
return -1; // TODO: Handle errors properly
}
- static const char * response =
- "HTTP/1.1 200 OK\r\n"
- "Content-Type: text/plain; charset=utf-8\r\n"
- "\r\n"
- "plop\n";
-
- if (-1 == send(pfd->fd, response, strlen(response), 0))
+ if (-1 == respond_only_status(pfd->fd, STATUS_NOT_IMPLEMENTED))
{
// TODO: Handle errors properly
}