[Asterisk-code-review] http.c: Support separated HTTP request (asterisk[master])

sungtae kim asteriskteam at digium.com
Thu Jan 10 02:11:39 CST 2019


sungtae kim has posted comments on this change. ( https://gerrit.asterisk.org/10869 )

Change subject: http.c: Support separated HTTP request
......................................................................


Patch Set 4:

(4 comments)

@Michael, Thank you for reviewing. :) It's not about the "chunked" message. HTTP allows send a http request into more than 2 datagram. It happens many times if the request sent via proxy or sent it large message. This patch is for that feature.

@Corey, Thank you for reviewing. :) I've fixed it.

https://gerrit.asterisk.org/#/c/10869/3/main/http.c
File main/http.c:

https://gerrit.asterisk.org/#/c/10869/3/main/http.c@85
PS3, Line 85: #define MAX_CONTENT_LENGTH 40960
> ast_http_create_response uses MAX_CONTENT_LENGTH for the default buffer size of the response. […]
Agree. Added another length define for response message body.


https://gerrit.asterisk.org/#/c/10869/3/main/http.c@922
PS3, Line 922:  */
> Nit: Please initialize in the declaration, `int total = 0;` above.
I've got it. Fixed it. :)


https://gerrit.asterisk.org/#/c/10869/3/main/http.c@923
PS3, Line 923: static int http_body_read_contents(struct ast_tcptls_session_instance *ser, char *buf, int length, const char *what_getting)
> Nit: while is not a function, we put a space after it `while (1) {`. […]
Agree. Set the correct read length to (read_length - total) to prevent buffer overflow.

And fixed while (1) loop and rid of break statement.


https://gerrit.asterisk.org/#/c/10869/3/main/http.c@924
PS3, Line 924: {
> I think this allows buffer overrun after the first iteration (when total != 0).
Agree. Fixed length to consider total length.



-- 
To view, visit https://gerrit.asterisk.org/10869
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1
Gerrit-Change-Number: 10869
Gerrit-PatchSet: 4
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: Michael L. Young <elgueromexicano at gmail.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Thu, 10 Jan 2019 08:11:39 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190110/024f4822/attachment.html>


More information about the asterisk-code-review mailing list