1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Minor fixes for logging response codes correctly (hopefully)

svn path=/trunk/icecast/; revision=3840
This commit is contained in:
Michael Smith 2002-08-16 15:28:46 +00:00
parent 25f0c9f4bb
commit f8250d8df0
2 changed files with 4 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;