[Asterisk-code-review] http.c: Fix http header send content. (asterisk[master])

Benjamin Keith Ford asteriskteam at digium.com
Wed Oct 25 09:25:21 CDT 2017


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/6910


Change subject: http.c: Fix http header send content.
......................................................................

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
---
M main/http.c
1 file changed, 2 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/6910/1

diff --git a/main/http.c b/main/http.c
index 7191eb5..072b7fd 100644
--- a/main/http.c
+++ b/main/http.c
@@ -529,10 +529,8 @@
 		) <= 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 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));

-- 
To view, visit https://gerrit.asterisk.org/6910
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
Gerrit-Change-Number: 6910
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171025/84c4c3b1/attachment.html>


More information about the asterisk-code-review mailing list