Make it clearer that `psftp -b' doesn't return to the interactive
prompt if the script doesn't end with an explicit `quit'.


git-svn-id: svn://svn.tartarus.org/sgt@6717 cda61777-01e9-0310-a592-d414129be87e
Lionel Fourquaux offers this very simple patch to speed up SFTP,
simply by upping the packet sizes and maximum in-flight packet
count. Got to be worth a try, I think!


git-svn-id: svn://svn.tartarus.org/sgt@6722 cda61777-01e9-0310-a592-d414129be87e
Do not send raw mouse events in the middle of a selection operation, even if
we otherwise would (for instance, if Shift is released before the mouse button
being used for selection).


git-svn-id: svn://svn.tartarus.org/sgt@6727 cda61777-01e9-0310-a592-d414129be87e
Update status of our PocketPC port.


git-svn-id: svn://svn.tartarus.org/sgt@6730 cda61777-01e9-0310-a592-d414129be87e
Robert Evans spotted that bignum_decimal() failed to cope with being given
a zero input.
This shouldn't matter for PuTTY, as these routines are only used in PuTTYgen,
to output SSH-1 format public key exponents/moduli, which should be nonzero.


git-svn-id: svn://svn.tartarus.org/sgt@6731 cda61777-01e9-0310-a592-d414129be87e
When Unix PuTTYgen gives brief usage information, it should mention "--help"!


git-svn-id: svn://svn.tartarus.org/sgt@6732 cda61777-01e9-0310-a592-d414129be87e
In the config dialog, clip RGB values to [0..255] rather than reducing them
mod 256.
Document that the RGB values can be edited, and their range.


git-svn-id: svn://svn.tartarus.org/sgt@6734 cda61777-01e9-0310-a592-d414129be87e
Random Unix puttygen improvements highlighted by a post to comp.security.ssh:
 - fix diagnostic if keyfile and '-t' both specified
 - add diagnostic for generating a key but discarding the private part
 - document '-q' option


git-svn-id: svn://svn.tartarus.org/sgt@6750 cda61777-01e9-0310-a592-d414129be87e
Spell out more explicitly what needs to be done with vanilla VC6, since it
seems to be becoming a FAQ.


git-svn-id: svn://svn.tartarus.org/sgt@6752 cda61777-01e9-0310-a592-d414129be87e
Some extra int64 functions.


git-svn-id: svn://svn.tartarus.org/sgt@6778 cda61777-01e9-0310-a592-d414129be87e
Large file support for psftp and pscp on both Windows and Unix.  On Unix
we set _FILE_OFFSET_BITS to 64 on the compiler command line (via mkfiles.pl),
and on Windows we use SetFilePointer and GetFileSize to cope with 64-bit sizes
where possible.  Not tested on Win9x.


git-svn-id: svn://svn.tartarus.org/sgt@6783 cda61777-01e9-0310-a592-d414129be87e
Aha! At long last I've managed to reproduce the intermittent problem
I've been having with the cursor sometimes restoring to the wrong
place when screen(1) terminates. The offending sequence of escape
sequences goes ESC 7 (save cursor), ESC [?47h (switch to alternate
screen), ESC 7 (save cursor _again_), do some stuff, ESC 8 (restore
cursor), run screen session for a bit, ESC [?47l (return to main
screen), ESC 8 (restore cursor). The final ESC 8 is expected to
restore the cursor to where it was saved by the initial ESC 7.

Translation: the ESC 7 saved cursor state is part of the state we
must swap out when switching to the alternate screen. In other
words, we need to track _four_ cursor positions: active and saved,
on each of main and alternate screen. Previously we were tracking
only three.


git-svn-id: svn://svn.tartarus.org/sgt@6788 cda61777-01e9-0310-a592-d414129be87e
Shifts left and right by 32 were tripping a gcc warning (fatal with
-Werror, of course) about shifting by more than the range of a data
type. They only appeared in `if' statements testing sizeof(off_t),
but gcc warns even when the code is unreachable. I've removed the
conditional code (the general case should still work even on 32-bit
machines), and hacked each shift by 32 into a pair of shifts by 16.

Note that the gcc warning is not just a helpful indication that you
may be using the wrong data type; it's actually pointing out ANSI-
undefined behaviour in shifting a signed integer beyond the size of
its type.


git-svn-id: svn://svn.tartarus.org/sgt@6789 cda61777-01e9-0310-a592-d414129be87e
Er, ahem. Other half of r6788. :-/


git-svn-id: svn://svn.tartarus.org/sgt@6791 cda61777-01e9-0310-a592-d414129be87e
New piece of Windows infrastructure: winhandl.c takes Plink's
thread-based approach to stdin and stdout, wraps it in a halfway
sensible API, and makes it a globally available service across all
network tools.

There is no direct functionality enhancement from this checkin:
winplink.c now talks to the new API instead of doing it all
internally, but does nothing different as a result.

However, this should lay the groundwork for several diverse pieces
of work in future: pipe-based ProxyCommand on Windows, a serial port
back end, and (hopefully) a pipe-based means of communicating with
Pageant, which should have sensible blocking behaviour and hence
permit asynchronous agent requests and decrypt-on-demand.


git-svn-id: svn://svn.tartarus.org/sgt@6797 cda61777-01e9-0310-a592-d414129be87e
Small tweak to the new handle API: provide a `privdata' field in
each handle structure, set on initialisation and readable by an API
call.


git-svn-id: svn://svn.tartarus.org/sgt@6798 cda61777-01e9-0310-a592-d414129be87e
Bug fix: since the input thread does not wait for the event object
until _after_ its first read, we should not start by signalling that
object in order to trigger the first read. Ahem.


git-svn-id: svn://svn.tartarus.org/sgt@6799 cda61777-01e9-0310-a592-d414129be87e
Always initialise the `addresses' field of a SockAddr to NULL,
because it gets unconditionally sfree()d in sk_addr_free(). This
just bit me when running under the MSVC debugger; not sure how it
hasn't bitten anyone until now!


git-svn-id: svn://svn.tartarus.org/sgt@6800 cda61777-01e9-0310-a592-d414129be87e
Return a non-zero exit code in the event of a fatal-error SSH
session termination. `Close window only on clean exit' was not
working properly on Unix in the absence of this:
notify_remote_exit() was being called and ssh_return_exitcode was
returning zero, causing gtk_main_quit() to be called, _before_
connection_fatal() happened.


git-svn-id: svn://svn.tartarus.org/sgt@6801 cda61777-01e9-0310-a592-d414129be87e
Start using notify_remote_exit() in the Windows front end, in place
of the previous ad-hockery which depended on the return value from
select_result() and hence which will not adapt sensibly to a world
in which the primary session is something local rather than a
network connection.


git-svn-id: svn://svn.tartarus.org/sgt@6802 cda61777-01e9-0310-a592-d414129be87e