- Aug 08, 2015
-
-
David M. Lee authored
We don't have a compatability function to fill in a missing htobe64; but we already have one for the identical htonll. Change-Id: Ic0a95db1c5b0041e14e6b127432fb533b97e4cac
-
- Jul 29, 2015
-
-
Mark Michelson authored
A test agent was continuously failing all ARI tests when run against Asterisk 13. As it turns out, the reason for this is that on those test runs, for some reason we decided to use the super extended 64 bit payload length for websocket text frames instead of the extended 16 bit payload length. For 64-bit payloads, the expected byte order over the network is 7, 6, 5, 4, 3, 2, 1, 0 However, we were sending the payload as 3, 2, 1, 0, 7, 6, 5, 4 This meant that we were saying to expect an absolutely MASSIVE payload to arrive. Since we did not follow through on this expected payload size, the client would sit patiently waiting for the rest of the payload to arrive until the test would time out. With this change, we use the htobe64() function instead of htonl() so that a 64-bit byte-swap is performed instead of a 32 bit byte-swap. Change-Id: Ibcd8552392845fbcdd017a8c8c1043b7fe35964a
-
- Feb 25, 2015
-
-
David M. Lee authored
Some WebSocket applications, like [chan_respoke][], require a larger frame size than the default 8k; this patch bumps the default to 16k. This patch also fixes some problems exacerbated by large frames. The sanity counter was decremented on every fread attempt in ws_safe_read(), regardless of whether data was read from the socket or not. For large frames, this could result in loss of sanity prior to reading the entire frame. (16k frame / 1448 bytes per segment = 12 segments). This patch changes the sanity counter so that it only decrements when fread() doesn't read any bytes. This more closely matches the original intention of ws_safe_read(), given that the error message is "Websocket seems unresponsive". This patch also properly logs EOF conditions, so disconnects are no longer confused with unresponsive connections. [chan_respoke]: https://github.com/respoke/chan_respoke Review: https://reviewboard.asterisk.org/r/4431/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Feb 11, 2015
-
-
Kevin Harwell authored
When writing to a websocket if a timeout occurred the underlying socket did not get closed/disconnected. This patch makes sure the websocket gets disconnected on a write timeout. ASTERISK-24701 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/4412/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@431669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Dec 19, 2014
-
-
Richard Mudgett authored
This won't fix the reported issue but it is an incorrect use of sizeof. ASTERISK-24566 Reported by: Badalian Vyacheslav git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@429867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Dec 10, 2014
-
-
Joshua Colp authored
Frames with a payload length of 0 were incorrectly handled in res_http_websocket. Provided a frame with a payload had been received prior it was possible for a double free to occur. The realloc operation would succeed (thus freeing the payload) but be treated as an error. When the session was then torn down the payload would be freed again causing a crash. The read function now takes this into account. This change also fixes assumptions made by users of res_http_websocket. There is no guarantee that a frame received from it will be NULL terminated. ASTERISK-24472 #close Reported by: Badalian Vyacheslav Review: https://reviewboard.asterisk.org/r/4220/ Review: https://reviewboard.asterisk.org/r/4219/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@429270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Oct 27, 2014
-
-
Matthew Jordan authored
When Moises committed the fixes for WSS (which was a great patch), wdoekes had a few style nits that were on the review that got missed. This patch resolves what I *think* were all of the ones that were still on the review. Thanks to both moy for the patch, and wdoekes for the reviews. Review: https://reviewboard.asterisk.org/r/3248/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@426209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jun 26, 2014
-
-
Matthew Jordan authored
When a client takes a long time to process information received from Asterisk, a write operation using fwrite may fail to write all information. This causes the underlying file stream to be in an unknown state, such that the socket must be disconnected. Unfortunately, there are two problems with this in Asterisk's existing websocket code: 1. Periodically, during the read loop, Asterisk must write to the connected websocket to respond to pings. As such, Asterisk maintains a reference to the session during the loop. When ast_http_websocket_write fails, it may cause the session to decrement its ref count, but this in and of itself does not break the read loop. The read loop's write, on the other hand, does not break the loop if it fails. This causes the socket to get in a 'stuck' state, preventing the client from reconnecting to the server. 2. More importantly, however, is that the fwrite in ast_http_websocket_write fails with a large volume of data when the client takes awhile to process the information. When it does fail, it fails writing only a portion of the bytes. With some debugging, it was shown that this was failing in a similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite with a long enough timeout solved the problem. ASTERISK-23917 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3624/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@417310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jun 12, 2014
-
-
Richard Mudgett authored
Simply establishing a TCP connection and never sending anything to the configured HTTP port in http.conf will tie up a HTTP connection. Since there is a maximum number of open HTTP sessions allowed at a time you can block legitimate connections. A similar problem exists if a HTTP request is started but never finished. * Added http.conf session_inactivity timer option to close HTTP connections that aren't doing anything. Defaults to 30000 ms. * Removed the undocumented manager.conf block-sockets option. It interferes with TCP/TLS inactivity timeouts. * AMI and SIP TLS connections now have better authentication timeout protection. Though I didn't remove the bizzare TLS timeout polling code from chan_sip. * chan_sip can now handle SSL certificate renegotiations in the middle of a session. It couldn't do that before because the socket was non-blocking and the SSL calls were not restarted as documented by the OpenSSL documentation. * Fixed an off nominal leak of the ssl struct in handle_tcptls_connection() if the FILE stream failed to open and the SSL certificate negotiations failed. The patch creates a custom FILE stream handler to give the created FILE streams inactivity timeout and timeout after a specific moment in time capability. This approach eliminates the need for code using the FILE stream to be redesigned to deal with the timeouts. This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of the SSL_read/SSL_write operations. ASTERISK-23673 #close Reported by: Richard Mudgett ........ Merged revisions 415841 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@415854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- May 09, 2014
-
-
Kinsey Moore authored
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@413587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Apr 30, 2014
-
-
Kinsey Moore authored
This resolves a race condition where data could be written to a NULL FILE pointer causing a crash as a websocket connection was in the process of shutting down by adding locking to websocket session writes and by deferring session teardown until session destruction. (closes issue ASTERISK-23605) Review: https://reviewboard.asterisk.org/r/3481/ Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@413123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Mar 05, 2014
-
-
Moises Silva authored
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@409703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
Moises Silva authored
Several fixes for the WebSockets implementation in res/res_http_websocket.c * Flush the websocket session FILE* as fwrite() may not actually guarantee sending the data to the network. If we do not flush, it seems that buffering on the SSL socket for outbound messages causes issues * Refactored ast_websocket_read to take into account that SSL file descriptors may be ready to read via fread() but poll() will not actually say so because the data was already read from the network buffers and is now in the libc buffers (closes issue ASTERISK-23099) (closes issue ASTERISK-21930) Review: https://reviewboard.asterisk.org/r/3248/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@409681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jun 12, 2013
-
-
David M. Lee authored
The WebSocket code would allocate, on the stack, a string large enough to hold a key provided by the client, and the WEBSOCKET_GUID. If the key is NULL, this causes a segfault. If the key is too large, it could overflow the stack. This patch checks the key for NULL and checks the length of the key to avoid stack smashing nastiness. (closes issue ASTERISK-21825) Reported by: Alfred Farrugia Tested by: Alfred Farrugia, David M. Lee Patches: issueA21825_check_if_key_is_sent.patch uploaded by Walter Doekes (license 5674) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@391560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Nov 20, 2012
-
-
David M. Lee authored
Without these newlines, log messages just continue tacking onto the same line, and do not flush immediately. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@376561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Sep 27, 2012
-
-
Joshua Colp authored
(closes issue ASTERISK-20439) Reported by: sruffell Patches: 0001-chan_sip-websocket-support-is-an-optional-API.patch uploaded by sruffell (license 5417) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@373914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jul 31, 2012
-
-
Kinsey Moore authored
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jul 16, 2012
-
-
Joshua Colp authored
This allows SIP traffic to be exchanged over a WebSocket connection which is useful for rtcweb. Review: https://reviewboard.asterisk.org/r/2008 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-
- Jun 02, 2012
-
-
Joshua Colp authored
Review: https://reviewboard.asterisk.org/r/1952/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-