From f8250d8df0f28a0c0a139eceab71258251e903aa Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 16 Aug 2002 15:28:46 +0000 Subject: [PATCH] Minor fixes for logging response codes correctly (hopefully) svn path=/trunk/icecast/; revision=3840 --- src/client.c | 2 ++ src/connection.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/client.c b/src/client.c index c18ce927..7672b959 100644 --- a/src/client.c +++ b/src/client.c @@ -52,6 +52,7 @@ void client_send_404(client_t *client, char *message) { "Content-Type: text/html\r\n\r\n" "%s\r\n", message); if(bytes > 0) client->con->sent_bytes = bytes; + client->respcode = 404; client_destroy(client); } @@ -62,5 +63,6 @@ void client_send_401(client_t *client) { "\r\n" "You need to authenticate\r\n"); if(bytes > 0) client->con->sent_bytes = bytes; + client->respcode = 401; client_destroy(client); } diff --git a/src/connection.c b/src/connection.c index b3a25f5f..7eb46377 100644 --- a/src/connection.c +++ b/src/connection.c @@ -319,6 +319,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t WARN0("No content-type header, cannot handle source"); goto fail; } + client->respcode = 200; bytes = sock_write(client->con->sock, "HTTP/1.0 200 OK\r\n\r\n"); if(bytes > 0) client->con->sent_bytes = bytes; @@ -506,6 +507,7 @@ static void _handle_get_request(connection_t *con, /* If the file exists, then transform it, otherwise, write a 404 */ if (stat(fullpath, &statbuf) == 0) { DEBUG0("Stats request, sending XSL transformed stats"); + client->respcode = 200; bytes = sock_write(client->con->sock, "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"); if(bytes > 0) client->con->sent_bytes = bytes;