<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18527">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tcptls.c: Use memory BIOs to print openssl errors.<br><br>This avoids the use of open_memstream() which may not be present.<br><br>Change-Id: I71fcc367899ccc0b504da4b36ccfabef39b275c0<br>---<br>M main/tcptls.c<br>1 file changed, 8 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/18527/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/tcptls.c b/main/tcptls.c</span><br><span>index b2756d1..fcb4d55 100644</span><br><span>--- a/main/tcptls.c</span><br><span>+++ b/main/tcptls.c</span><br><span>@@ -110,23 +110,23 @@</span><br><span> </span><br><span> static void write_openssl_error_to_log(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-       FILE *fp;</span><br><span style="color: hsl(120, 100%, 40%);">+     BIO *mem;</span><br><span>    char *buffer;</span><br><span style="color: hsl(0, 100%, 40%);">-   size_t length;</span><br><span style="color: hsl(120, 100%, 40%);">+        ssize_t length;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     fp = open_memstream(&buffer, &length);</span><br><span style="color: hsl(0, 100%, 40%);">-  if (!fp) {</span><br><span style="color: hsl(120, 100%, 40%);">+    mem = BIO_new(BIO_s_mem());</span><br><span style="color: hsl(120, 100%, 40%);">+   if (!mem) {</span><br><span>          return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   ERR_print_errors_fp(fp);</span><br><span style="color: hsl(0, 100%, 40%);">-        fclose(fp);</span><br><span style="color: hsl(120, 100%, 40%);">+   ERR_print_errors(mem);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (length) {</span><br><span style="color: hsl(120, 100%, 40%);">+ length = BIO_get_mem_data(mem, &buffer);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (length > 0) {</span><br><span>                 ast_log(LOG_ERROR, "%.*s\n", (int) length, buffer);</span><br><span>        }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   ast_free(buffer);</span><br><span style="color: hsl(120, 100%, 40%);">+     BIO_free(mem);</span><br><span> }</span><br><span> #endif</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18527">change 18527</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/c/asterisk/+/18527"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I71fcc367899ccc0b504da4b36ccfabef39b275c0 </div>
<div style="display:none"> Gerrit-Change-Number: 18527 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>