mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@173458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -135,8 +135,10 @@ static void *handle_tls_connection(void *data)
|
|||||||
/*
|
/*
|
||||||
* open a FILE * as appropriate.
|
* 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+");
|
tcptls_session->f = fdopen(tcptls_session->fd, "w+");
|
||||||
|
setvbuf(tcptls_session->f, NULL, _IONBF, 0);
|
||||||
|
}
|
||||||
#ifdef DO_SSL
|
#ifdef DO_SSL
|
||||||
else if ( (tcptls_session->ssl = SSL_new(tcptls_session->parent->tls_cfg->ssl_ctx)) ) {
|
else if ( (tcptls_session->ssl = SSL_new(tcptls_session->parent->tls_cfg->ssl_ctx)) ) {
|
||||||
SSL_set_fd(tcptls_session->ssl, tcptls_session->fd);
|
SSL_set_fd(tcptls_session->ssl, tcptls_session->fd);
|
||||||
|
Reference in New Issue
Block a user