]> asedeno.scripts.mit.edu Git - PuTTY.git/log
PuTTY.git
16 years agoI apparently missed out a piece of code when doing the new GTK2 list
Simon Tatham [Fri, 4 Apr 2008 11:02:26 +0000 (11:02 +0000)]
I apparently missed out a piece of code when doing the new GTK2 list
box: shortcut activations for list boxes are missing.

That's the last thing on the to-do list. We're now ready to merge
back to the trunk, given only some final testing!

[originally from svn r7967]

16 years agoReinstate all the GTK1-specific code under ifdefs, and verify that
Simon Tatham [Fri, 4 Apr 2008 10:56:26 +0000 (10:56 +0000)]
Reinstate all the GTK1-specific code under ifdefs, and verify that
we can now build and run successfully using both GTK1 and GTK2 by
giving appropriate options to make. (Specifically, to override the
default of GTK2 in favour of GTK1, "make GTK_CONFIG=gtk-config".)

[originally from svn r7966]

16 years agoRename a structure field to avoid clashing with one of the old GTK1
Simon Tatham [Fri, 4 Apr 2008 10:16:24 +0000 (10:16 +0000)]
Rename a structure field to avoid clashing with one of the old GTK1
ones. (I'm going to merge the GTK1 list code back in under ifdefs,
and I want none of the disputed structure fields to have the same
names, so that I'll reliably be told by the compiler if I keep the
wrong piece of code outside the ifdef.)

[originally from svn r7965]

16 years agoUpdate autoconf for GTK 2. We now check for both GTK2 and GTK1, and
Simon Tatham [Wed, 2 Apr 2008 17:32:17 +0000 (17:32 +0000)]
Update autoconf for GTK 2. We now check for both GTK2 and GTK1, and
in the presence of GTK 2 we also check to see whether we have a
prehistoric Pango (since Pango itself helpfully doesn't provide that
functionality, bah).

[originally from svn r7964]

16 years agoIt's nice to be able to run mkauto.sh from inside the unix subdir as
Simon Tatham [Wed, 2 Apr 2008 17:09:53 +0000 (17:09 +0000)]
It's nice to be able to run mkauto.sh from inside the unix subdir as
well as from outside.

[originally from svn r7963]

16 years agoAnother tedious chore off the to-do list. I've just checked over my
Simon Tatham [Wed, 2 Apr 2008 17:04:21 +0000 (17:04 +0000)]
Another tedious chore off the to-do list. I've just checked over my
custom Columns layout class to see what fiddly details of
GTK2isation were yet to be done. It turns out that all the basic
object management got moved out of GTK into a separate library, so
that all the gtk_object_* calls are deprecated and g_object_* should
be used instead; having done that, though, it all looks perfectly
fine.

[originally from svn r7962]

16 years agoTODO update: I don't think it's worth switching to GTK2's native
Simon Tatham [Wed, 2 Apr 2008 16:26:01 +0000 (16:26 +0000)]
TODO update: I don't think it's worth switching to GTK2's native
shortcut mechanism. The existing code doesn't use any deprecated
calls, and translating shortcut text _into_ Pango markup just sounds
too unpleasant to do if I don't actually have to. Not to mention
that the documentation for the Pango markup language doesn't tell me
how to distinguish a mnemonic underscore prefix from a literal
underscore in label text, but I know my current code can get that
right (the current config box talks about TCP_NODELAY and
SO_KEEPALIVE in widget labels that also have functioning shortcuts).

[originally from svn r7961]

16 years agoEnable the display of server-side font aliases by default in my font
Simon Tatham [Wed, 2 Apr 2008 14:50:47 +0000 (14:50 +0000)]
Enable the display of server-side font aliases by default in my font
selector. I had previously been worried that the default of not
showing aliases interacted badly with the default actual font
_being_ specified as an alias. One of those defaults had to change,
and I've decided which: `fixed' is staying as Unix PuTTY's default
font in defiance of GTK2's vigorous encouragement of Pango.

[originally from svn r7960]

16 years agoUpdate all the list box code in gtkdlg.c to use the new-style GTK2
Simon Tatham [Wed, 2 Apr 2008 14:48:06 +0000 (14:48 +0000)]
Update all the list box code in gtkdlg.c to use the new-style GTK2
GtkTreeView, GtkComboBox and GtkComboBoxEntry instead of the various
old deprecated stuff. Immediate benefit: GTK2 natively supports real
drag lists, hooray!

[originally from svn r7959]

16 years agoExplicit casts to placate OS X gcc's pedantic type-check warnings.
Simon Tatham [Mon, 31 Mar 2008 10:47:48 +0000 (10:47 +0000)]
Explicit casts to placate OS X gcc's pedantic type-check warnings.

[originally from svn r7958]

16 years agoI give up. I can't work out what the purpose of the call to
Simon Tatham [Sat, 29 Mar 2008 20:02:12 +0000 (20:02 +0000)]
I give up. I can't work out what the purpose of the call to
gtk_container_dequeue_resize_handler in request_resize() was;
everything seems to work fine without it. So I'm removing the
nonportable GTK 2 instance of it, and if anything ever goes wrong as
a result then I'll at least find out what the problem was.

[originally from svn r7957]

16 years agoBe more picky than Pango when validating a Pango font description
Simon Tatham [Sat, 29 Mar 2008 15:44:32 +0000 (15:44 +0000)]
Be more picky than Pango when validating a Pango font description
string. Without this, Richard B reports that Pango 1.18 will treat
_anything_ as valid, which means PuTTY can never fall back to X
fonts.

[originally from svn r7956]

16 years agoTODO updates.
Simon Tatham [Sat, 29 Mar 2008 14:57:56 +0000 (14:57 +0000)]
TODO updates.

[originally from svn r7955]

16 years agoAha, _that's_ why there was some unexplained space on the RHS of the
Simon Tatham [Sat, 29 Mar 2008 14:54:55 +0000 (14:54 +0000)]
Aha, _that's_ why there was some unexplained space on the RHS of the
font selector: I had got the row and column counts in
gtk_table_new() back to front, so the space on the right was the
padding around five empty table columns! (And apparently a GtkTable
silently expands if you try to use rows that don't exist, which is
why I hadn't already noticed.)

Fixed that, and added some padding around the entire table. I think
my font selector is now finished, except for any bug fixes that come
up in testing.

[originally from svn r7954]

16 years agoDeal with the possibility of no valid font being selected at all
Simon Tatham [Sat, 29 Mar 2008 14:21:25 +0000 (14:21 +0000)]
Deal with the possibility of no valid font being selected at all
during an entire run of unifontsel (because unifontsel_set_name was
either not called at all, or called with a name that didn't
correspond to any known font). In this situation we grey out the OK
button until a valid font is selected, and we have
unifontsel_get_name return NULL rather than failing an assertion if
it should be called in that state. The current client code in
gtkdlg.c should never encounter a NULL return, since it only calls
it after the OK button is clicked, but I've stuck an assertion in
there too on general principles.

[originally from svn r7953]

16 years agoPrevent NULL-dereferencing segfaults when the font selector is
Simon Tatham [Sat, 29 Mar 2008 13:59:31 +0000 (13:59 +0000)]
Prevent NULL-dereferencing segfaults when the font selector is
invoked with no valid font in the input text.

[originally from svn r7952]

16 years agoRichard B points out another thing for the overall GTK2 to-do list.
Simon Tatham [Sat, 29 Mar 2008 13:55:51 +0000 (13:55 +0000)]
Richard B points out another thing for the overall GTK2 to-do list.

[originally from svn r7951]

16 years agoCosmetic polishing.
Simon Tatham [Sat, 29 Mar 2008 13:55:40 +0000 (13:55 +0000)]
Cosmetic polishing.

[originally from svn r7950]

16 years agoDetect non-monospaced X fonts, and respond by drawing text one
Simon Tatham [Sat, 29 Mar 2008 10:48:16 +0000 (10:48 +0000)]
Detect non-monospaced X fonts, and respond by drawing text one
character at a time centred in its character cell, as we do for
Pango. Gives much better results for those non-monospaced fonts
which are usable as terminal fonts, and shows up the problems with
the others more readily. (In particular, this means the preview pane
in the font selector now warns you there will be trouble if you
select such a font.)

[originally from svn r7949]

16 years agoAdd the rest of ASCII to the font preview window.
Simon Tatham [Sat, 29 Mar 2008 10:25:45 +0000 (10:25 +0000)]
Add the rest of ASCII to the font preview window.

[originally from svn r7948]

16 years agoWhen the user switches between fonts using the font family or style
Simon Tatham [Sat, 29 Mar 2008 10:16:48 +0000 (10:16 +0000)]
When the user switches between fonts using the font family or style
selectors, preserve their most recent size selection as faithfully
as possible. We do this by having a secondary size variable
indicating what they _intend_, so we can come back to their intended
size even after going through a font which doesn't include it.

[originally from svn r7947]

16 years agoImprove the preview pane text.
Simon Tatham [Fri, 28 Mar 2008 20:08:12 +0000 (20:08 +0000)]
Improve the preview pane text.

[originally from svn r7946]

16 years agoMove the font-preview updating code out into a separate function so
Simon Tatham [Thu, 27 Mar 2008 19:53:28 +0000 (19:53 +0000)]
Move the font-preview updating code out into a separate function so
we can call it both when the drawing area changes size and when the
selected font changes. As a result, the preview pane doesn't start
off blank any more.

[originally from svn r7945]

16 years agoMore consistent handling of X11 font aliases: we now don't resolve
Simon Tatham [Thu, 27 Mar 2008 19:41:08 +0000 (19:41 +0000)]
More consistent handling of X11 font aliases: we now don't resolve
them automatically. If the user selects an alias in the font
selector, they get that alias copied literally into the output font
name string; when they return to the font selector, the alias is
still selected. We still _can_ resolve aliases, but we only do it on
demand: double-clicking one in the list box will do the job.

[originally from svn r7944]

16 years agoTune the sorting of the style list box for X fonts.
Simon Tatham [Wed, 26 Mar 2008 21:33:10 +0000 (21:33 +0000)]
Tune the sorting of the style list box for X fonts.

[originally from svn r7942]

16 years agoSort the styles of Pango font families into a sensible order,
Simon Tatham [Wed, 26 Mar 2008 20:20:25 +0000 (20:20 +0000)]
Sort the styles of Pango font families into a sensible order,
instead of alphabetical order. This is more than cosmetic: it's
important because the first one in the list is selected by default.

[originally from svn r7941]

16 years agoAdd ifdefs for older versions of GTK2 and Pango. Unfortunately, the
Simon Tatham [Wed, 26 Mar 2008 18:30:20 +0000 (18:30 +0000)]
Add ifdefs for older versions of GTK2 and Pango. Unfortunately, the
latter require manual input to the Makefile, since the Pango
developers in their unbounded wisdom (that is, unbounded below)
didn't bother to start providing the PANGO_VERSION macros until
release 1.16 - ten releases _after_ everything I'm trying to check!

[originally from svn r7940]

16 years agoPlacate optimiser.
Simon Tatham [Wed, 26 Mar 2008 18:16:52 +0000 (18:16 +0000)]
Placate optimiser.

[originally from svn r7939]

16 years agoUnified font selector dialog box. _Extremely_ unfinished - there's a
Simon Tatham [Tue, 25 Mar 2008 21:49:14 +0000 (21:49 +0000)]
Unified font selector dialog box. _Extremely_ unfinished - there's a
sizable TODO at the top of gtkfont.c - but it's basically functional
enough to select fonts of both types, so I'm checking it in now
before I accidentally break it.

[originally from svn r7938]

16 years agoImplemented a Pango back end. GTK 2 PuTTY can now switch seamlessly
Simon Tatham [Sat, 22 Mar 2008 18:11:17 +0000 (18:11 +0000)]
Implemented a Pango back end. GTK 2 PuTTY can now switch seamlessly
back and forth between X fonts and Pango fonts, provided you're
willing to type in the names of the former by hand.

[originally from svn r7937]

16 years agoMerge from trunk again (because I want the helpful diagnostic code
Simon Tatham [Sat, 22 Mar 2008 12:02:55 +0000 (12:02 +0000)]
Merge from trunk again (because I want the helpful diagnostic code
in r7934 on this branch). Now up to date as of r7934.

[originally from svn r7935]
[r7934 == 087adb167e9e25a09839ca802707c11565468e11]

16 years agoFor convenience of debugging, and perhaps some real convenience at
Simon Tatham [Sat, 22 Mar 2008 12:01:16 +0000 (12:01 +0000)]
For convenience of debugging, and perhaps some real convenience at
some point too: introduce a bunch of environment variables which can
override Unix PuTTY's usual idea of where to find its dotfiles.
Setting PUTTYDIR moves the entire ~/.putty directory; setting
PUTTYSESSIONS, PUTTYSSHHOSTKEYS or PUTTYRANDOMSEED move specific
things within that directory.

While I'm here, also be prepared to fall back to password file
lookups if $HOME is undefined (though we still use $HOME in
preference when it is defined, because that's polite and useful).
Also, on general principles, tweak the make_filename() function
prototype so it doesn't rely on fixed-size buffers.

[originally from svn r7934]

16 years agoRefactor the font handling code: I've moved all the code that
Simon Tatham [Sat, 22 Mar 2008 11:40:23 +0000 (11:40 +0000)]
Refactor the font handling code: I've moved all the code that
explicitly deals with GdkFont out into a new module, behind a
polymorphic interface (done by ad-hoc explicit vtable management in
C). This should allow me to drop in a Pango font handling module in
parallel with the existing one, meaning that GTK2 PuTTY will be able
to seamlessly switch between X11 server-side fonts and Pango client-
side ones as the user chooses, or even use a mixture of the two
(e.g. an X11 font for narrow characters and a Pango one for wide
characters, or vice versa).

In the process, incidentally, I got to the bottom of the `weird bug'
mentioned in the old do_text_internal(). It's not a bug in
gdk_draw_text_wc() as I had thought: it's simply that GdkWChar is a
32-bit type rather than a 16-bit one, so no wonder you have to
specify twice the length to find all the characters in the string!
However, there _is_ a bug in GTK2's gdk_draw_text_wc(), which causes
it to strip off everything above the low byte of each GdkWChar,
sigh. Solution to both problems is to use an array of the underlying
Xlib type XChar2b instead, and pass it to gdk_draw_text() cast to
gchar *. Grotty, but it works. (And it'll become significantly less
grotty if and when we have to stop using the GDK font handling
wrappers in favour of going direct to Xlib.)

[originally from svn r7933]

16 years agoMerge out from trunk, to keep this branch viable. We are now up to
Simon Tatham [Mon, 10 Mar 2008 18:48:36 +0000 (18:48 +0000)]
Merge out from trunk, to keep this branch viable. We are now up to
date as of r7913.

[originally from svn r7914]
[r7913 == d7eda6d99cb6b7c2e09489dcf13b23c4cfcc61a2]

16 years agoUnder OS X Leopard, we seem not to consistently get the Tab key
Simon Tatham [Sun, 9 Mar 2008 15:32:20 +0000 (15:32 +0000)]
Under OS X Leopard, we seem not to consistently get the Tab key
translated for us. Be prepared to do it manually as a fallback.

[originally from svn r7913]

16 years agoFix a cursor positioning infelicity.
Simon Tatham [Fri, 7 Mar 2008 18:30:37 +0000 (18:30 +0000)]
Fix a cursor positioning infelicity.

The scenario: I start a small, say 80x24, pterm. I do some work in
it, generating plenty of scrollback, and eventually I `less' a file.
`less' switches to the alt screen. Then I want more vertical space
to look at the file, so I enlarge the window to more like 80x60.
When I quit `less' and switch back to the primary screen, some
scrollback has been pulled down into the screen, as expected - but
the saved _cursor position_ is still at line 24, not at the bottom
of the new terminal where the prompt it goes with has moved to.

Solution: term_size() should adjust the alt-screen saved cursor
positions as well as the normal cursor position.

(Curiously, the problem doesn't happen on my home Debian box, even
without this fix. It happens on my RH9 box at work, though.)

[originally from svn r7911]

16 years agoIt's a new year (and we've even made a code checkin).
Jacob Nevins [Sun, 24 Feb 2008 00:16:29 +0000 (00:16 +0000)]
It's a new year (and we've even made a code checkin).

[originally from svn r7883]
[this svn revision also touched putty-website]

16 years agoAttempt to clarify what the various IP version selection options do.
Jacob Nevins [Sat, 23 Feb 2008 23:56:22 +0000 (23:56 +0000)]
Attempt to clarify what the various IP version selection options do.

[originally from svn r7882]

16 years agoTunnels: more explicit link from introductory to reference section.
Jacob Nevins [Sat, 23 Feb 2008 22:00:48 +0000 (22:00 +0000)]
Tunnels: more explicit link from introductory to reference section.

[originally from svn r7880]

16 years agoAha, _that's_ why I've been periodically getting blocking-write
Simon Tatham [Thu, 21 Feb 2008 09:18:24 +0000 (09:18 +0000)]
Aha, _that's_ why I've been periodically getting blocking-write
problems using Unix PuTTY port forwarding. Sockets we create by
connect() are immediately set into nonblocking mode by fcntl, but
sockets we create by accept() were not. This trivial fix should help.

[originally from svn r7864]

16 years agoUpdate web-SVN URL for kh2reg.py.
Jacob Nevins [Sun, 10 Feb 2008 14:00:51 +0000 (14:00 +0000)]
Update web-SVN URL for kh2reg.py.

[originally from svn r7843]

16 years agoTypo in winadj@ name.
Jacob Nevins [Wed, 9 Jan 2008 19:59:16 +0000 (19:59 +0000)]
Typo in winadj@ name.

[originally from svn r7834]

16 years agoMake the text about our interest in new mirror sites significantly
Simon Tatham [Thu, 20 Dec 2007 11:03:45 +0000 (11:03 +0000)]
Make the text about our interest in new mirror sites significantly
less fluffy and welcoming.

[originally from svn r7824]

16 years agor7804 neglected to add a help context #define to winhelp.h.
Simon Tatham [Sat, 15 Dec 2007 10:41:40 +0000 (10:41 +0000)]
r7804 neglected to add a help context #define to winhelp.h.

[originally from svn r7815]
[r7804 == 1940b37ff0d65468b531fd00f5576d9fa6d54e69]

16 years agoDocument maxpkt bug under garbled packet error message.
Ben Harris [Wed, 5 Dec 2007 00:28:22 +0000 (00:28 +0000)]
Document maxpkt bug under garbled packet error message.

[originally from svn r7806]

16 years agoAdd a new bug-compatibility mode that limits the window size we'll
Ben Harris [Wed, 5 Dec 2007 00:02:06 +0000 (00:02 +0000)]
Add a new bug-compatibility mode that limits the window size we'll
advertise so that the server can't exceed our maximum packet size.
Enable it for "1.36_sshlib GlobalSCAPE" which apparently sends oversize
packets otherwise.

[originally from svn r7804]

16 years agoDuplicate r7795 in uxnet.c.
Simon Tatham [Wed, 28 Nov 2007 20:45:50 +0000 (20:45 +0000)]
Duplicate r7795 in uxnet.c.

[originally from svn r7796]
[r7795 == 712b4689c8e69f936b0fa8706bee9449c2db1ca9]

16 years agosktree is indexed on the numeric value of the socket structure's
Simon Tatham [Mon, 26 Nov 2007 21:09:54 +0000 (21:09 +0000)]
sktree is indexed on the numeric value of the socket structure's
underlying WinSock SOCKET. Therefore, if we plan to modify the
SOCKET in a socket, we must remove it from the tree before doing so,
and put it back again afterwards. Otherwise it'll violate the tree's
sorting order, and sooner or later someone will try to find it and
get back NULL.

[originally from svn r7795]

16 years agoReset mouse reporting mode as part of resetting the terminal.
Jacob Nevins [Sat, 27 Oct 2007 16:05:02 +0000 (16:05 +0000)]
Reset mouse reporting mode as part of resetting the terminal.

[originally from svn r7773]

16 years agoMarc TERRIER pointed out a couple of places that claim there is an X11
Jacob Nevins [Fri, 19 Oct 2007 21:47:47 +0000 (21:47 +0000)]
Marc TERRIER pointed out a couple of places that claim there is an X11
forwarding checkbox on the Tunnels panel, which hasn't been the case for
a while.

[originally from svn r7771]

16 years agoReplace mentions of SSH-2 I-Ds with references to the corresponding RFCs.
Ben Harris [Wed, 3 Oct 2007 21:21:18 +0000 (21:21 +0000)]
Replace mentions of SSH-2 I-Ds with references to the corresponding RFCs.

[originally from svn r7759]

16 years agosnew() always returns non-NULL, so checking if its return value is NULL
Ben Harris [Wed, 3 Oct 2007 21:06:00 +0000 (21:06 +0000)]
snew() always returns non-NULL, so checking if its return value is NULL
is pointless.

[originally from svn r7758]

16 years agoFactor out the increasingly complicated SSH-2 channel structure initialisation
Ben Harris [Wed, 3 Oct 2007 21:04:26 +0000 (21:04 +0000)]
Factor out the increasingly complicated SSH-2 channel structure initialisation
into its own function.  Maintaining four copies was getting boring.

[originally from svn r7757]

16 years agoTake the code that does flow control in SSH-1, and make it work in SSH-2
Ben Harris [Wed, 3 Oct 2007 20:29:27 +0000 (20:29 +0000)]
Take the code that does flow control in SSH-1, and make it work in SSH-2
as well.  This won't be triggered in the usual case, but it's useful
if the remote end ignores our window, or if we're in "simple" mode and
setting the window far larger than is necessary.

[originally from svn r7756]

16 years agoMore fixes to stdout and stderr. When the backlog on either clears, call
Ben Harris [Tue, 2 Oct 2007 21:43:53 +0000 (21:43 +0000)]
More fixes to stdout and stderr.  When the backlog on either clears, call
the backend's unthrottle function.  If we don't, we'll deadlock.  While
we're here, also pump as much data as possible out during each call to
try_output(), rather than restricting ourselves to a single call to
write().

[originally from svn r7755]

16 years agoAs far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent,
Ben Harris [Tue, 2 Oct 2007 21:07:52 +0000 (21:07 +0000)]
As far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent,
except that O_NONBLOCK is standardised and FIONBIO isn't.  In consequence,
replace our only use of FIONBIO with O_NONBLOCK.

Inspired by Jonathan H N Chin, who had problems with this on Solaris.

[originally from svn r7753]

16 years agoRather than rejecting spurious SSH_MSG_CHANNEL_SUCCESSes, and ignoring
Ben Harris [Mon, 1 Oct 2007 21:11:11 +0000 (21:11 +0000)]
Rather than rejecting spurious SSH_MSG_CHANNEL_SUCCESSes, and ignoring
spurious SSH_MSG_CHANNEL_FAILUREs, treat them as the protocol errors
they are and forcibly disconnect.  Inspired by recent traffic on
comp.security.ssh.

[originally from svn r7752]

16 years agoMerge the looking up of channel numbers for SSH-2 channel messages into
Ben Harris [Sun, 30 Sep 2007 19:42:31 +0000 (19:42 +0000)]
Merge the looking up of channel numbers for SSH-2 channel messages into
a single function which also handles checking that channels exist and
are properly open.  This should make PuTTY a little less tolerant of
servers that send bogus messages.

[originally from svn r7751]

16 years agoSet cfg.ssh_simple if there are no forwardings.
Ben Harris [Sun, 30 Sep 2007 14:14:29 +0000 (14:14 +0000)]
Set cfg.ssh_simple if there are no forwardings.

[originally from svn r7750]

16 years agoWhen writing session data to stdout or stderr, switch the relevant file
Ben Harris [Sun, 30 Sep 2007 12:45:49 +0000 (12:45 +0000)]
When writing session data to stdout or stderr, switch the relevant file
descriptor into non-blocking mode temporarily, and correctly handle returns
of EAGAIN from write().  This should fix unix-plink-stdout-nonblock, while
avoiding EAGAIN turning up where we aren't expecting it.

[originally from svn r7748]

16 years agoNow that PuTTY is actually using names "@putty.projects.tartarus.org", it
Ben Harris [Sat, 29 Sep 2007 14:20:55 +0000 (14:20 +0000)]
Now that PuTTY is actually using names "@putty.projects.tartarus.org", it
seems like a good idea to document them.

[originally from svn r7747]

16 years agoAdd support for resetting the terminal modes on stderr to something sensible
Ben Harris [Sat, 29 Sep 2007 12:27:45 +0000 (12:27 +0000)]
Add support for resetting the terminal modes on stderr to something sensible
before printing error messages to it.  This should fix the stair-stepping
in Plink's progress messages.

[originally from svn r7745]

16 years agoMy changes in r7738 (O_NONBLOCK for Unix Plink) were half-arsed, and
Ben Harris [Mon, 24 Sep 2007 21:43:48 +0000 (21:43 +0000)]
My changes in r7738 (O_NONBLOCK for Unix Plink) were half-arsed, and
completely broke interactive logins.  The problem, or at least one of the
problems, was that in interactive use stdin, stdout, and stderr tend to be
the same file, so setting O_NONBLOCK on the latter two also sets it on the
former.  Thus, we need to cope with all of them being non-blocking.

[originally from svn r7742]
[r7738 == d0db31a1ca9675ae0db3dd5123236a60f9a3e2cb]

16 years agoManifest constants are good. Introduce plink to STD{IN,OUT,ERR}_FILENO,
Ben Harris [Mon, 24 Sep 2007 21:31:45 +0000 (21:31 +0000)]
Manifest constants are good.  Introduce plink to STD{IN,OUT,ERR}_FILENO,
TRUE, and FALSE.

[originally from svn r7741]

16 years agostdout and stderr should be made O_NONBLOCK so that we don't end up blocking
Ben Harris [Mon, 24 Sep 2007 19:26:08 +0000 (19:26 +0000)]
stdout and stderr should be made O_NONBLOCK so that we don't end up blocking
the entire process because stdout is busy.

Arguably, this shouldn't apply to stderr when we're printing our own error
messages to it, but I'll leave that fix for another time.

[originally from svn r7738]

16 years agoAdd support for automatically tuning the SSH-2 window size for decent
Ben Harris [Mon, 24 Sep 2007 15:18:11 +0000 (15:18 +0000)]
Add support for automatically tuning the SSH-2 window size for decent
performance.  The theory behind this is fairly simple, though the
implementation turns out to be a little trickier than it looks.

The basic idea is that when the connection isn't being limited by our ability
to process data, we want to ensure that the window size _as seen by the server_
never drops to zero.  Measuring the server's view of the window size is done
by arranging for it to acknowledge every SSH_MSG_CHANNEL_WINDOW_ADJUST, or
rather an SSH_MSG_CHANNEL_REQUEST sent just before it.  That way we can tell
when it its outgoing data stream it received the window adjustment, and
thus how small the server's view of the window got.

At present, we only ever increase the window size.  In theory, we could
arrange to reduce it again if the server's view of it seemed to be persistently
too large, but my experiments suggest that getting this right will be tricky.

[originally from svn r7735]

16 years agoDocument "No supported authentication methods available", and make it clear
Ben Harris [Sat, 22 Sep 2007 13:55:25 +0000 (13:55 +0000)]
Document "No supported authentication methods available", and make it clear
that TIS/CryptoCard auth can be used for simple passwords too.

[originally from svn r7730]

16 years agoHarvey Kwok observes that EnumPrinters() can sometimes fail to fill
Simon Tatham [Fri, 21 Sep 2007 18:04:08 +0000 (18:04 +0000)]
Harvey Kwok observes that EnumPrinters() can sometimes fail to fill
in its output parameters. Hence, we initialise them before calling
it.

[originally from svn r7729]

16 years agoDon't try SSH-1 RSA authentication unless the server has advertised support
Ben Harris [Thu, 20 Sep 2007 21:33:21 +0000 (21:33 +0000)]
Don't try SSH-1 RSA authentication unless the server has advertised support
for it.  It's possible that this obsoletes BUG_CHOKES_ON_RSA.  Certainly
the one SSH-1.5-Cisco-1.25 server I found was correctly not advertising RSA
auth.  For now, leave it in, because I'm not feeling entirely confident.

[originally from svn r7726]

16 years agoIn SSH-1, don't attempt password authentication unless the server has
Ben Harris [Thu, 20 Sep 2007 21:07:24 +0000 (21:07 +0000)]
In SSH-1, don't attempt password authentication unless the server has
announced support for it.  Instead exit with a fatal error (since password
auth is our last resort).

[originally from svn r7724]

16 years agoAvoid "unused variable" warning when NO_IPV6 defined.
Ben Harris [Mon, 3 Sep 2007 20:52:56 +0000 (20:52 +0000)]
Avoid "unused variable" warning when NO_IPV6 defined.

[originally from svn r7710]

16 years agoSuggest another ttymode we could usefully set automatically.
Ben Harris [Mon, 3 Sep 2007 20:33:40 +0000 (20:33 +0000)]
Suggest another ttymode we could usefully set automatically.

[originally from svn r7709]

16 years agossh->mainchan can be NULL; try not to segfault in that situation.
Simon Tatham [Mon, 3 Sep 2007 19:09:56 +0000 (19:09 +0000)]
ssh->mainchan can be NULL; try not to segfault in that situation.

[originally from svn r7705]

16 years agoCorrectly terminate nc target hostname when copying it.
Ben Harris [Tue, 7 Aug 2007 22:02:03 +0000 (22:02 +0000)]
Correctly terminate nc target hostname when copying it.
While we're here, use memcpy rather than strncpy when we've already worked
out how much we're going to copy.

[originally from svn r7685]

16 years agoUse "int" rather than "unsigned" as the argument to ssh2_set_window, not
Ben Harris [Mon, 6 Aug 2007 20:56:52 +0000 (20:56 +0000)]
Use "int" rather than "unsigned" as the argument to ssh2_set_window, not
because it can ever be negative, but because we'll be comparing it with
another int.  This way, C's promotion rules don't bite us and we should
stand slightly more chance of coping with broken servers that overrun our
window.

[originally from svn r7683]

16 years agoMay as well reference an RFC rather than an Internet Draft where we can.
Ben Harris [Sun, 5 Aug 2007 22:18:59 +0000 (22:18 +0000)]
May as well reference an RFC rather than an Internet Draft where we can.

[originally from svn r7682]

16 years agoSmall window-handling tweaks. Set the default big window to 0x7fffffff bytes,
Ben Harris [Sun, 5 Aug 2007 14:18:43 +0000 (14:18 +0000)]
Small window-handling tweaks.  Set the default big window to 0x7fffffff bytes,
and tweak ssh2_set_window() so it can cope with that.  Also arrange to send
a private channel message in simple mode to tell the server that it can safely
use a large window too.

[originally from svn r7679]

16 years agoRemember to clear ssh_simple when initialising config.
Ben Harris [Sat, 4 Aug 2007 22:19:12 +0000 (22:19 +0000)]
Remember to clear ssh_simple when initialising config.

[originally from svn r7674]

16 years agoIn the file-transfer applications, which only ever use the main
Ben Harris [Sat, 4 Aug 2007 22:14:19 +0000 (22:14 +0000)]
In the file-transfer applications, which only ever use the main
channel, arrange to set the SSH-2 window size to something very
large.  This prevents the connection stalling when the window fills
up, and means that PSCP receives data _much_ faster.

[originally from svn r7672]

16 years ago"CR implies LF" patch, based on one from Paul Coldrey.
Ben Harris [Sat, 4 Aug 2007 19:16:46 +0000 (19:16 +0000)]
"CR implies LF" patch, based on one from Paul Coldrey.

[originally from svn r7669]

16 years agoTweak window handling so that we send a window adjust if the window is half
Ben Harris [Sat, 4 Aug 2007 16:04:08 +0000 (16:04 +0000)]
Tweak window handling so that we send a window adjust if the window is half
used up, rather than over half.  That this increases the throughput of PSCP
by 50% indicates just how broken our window handling is.

[originally from svn r7667]

16 years agoWhen omitting session data from logs, don't omit the length of the session
Ben Harris [Sat, 4 Aug 2007 15:48:52 +0000 (15:48 +0000)]
When omitting session data from logs, don't omit the length of the session
data string.  This isn't strictly necessary, but it makes the logs easier to
use.

[originally from svn r7666]

16 years agoTweak to window handling: Keep the local window in a signed integer, and
Ben Harris [Sat, 4 Aug 2007 14:32:06 +0000 (14:32 +0000)]
Tweak to window handling:  Keep the local window in a signed integer, and
arrange to handle usefully the case where the server sends us more data
than it's allowed to.  There's no danger of overflow, since the maximum is
OUR_V2_WINSIZE and the minimum is -OUR_V2_MAXPKT (at least if the server is
nice).

[originally from svn r7661]

16 years agoDon't throw away data that we receive before we're ready for it. Just save
Ben Harris [Sun, 29 Jul 2007 14:02:00 +0000 (14:02 +0000)]
Don't throw away data that we receive before we're ready for it.  Just save
it up for later.  This should prevent hangs when talking to particularly
enthusiastic servers.

Thanks to JCA for tracking this bug down.

[originally from svn r7651]

16 years agoNote lack of proxy auto-detection.
Jacob Nevins [Sun, 22 Jul 2007 14:34:27 +0000 (14:34 +0000)]
Note lack of proxy auto-detection.

[originally from svn r7648]

16 years agoSplit pkt_ctx into a separate enumeration for each of kex and userauth
Ben Harris [Sat, 21 Jul 2007 21:39:36 +0000 (21:39 +0000)]
Split pkt_ctx into a separate enumeration for each of kex and userauth
instead of a bitfield for both.  This doesn't gain much here, but it should
make it easier to make things other than logging use the context.

[originally from svn r7647]

16 years agoArrange that log_packet() isn't called for raw data logging if logctx is null.
Ben Harris [Sat, 21 Jul 2007 13:43:57 +0000 (13:43 +0000)]
Arrange that log_packet() isn't called for raw data logging if logctx is null.
This allows us to send data in ssh_init(), albeit at the expense of its not
being properly logged, so arrange to send the version string then if that's
sensible, which should reduce the number of round-trips required to bring
up an SSH-2 connection.

[originally from svn r7646]

16 years agoSeparate out the code for creating and sending SSH version strings so that in
Ben Harris [Thu, 19 Jul 2007 23:53:02 +0000 (23:53 +0000)]
Separate out the code for creating and sending SSH version strings so that in
the SSH-2-only case, we can send it as soon as we connect rather than waiting
for the server's one.  Unfortunately, actually doing so will take a little
more effort -- there are subtleties to do with having a working log context
at the right moment that need to be sorted out.

[originally from svn r7645]

16 years agoUpdate an outdated comment.
Ben Harris [Wed, 18 Jul 2007 22:54:31 +0000 (22:54 +0000)]
Update an outdated comment.

[originally from svn r7642]

17 years agoImplement Marcin Bulandra's suggestion of only automatically updating the
Jacob Nevins [Sun, 1 Jul 2007 15:47:31 +0000 (15:47 +0000)]
Implement Marcin Bulandra's suggestion of only automatically updating the
port number in the GUI when the connection type is changed if the current
port number is the standard one for the current protocol.
It's not perfect, but it should make the common case of tabbing through the
Session panel easier when starting non-SSH connections on odd ports.

[originally from svn r7635]

17 years agoRemove port number validation from Windows PuTTY -- it could cause unnecessary
Jacob Nevins [Sun, 1 Jul 2007 15:41:09 +0000 (15:41 +0000)]
Remove port number validation from Windows PuTTY -- it could cause unnecessary
trouble with serial connections, and a port number of zero gets caught later
anyway.

[originally from svn r7634]

17 years agoRationalise access to, and content of, backends[] array.
Jacob Nevins [Sat, 30 Jun 2007 21:56:44 +0000 (21:56 +0000)]
Rationalise access to, and content of, backends[] array.
Should be no significant change in behaviour.
(Well, entering usernames containing commas on Plink's command line will be
a little harder now.)

[originally from svn r7628]

17 years agoFix a couple of signedness compiler warnings, presumably due to me
Simon Tatham [Sat, 30 Jun 2007 18:18:20 +0000 (18:18 +0000)]
Fix a couple of signedness compiler warnings, presumably due to me
using a different version of gcc from before.

[originally from svn r7627]

17 years agoTong Ho points out a missing ssh_pkt_ensure().
Simon Tatham [Sat, 30 Jun 2007 18:17:12 +0000 (18:17 +0000)]
Tong Ho points out a missing ssh_pkt_ensure().

[originally from svn r7626]

17 years agoIndex "MAC" a bit more thoroughly.
Jacob Nevins [Tue, 29 May 2007 20:06:45 +0000 (20:06 +0000)]
Index "MAC" a bit more thoroughly.

[originally from svn r7610]

17 years agoExplicitly spell out that "incorrect MAC" type errors can be caused by
Jacob Nevins [Tue, 29 May 2007 20:01:32 +0000 (20:01 +0000)]
Explicitly spell out that "incorrect MAC" type errors can be caused by
data corruption in the network.

[originally from svn r7609]

17 years agoRetire the e-gold link. Nobody's used it in years; I honestly don't
Simon Tatham [Tue, 22 May 2007 18:37:17 +0000 (18:37 +0000)]
Retire the e-gold link. Nobody's used it in years; I honestly don't
know how I'd go about retrieving money from them any more because my
last exchange transaction went through a company who subsequently
turned out to be dodgy; and a user points out that e-gold is in
legal trouble, which suggests that avoiding it is probably wise.

[originally from svn r7604]

17 years agoThese days, you _can_ save a host name in Default Settings.
Ben Harris [Wed, 9 May 2007 21:35:24 +0000 (21:35 +0000)]
These days, you _can_ save a host name in Default Settings.

[originally from svn r7566]

17 years agoMake bounds of automatic array constant.
Ben Harris [Tue, 1 May 2007 20:29:11 +0000 (20:29 +0000)]
Make bounds of automatic array constant.

[originally from svn r7503]

17 years agoSince r7496, Pageant needs sshsh256 to build (although it doesn't need
Jacob Nevins [Tue, 1 May 2007 13:14:23 +0000 (13:14 +0000)]
Since r7496, Pageant needs sshsh256 to build (although it doesn't need
SHA-256 to actually do its job).

[originally from svn r7500]
[r7496 == dad558a1e59c059b7f3436a4865b5e4e17c59539]