summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-05-08 20:02:54 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-05-08 20:02:54 +0200
commit3bf2bd8ed6ca78cc91f27a4748f2e9bbe624a300 (patch)
treeca49915f9876cba677ec6957233614cc0062884b
parent992f7d6c3a1df7c351dfebba636832d0a7858dc9 (diff)
downloadhittpd-3bf2bd8ed6ca78cc91f27a4748f2e9bbe624a300.tar.gz
hittpd-3bf2bd8ed6ca78cc91f27a4748f2e9bbe624a300.tar.xz
hittpd-3bf2bd8ed6ca78cc91f27a4748f2e9bbe624a300.zip
detect and report ENAMETOOLONG
-rw-r--r--hittpd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hittpd.c b/hittpd.c
index afee1ac..a415186 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -580,6 +580,8 @@ on_message_complete(http_parser *p) {
 			send_error(p, 403, "Forbidden");
 		else if (errno == ENOENT || errno == ENOTDIR)
 			send_error(p, 404, "Not Found");
+		else if (errno == ENAMETOOLONG)
+			send_error(p, 413, "Payload Too Large");
 		else {
 			perror("open");
 			send_error(p, 500, "Internal Server Error");