From 99d33c46cb53035c69c03801f75898b04504ad84 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sun, 11 Oct 2020 17:26:48 -0400 Subject: [PATCH] fix: correct error code --- runtime/include/http_response.h | 2 +- runtime/src/runtime.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/include/http_response.h b/runtime/include/http_response.h index 27b401f..f02a769 100644 --- a/runtime/include/http_response.h +++ b/runtime/include/http_response.h @@ -10,7 +10,7 @@ #include "http.h" #define HTTP_RESPONSE_200_OK "HTTP/1.1 200 OK\r\n" -#define HTTP_RESPONSE_504_SERVICE_UNAVAILABLE "HTTP/1.1 504 Service Unavailable\r\n\r\n" +#define HTTP_RESPONSE_503_SERVICE_UNAVAILABLE "HTTP/1.1 503 Service Unavailable\r\n\r\n" #define HTTP_RESPONSE_400_BAD_REQUEST "HTTP/1.1 400 Bad Request\r\n\r\n" #define HTTP_RESPONSE_CONTENT_LENGTH "Content-Length: " #define HTTP_RESPONSE_CONTENT_LENGTH_TERMINATOR "\r\n\r\n" /* content body follows this */ diff --git a/runtime/src/runtime.c b/runtime/src/runtime.c index 157e476..2cf0592 100644 --- a/runtime/src/runtime.c +++ b/runtime/src/runtime.c @@ -162,10 +162,10 @@ listener_thread_reject(int client_socket) int rc; int sent = 0; - int to_send = strlen(HTTP_RESPONSE_504_SERVICE_UNAVAILABLE); + int to_send = strlen(HTTP_RESPONSE_503_SERVICE_UNAVAILABLE); while (sent < to_send) { - rc = write(client_socket, &HTTP_RESPONSE_504_SERVICE_UNAVAILABLE[sent], to_send - sent); + rc = write(client_socket, &HTTP_RESPONSE_503_SERVICE_UNAVAILABLE[sent], to_send - sent); if (rc < 0) { if (errno == EAGAIN) continue;