<p style="white-space: pre-wrap; word-wrap: break-word;">@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.</p><p style="white-space: pre-wrap; word-wrap: break-word;">@Corey, Thank you for reviewing. :) I've fixed it.</p><p><a href="https://gerrit.asterisk.org/10869">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10869/3/main/http.c">File main/http.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10869/3/main/http.c@85">Patch Set #3, Line 85:</a> <code style="font-family:monospace,monospace">#define MAX_CONTENT_LENGTH 40960</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">ast_http_create_response uses MAX_CONTENT_LENGTH for the default buffer size of the response. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Agree. Added another length define for response message body.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10869/3/main/http.c@922">Patch Set #3, Line 922:</a> <code style="font-family:monospace,monospace"> */</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Nit: Please initialize in the declaration, `int total = 0;` above.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I've got it. Fixed it. :)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10869/3/main/http.c@923">Patch Set #3, Line 923:</a> <code style="font-family:monospace,monospace">static int http_body_read_contents(struct ast_tcptls_session_instance *ser, char *buf, int length, const char *what_getting)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Nit: while is not a function, we put a space after it `while (1) {`. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Agree. Set the correct read length to (read_length - total) to prevent buffer overflow.</p><p style="white-space: pre-wrap; word-wrap: break-word;">And fixed while (1) loop and rid of break statement.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10869/3/main/http.c@924">Patch Set #3, Line 924:</a> <code style="font-family:monospace,monospace">{</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I think this allows buffer overrun after the first iteration (when total != 0).</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Agree. Fixed length to consider total length.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10869">change 10869</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10869"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1 </div>
<div style="display:none"> Gerrit-Change-Number: 10869 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Michael L. Young <elgueromexicano@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 10 Jan 2019 08:11:39 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>