http: Fix spurious ERROR message in responses with no content
authorMatthew Jordan <mjordan@digium.com>
Fri, 4 Apr 2014 15:13:55 +0000 (15:13 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 4 Apr 2014 15:13:55 +0000 (15:13 +0000)
commit73f337d97be6600f283a6149a7dfd107fb3a66e3
tree414b8aa9b150e1cd70ba5625163496f9eba7a05d
parent045285f8e35b391d03abe897b0a581be0248d1ee
http: Fix spurious ERROR message in responses with no content

When a response has a content length of 0, fwrite would be called to write a
buffer with no data in it. This resulted in the following classic error
message:

  [Apr  3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success

This patch makes it so that we only attempt to write out the content if the
calculated content_length is non-zero.
........

Merged revisions 411687 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/http.c