mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-20 19:11:20 +00:00
FS-9345 #resolve [HTTAPI truncates string when response spans multiple packets]
This commit is contained in:
parent
2a73820c34
commit
328146c2fd
@ -1288,7 +1288,6 @@ 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;
|
||||||
|
|
||||||
@ -1299,7 +1298,6 @@ static size_t file_callback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -2313,6 +2311,9 @@ SWITCH_STANDARD_APP(httapi_function)
|
|||||||
const char *ct = switch_event_get_header(client->headers, "content-type");
|
const char *ct = switch_event_get_header(client->headers, "content-type");
|
||||||
|
|
||||||
if (switch_stristr("text/xml", ct)) {
|
if (switch_stristr("text/xml", ct)) {
|
||||||
|
char *zero = "\0";
|
||||||
|
switch_buffer_write(client->buffer, zero, 1);
|
||||||
|
|
||||||
status = parse_xml(client);
|
status = parse_xml(client);
|
||||||
} else {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received unsupported content-type %s\n", ct);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received unsupported content-type %s\n", ct);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user