[asterisk-commits] tilghman: trunk r173458 - /trunk/main/tcptls.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Feb 4 12:48:06 CST 2009
Author: tilghman
Date: Wed Feb 4 12:48:06 2009
New Revision: 173458
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=173458
Log:
When using a socket as a FILE *, the stdio functions will sometimes try to do
an fseek() on the stream, which is an invalid operation for a socket. Turning
off buffering explicitly lets the stdio functions know they cannot do this,
thus avoiding a potential error.
(closes issue #14400)
Reported by: fnordian
Patches:
tcptls.patch uploaded by fnordian (license 110)
Modified:
trunk/main/tcptls.c
Modified: trunk/main/tcptls.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/main/tcptls.c?view=diff&rev=173458&r1=173457&r2=173458
==============================================================================
--- trunk/main/tcptls.c (original)
+++ trunk/main/tcptls.c Wed Feb 4 12:48:06 2009
@@ -135,8 +135,10 @@
/*
* open a FILE * as appropriate.
*/
- if (!tcptls_session->parent->tls_cfg)
+ if (!tcptls_session->parent->tls_cfg) {
tcptls_session->f = fdopen(tcptls_session->fd, "w+");
+ setvbuf(tcptls_session->f, NULL, _IONBF, 0);
+ }
#ifdef DO_SSL
else if ( (tcptls_session->ssl = SSL_new(tcptls_session->parent->tls_cfg->ssl_ctx)) ) {
SSL_set_fd(tcptls_session->ssl, tcptls_session->fd);
More information about the asterisk-commits
mailing list