FS-6228 --resolve
This commit is contained in:
parent
28e8194de9
commit
10242c3040
|
@ -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…
Reference in New Issue