summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2020-08-16 20:43:36 +0200
committerAki <please@ignore.pl>2020-08-16 20:43:36 +0200
commit192cea2f12cec425320e92865b0103ea42ffd4ba (patch)
tree1e2dee02e06c9bca14d27fd1a28db299843c88c0
parentc5daa4e7bbd0e4f8d222daa9db13165e7fe4fb9a (diff)
downloadplop-192cea2f12cec425320e92865b0103ea42ffd4ba.zip
plop-192cea2f12cec425320e92865b0103ea42ffd4ba.tar.gz
plop-192cea2f12cec425320e92865b0103ea42ffd4ba.tar.bz2
Removed obsolete respond functions
-rw-r--r--response.c37
-rw-r--r--response.h4
2 files changed, 0 insertions, 41 deletions
diff --git a/response.c b/response.c
index b2a72d7..5f5cec7 100644
--- a/response.c
+++ b/response.c
@@ -108,40 +108,3 @@ int response_send(lua_State * L, const int fd)
return result;
}
-
-/// Sends a simple response only with a status to the client.
-/// \param fd File descriptor of the client socket
-/// \param status HTTP response status code
-/// \return Negative value if an error was encountered; numbers of bytes written otherwise
-int respond_only_status(const int fd, const enum status status)
-{
- static const char * pattern =
- "HTTP/1.1 %s\r\n"
- "Connection: close\r\n"
- "\r\n";
-
- return dprintf(fd, pattern, status_str[status]);
-}
-
-/// Sends a response with a status and a body to the client.
-/// \param fd File descriptor of the client socket
-/// \param status HTTP response status code
-/// \param body Content that will be sent
-/// \param size Size of the content in bytes
-/// \return Negative value if an error was encountered; numbers of bytes written otherwise
-int respond_with_body(const int fd, const enum status status, const char * body, const int size)
-{
- static const char * pattern =
- "HTTP/1.1 %s\r\n"
- "Connection: close\r\n"
- "Content-Type: application/json\r\n"
- "Content-Size: %d\r\n"
- "\r\n";
-
- if (0 > dprintf(fd, pattern, status_str[status], size))
- {
- return -1; // TODO: Handle errors properly
- }
-
- return write(fd, body, size);
-}
diff --git a/response.h b/response.h
index c9b9c06..0ef9fe3 100644
--- a/response.h
+++ b/response.h
@@ -2,8 +2,4 @@
#include <lua.h>
-#include "http.h"
-
int response_send(lua_State *, const int);
-int respond_only_status(int, enum status);
-int respond_with_body(int, enum status, const char *, int);