mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-28 09:38:30 +00:00
FS-6228 --resolve
This commit is contained in:
parent
fe2a4d6d47
commit
79c8951260
@ -1283,16 +1283,18 @@ static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
{
|
{
|
||||||
register unsigned int realsize = (unsigned int) (size * nmemb);
|
register unsigned int realsize = (unsigned int) (size * nmemb);
|
||||||
client_t *client = data;
|
client_t *client = data;
|
||||||
|
char *zero = "\0";
|
||||||
|
|
||||||
client->bytes += realsize;
|
client->bytes += realsize;
|
||||||
|
|
||||||
if (client->bytes > client->max_bytes) {
|
if (client->bytes > client->max_bytes - 1) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Oversized file detected [%d bytes]\n", (int) client->bytes);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Oversized file detected [%d bytes]\n", (int) client->bytes);
|
||||||
client->err = 1;
|
client->err = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_buffer_write(client->buffer, ptr, realsize);
|
switch_buffer_write(client->buffer, ptr, realsize);
|
||||||
|
switch_buffer_write(client->buffer, zero, 1);
|
||||||
|
|
||||||
return realsize;
|
return realsize;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user