summaryrefslogtreecommitdiff
path: root/main/http.c
diff options
context:
space:
mode:
authorBen Ford <bford@digium.com>2017-10-25 09:23:55 -0500
committerBen Ford <bford@digium.com>2017-10-25 10:30:24 -0500
commit373a1a9797009995090e5a06ad282853e4b96565 (patch)
tree873c9b8fc2ff641c61a961bf58f2653e64d1ed58 /main/http.c
parentf2c95fb7e409c1ef289f1eb96dde915221d636f1 (diff)
http.c: Fix http header send content.
Currently ast_http_send barricades a portion of the content that needs to be sent in order to establish a connection for things like the ARI client. The conditional and contents have been changed to ensure that everything that needs to be sent, will be sent. ASTERISK-27372 Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/main/http.c b/main/http.c
index 7191eb524..30b2fe2c4 100644
--- a/main/http.c
+++ b/main/http.c
@@ -529,10 +529,8 @@ void ast_http_send(struct ast_tcptls_session_instance *ser,
) <= 0) {
ast_debug(1, "ast_iostream_printf() failed: %s\n", strerror(errno));
close_connection = 1;
- }
-
- /* send content */
- if (!close_connection && send_content && fd) {
+ } else if (send_content && fd) {
+ /* send file content */
while ((len = read(fd, buf, sizeof(buf))) > 0) {
if (ast_iostream_write(ser->stream, buf, len) != len) {
ast_debug(1, "ast_iostream_write() failed: %s\n", strerror(errno));