Commit f8250d8d authored by Michael Smith's avatar Michael Smith

Minor fixes for logging response codes correctly (hopefully)

svn path=/trunk/icecast/; revision=3840
parent 25f0c9f4
......@@ -52,6 +52,7 @@ void client_send_404(client_t *client, char *message) {
"Content-Type: text/html\r\n\r\n"
"<b>%s</b>\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);
}
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment