1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-11-03 04:17:17 -05:00

fix fd leak on streamlist.txt. A deletion too far when making admin responses

be handled by the file serving thread

svn path=/icecast/branches/kh/icecast/; revision=9459
This commit is contained in:
Karl Heyes 2005-06-16 13:42:27 +00:00
parent 548e6eb783
commit 31c6e21467
3 changed files with 7 additions and 3 deletions

View File

@ -301,6 +301,7 @@ void admin_send_response(xmlDocPtr doc, client_t *client,
client->refbuf = refbuf_new (buf_len);
snprintf (client->refbuf->data, buf_len, "%s%d\r\n\r\n%s", http, len, buff);
xmlFree(buff);
client->respcode = 200;
fserve_add_client (client, NULL);
}
if (response == TRANSFORMED)
@ -321,6 +322,8 @@ void admin_send_response(xmlDocPtr doc, client_t *client,
free(fullpath_xslt_template);
}
}
void admin_handle_request(client_t *client, char *uri)
{
char *mount, *command_string;
@ -1179,7 +1182,8 @@ static void command_list_mounts(client_t *client, int response)
remaining -= ret;
buf += ret;
}
sock_write_bytes (client->con->sock, buffer, sizeof (buffer)-remaining);
client_send_bytes (client, buffer, sizeof (buffer)-remaining);
client_destroy(client);
}
else
{

View File

@ -86,7 +86,7 @@ void stats_event_time (const char *mount, const char *name);
void *stats_connection(void *arg);
void *stats_callback(void *arg);
void stats_transform_xslt(client_t *client, const char *xslpath);
void stats_transform_xslt(client_t *client, const char *uri);
void stats_sendxml(client_t *client);
void stats_get_xml(xmlDocPtr *doc, int show_hidden);
char *stats_get_value(char *source, char *name);

View File

@ -176,7 +176,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
if (string)
{
const char *http = "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nContent-Length: ";
unsigned buf_len = len + strlen (http) + 20;
unsigned buf_len = strlen (http) + 20 + len;
client->respcode = 200;
client->refbuf = refbuf_new (buf_len);