aboutsummaryrefslogtreecommitdiffstats
path: root/main/tcptls.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-04 18:55:32 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-04 18:55:32 +0000
commit44780eaace7ac309f34e204137711e7cac69c8e7 (patch)
treeaa424ab5425493f1818d5b21f9ee4fa004bd7229 /main/tcptls.c
parent518b0c0ab6386f0791139db27725e0a3e6a5753f (diff)
Merged revisions 173458 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r173458 | tilghman | 2009-02-04 12:48:06 -0600 (Wed, 04 Feb 2009) | 9 lines 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) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@173460 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/tcptls.c')
-rw-r--r--main/tcptls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/tcptls.c b/main/tcptls.c
index bffa31ac2..64273ae0d 100644
--- a/main/tcptls.c
+++ b/main/tcptls.c
@@ -387,8 +387,10 @@ void *ast_make_file_from_fd(void *data)
/*
* 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);