Commit Graph

70 Commits

Author SHA1 Message Date
John Hood 1ae23b4dcc Prefer early exit/break to large conditional blocks.
Some of these are large and contain smaller unrelated refactors.
2017-08-06 22:22:09 -04:00
John Hood 43785eb820 Collapse nested conditionals. 2017-08-06 22:21:56 -04:00
John Hood 8ca8a54e11 Split a long printf format string. 2017-08-06 22:21:38 -04:00
John Hood c6c7f09954 Deref a shared pointer in a per-byte loop 2017-08-02 22:07:02 -04:00
John Hood 8f68400c13 Convert new/delete to shared_ptr. 2017-08-02 22:07:02 -04:00
John Hood 91de8901f5 Don't do prediction on large pastes into mosh-client.
Fixes #482, memory use blowup on large pastes.  mosh is still pretty slow
about copying pastes through, though.
2017-08-02 00:31:37 -04:00
John Hood 48e9dd169f Reformat printed strings in source
Consolidate multiple printfs.
Break up multiline strings with string concatentation, for better
 clarity and shorter lines.
Use fputs where appropriate.

This also has the benefit of producing a single constant string with
copyright and versions in the binaries.
2017-08-02 00:02:52 -04:00
Jérémie Courrèges-Anglas c0bf8053b2 Remove deprecated pledge("ioctl")
Unbreaks mosh on recent (> 2017/03/18) OpenBSD systems.
2017-03-20 09:54:33 -04:00
John Hood 24eb5a7544 Remove a Network::Exception that isn't one.
Code smell pointed out by Coverity.
2016-11-19 21:11:04 -05:00
John Hood 9ffbeddbc8 Put spin debug under -vv flag, and add to mosh-client 2016-11-06 06:15:41 -05:00
John Hood 1077db41b6 Support OpenBSD 6.0 pledge() syscall for sandboxing. 2016-09-19 13:23:16 -04:00
John Hood 882539884e Remove unnecessary usage of #include <iostream>. Rename templated impls from .cc to -impl.h. 2016-05-14 00:10:59 -04:00
John Hood ca21788c96 Remove usage of exceptional fdsets with select(). 2016-01-11 04:35:21 -05:00
John Hood 551b77f27e Remove display-posterizing code. It's been dead 3 years.
Signed-off-by: John Hood <cgull@glup.org>
2015-12-06 19:03:36 -05:00
John Hood b41bad918d Make Terminal::Framebuffer::Rows shared and copy-on-write.
* Support both std:: and std::tr1:: shared_ptr. FreeBSD 10 now uses C++11 by default.
* Remove Framebuffer pointers in STMClient
2015-12-06 17:42:34 -05:00
John Hood 5959342ac7 mosh-client: return meaningful exitstatus on network setup/teardown or other failure 2015-10-03 03:43:18 -04:00
John Hood fc80eaaecf Show the escape key properly when server unavailable.
Fixes #624.

Signed-off-by: John Hood <cgull@glup.org>
2015-06-11 00:49:06 -04:00
Geoffrey Thomas a38b6f61d5 STMClient::process_network_input: Return void, instead of always true
This function has never in its history had a codepath returning false.
2015-06-04 23:47:32 -04:00
Geoffrey Thomas 5721b392ab Make all exception classes inherit from std::exception
This refactors out a very common pattern of formatting "%s: %s" with
e.function.c_str() and strerror( e.the_errno ) into just the what()
method of NetworkException. It's also a prerequisite for making cleaner
public API for any exceptions we throw, and allows us to more easily
get exceptions passed back to us to handle.
2015-06-04 23:47:31 -04:00
John Hood fdf8e427c3 OpenBSD: Use snprintf, not sprintf (PORT) 2015-05-25 02:17:24 -04:00
Anders Kaseorg 56837881fc Fix MOSH_ESCAPE_KEY validation
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2014-01-08 18:52:08 -05:00
Anders Kaseorg c1f96b37a1 Connection: Store the port number as a string
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-08-17 08:26:30 -04:00
Timo J. Rinne f960a8bcf5 mosh-client: Make terminal escape character configurable
Uses environment variable MOSH_ESCAPE_KEY. Defaults to current Ctrl-^
which is somewhat problematic for many non-US keyboards.

Signed-off-by: Timo J. Rinne <tri@iki.fi>

Closes #425. Closes #215.
2013-05-17 15:05:33 -04:00
Keith Winstein 61c6ee6011 Send SIGSTOP to whole process group on suspend (closes #401) 2013-03-27 00:26:59 -04:00
Keith Winstein abf240768f Cleanups when suspending/resuming with smcup/rmcup 2013-03-11 01:25:18 -04:00
Anders Kaseorg e2abb8524f Catch exceptions by reference
Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:48:08 -04:00
Anders Kaseorg 03217ddb5a Move Emulator::{open,close} to Display
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2013-03-10 15:46:38 -04:00
Keith Winstein e2b40fcaa7 Show infobar when Ctrl-^ is typed. 2012-11-26 04:03:04 -05:00
Keith Winstein 5eafc209ea Allow suspend by keystroke (Ctrl-^ Ctrl-Z)
(based on patch by Nickolai Zeldovich)
2012-11-26 03:34:14 -05:00
Keith Winstein 28ed30c356 Allow stopping (via kill -STOP) and "fg" to resume session 2012-11-04 13:07:24 -05:00
Keith Winstein c0092a6e7e Hop new ports, but keep the old [for a minute, and up to 10 at a time]
(One is silver and the other gold...)
2012-10-05 02:51:25 -04:00
Keith Winstein d17fb7824b Reset fd sets every time we poll (because network.fd() can now change) 2012-10-05 00:06:37 -04:00
Timo Sirainen 0c5307f345 Added forkpty() and cfmakeraw() fallback implementations if they don't exist.
Signed-off-by: Timo Sirainen <tss@iki.fi>
2012-08-11 17:14:44 -04:00
Keith Winstein a744004bf6 Get system timestamp less often (only after sleeping/selecting) 2012-07-26 21:13:26 -04:00
Keith Winstein 92ecb99b71 Add OpenSSL licensing exception 2012-07-20 16:46:00 -04:00
Keith Winstein 37f78d0e4c Disable out-of-order warning (fires too much on some 802.11n networks)
This reverts commit 682bbdfebd.
2012-05-30 02:04:32 -04:00
Keith Winstein 682bbdfebd Warn on out-of-order or duplicated packets (or missing nonce increment!) 2012-05-23 18:08:31 -04:00
Keith Winstein b9ed0cdaa6 Cleanups to "firewalled" quit scenario. 2012-05-23 12:05:59 -04:00
Keith Winstein c0a8cd61ee More graceful quit sequence when UDP is firewalled. 2012-05-23 11:48:10 -04:00
Larry Doolittle eda48085ba Simple spelling fixes 2012-05-23 05:11:05 -04:00
Keegan McAllister 4f23326a92 Use Select signal handling in mosh-{client,server} 2012-05-16 00:00:27 -04:00
Keegan McAllister 768d4ce797 Make Select a singleton
It's going to manipulate process-global signal state, so multiple
instances do not make sense.
2012-05-16 00:00:27 -04:00
Keegan McAllister 2112a3865c Use Select in mosh-{client,server} 2012-05-16 00:00:27 -04:00
Keegan McAllister 02c04fbdaa Display sendto() exception until a successful send 2012-05-09 14:19:46 -04:00
Keegan McAllister 67a85eaf99 Deliver sendto() exceptions without disturbing control flow
This prevents the client from waking up every 200 ms while the network is down.
Addresses #243.
2012-05-09 14:19:46 -04:00
Keegan McAllister 9dddcd8566 Move NetworkException formatting into NotificationEngine 2012-05-09 14:19:46 -04:00
Keith Winstein 2ea3f3a347 Warn when server has not heard from us (even if we have heard from server) 2012-04-30 22:43:45 -04:00
Keith Winstein b9a8b8c009 More helpful messages when locale not found or wrong (closes #209) 2012-04-19 02:35:14 -04:00
Keith Winstein a8c3df9c80 More robust shutdown sequence with warning on unclean shutdown. 2012-04-16 06:22:35 -04:00
Keith Winstein 119bbcaced Add nicer message and 15s timeout if server can't be reached on UDP.
(Closes #152)
2012-04-16 02:31:27 -04:00