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

Joshua Colp asteriskteam at digium.com
Wed Oct 25 16:13:18 CDT 2017


Joshua Colp has submitted this change and it was merged. ( 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(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/main/http.c b/main/http.c
index 7191eb5..30b2fe2 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 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));

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
Gerrit-Change-Number: 6910
Gerrit-PatchSet: 3
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171025/05601aa6/attachment.html>


More information about the asterisk-code-review mailing list