<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/5964">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">http.c: Reduce log spam<br><br>Messages like "fwrite() failed: Connection reset by peer" are no<br>help whatsoever, especially since they can be caused simply by a<br>client disconnecting.<br><br>* Make those WARNINGs DEBUGs.<br>* Check the return from ast_iostream_printf of headers.<br><br>Change-Id: I17bd5f3621514152a7b2b263c801324c5e96568b<br>---<br>M main/http.c<br>1 file changed, 7 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/http.c b/main/http.c<br>index ea85a28..7191eb5 100644<br>--- a/main/http.c<br>+++ b/main/http.c<br>@@ -508,7 +508,7 @@<br> send_content = method != AST_HTTP_HEAD || status_code >= 400;<br> <br> /* send http header */<br>- ast_iostream_printf(ser->stream,<br>+ if (ast_iostream_printf(ser->stream,<br> "HTTP/1.1 %d %s\r\n"<br> "%s"<br> "Date: %s\r\n"<br>@@ -526,13 +526,16 @@<br> http_header ? ast_str_buffer(http_header) : "",<br> content_length,<br> send_content && out && ast_str_strlen(out) ? ast_str_buffer(out) : ""<br>- );<br>+ ) <= 0) {<br>+ ast_debug(1, "ast_iostream_printf() failed: %s\n", strerror(errno));<br>+ close_connection = 1;<br>+ }<br> <br> /* send content */<br>- if (send_content && fd) {<br>+ if (!close_connection && send_content && fd) {<br> while ((len = read(fd, buf, sizeof(buf))) > 0) {<br> if (ast_iostream_write(ser->stream, buf, len) != len) {<br>- ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));<br>+ ast_debug(1, "ast_iostream_write() failed: %s\n", strerror(errno));<br> close_connection = 1;<br> break;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5964">change 5964</a>. To unsubscribe, 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/5964"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I17bd5f3621514152a7b2b263c801324c5e96568b </div>
<div style="display:none"> Gerrit-Change-Number: 5964 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>