diff options
author | Aki <please@ignore.pl> | 2020-05-01 15:43:07 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2020-05-01 16:42:19 +0200 |
commit | 922bb99578b881065048102e03c73ff91c5ad30a (patch) | |
tree | d2033cf94f7330c194e53f91d8d4bf40d34370ca /plop.c | |
parent | 03360ae6aa07289eac060870972d4ba246ca88d3 (diff) | |
download | plop-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.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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 } |