asterisk/channels
Mark Michelson c7b23cbb0a Do not use a FILE handle when doing SIP TCP reads.
This is used to solve an issue where a poll on a file
descriptor does not necessarily correspond to the readiness
of a FILE handle to be read.

This change makes it so that for TCP connections, we do a
recv() on the file descriptor instead.

Because TCP does not guarantee that an entire message or even
just one single message will arrive during a read, a loop has
been introduced to ensure that we only attempt to handle a
single message at a time. The tcptls_session_instance structure
has also had an overflow buffer added to it so that if more
than one TCP message arrives in one go, there is a place to
throw the excess.

Huge thanks goes out to Walter Doekes for doing extensive review
on this change and finding edge cases where code could fail.

(closes issue ASTERISK-20212)
reported by Phil Ciccone

Review: https://reviewboard.asterisk.org/r/2123
........

Merged revisions 374905 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374906 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374914 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-12 16:31:01 +00:00
..
h323 Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
misdn Merged revisions 374515-374535 from 2012-10-05 18:42:14 +00:00
sip Properly handle UAC/UAS roles for SIP session timers 2012-09-25 19:08:02 +00:00
Makefile Extract sig_ss7 out of chan_dahdi. 2010-06-07 20:04:42 +00:00
chan_agent.c Fix a variety of ref counting issues 2012-10-02 01:47:16 +00:00
chan_alsa.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_bridge.c Finalize ast_channel opaquification 2012-03-13 18:20:34 +00:00
chan_console.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_dahdi.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_gtalk.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_h323.c Doxygen Updates - janitor work 2012-09-21 17:14:59 +00:00
chan_iax2.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_jingle.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_local.c Fix an issue where Local channels dialed by app_queue are considered in use immediately. 2012-09-27 11:33:54 +00:00
chan_mgcp.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_misdn.c Merged revisions 374515-374535 from 2012-10-05 18:42:14 +00:00
chan_motif.c Fix a bug where audio on Google Voice would not work due to ignoring candidates. 2012-10-11 21:19:33 +00:00
chan_multicast_rtp.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
chan_nbs.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
chan_oss.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_phone.c Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE) 2012-05-14 19:44:27 +00:00
chan_phone.h rename DialTone.h to chan_phone.h because chan_phone.c is the only file using it 2008-05-28 20:00:21 +00:00
chan_sip.c Do not use a FILE handle when doing SIP TCP reads. 2012-10-12 16:31:01 +00:00
chan_skinny.c Doxygen Cleanup 2012-10-01 23:24:35 +00:00
chan_unistim.c Remove code, that operate with cdr in attempt_transfer(). That was removed somewhere between 1.2 and 1.4 and acidentaly put back in chan_unistim. 2012-07-24 08:53:01 +00:00
chan_vpb.cc Doxygen Cleanup 2012-10-01 23:24:35 +00:00
console_board.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_gui.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
console_video.h implement the 'freeze' function for incoming frames; 2008-06-30 15:45:15 +00:00
iax2-parser.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
iax2-parser.h Asterisk media architecture conversion - no more format bitfields 2011-02-03 16:22:10 +00:00
iax2-provision.c iax2-provision: Fix improper return on failed cache retrieval 2012-09-21 19:35:37 +00:00
iax2-provision.h Don't reload a configuration file if nothing has changed. 2007-08-16 21:09:46 +00:00
iax2.h Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff 2011-02-22 23:04:49 +00:00
misdn_config.c Add named callgroups/pickupgroups 2012-08-07 12:46:36 +00:00
sig_analog.c Add pause one second W dial modifier. 2012-09-28 18:27:02 +00:00
sig_analog.h Convert sig_analog to use a global callback table. 2012-08-08 20:32:53 +00:00
sig_pri.c Allow for redirecting reasons to be set to arbitrary strings. 2012-09-25 19:29:14 +00:00
sig_pri.h Clean up doxygen warnings 2012-08-30 14:23:28 +00:00
sig_ss7.c Made companding law for SS7 calls only determined by SS7 signaling type. 2012-09-15 00:32:37 +00:00
sig_ss7.h Convert sig_ss7 to use a global callback table. 2012-08-08 00:15:54 +00:00
vcodecs.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
vgrabbers.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00