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

George Joseph asteriskteam at digium.com
Wed Oct 25 14:58:08 CDT 2017


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/6909 )

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
  George Joseph: Looks good to me, approved; Approved for Submit



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/6909
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
Gerrit-Change-Number: 6909
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/9a3fe724/attachment.html>


More information about the asterisk-code-review mailing list