Simon Tatham [Tue, 14 Jan 2003 18:43:45 +0000 (18:43 +0000)]
Miscellaneous fixes to finish up `remove-statics'. rlogin.c had a
holdout static I hadn't noticed; unicode.c had one too; and a large
number of statics that were perfectly OK due to being constants have
been made `const', with assorted `const' repercussions all over the
place. I now declare `remove-statics' to be fixed.
Ben Harris [Tue, 14 Jan 2003 18:43:26 +0000 (18:43 +0000)]
Add double width/height support. This passes all the relevant parts of
vttest apart from the "mad programmer" screen, which I think is a linedraw
problem.
This also intorduces proper clipping of the drawn text for good measure.
Simon Tatham [Tue, 14 Jan 2003 18:28:23 +0000 (18:28 +0000)]
Deglobalise the Unicode module. Despite all my grand plans, I've
just done this the very simple way - bundle all the globals into a
data structure and pass pointers around. One particularly ugly wart
is that wc_to_mb now takes a pointer to this structure as an
argument (optional, may be NULL, and unused in any Unicode layer
that's even marginally less of a mess than the Windows one). I do
need to do this properly at some point, but for now this should just
about be adequate. As usual, the Mac port has not been updated.
Simon Tatham [Tue, 14 Jan 2003 14:19:35 +0000 (14:19 +0000)]
After the New Year copyright-dates fiasco, I think it's about time
we had one or two official checklists. This file lists the locations
of _all_ the copies of the licence and the copyright dates, all the
files in CVS which need to know the current version number, and also
lays out the release procedure since I always find it terribly
fiddly to do it all in the right order.
PLEASE KEEP THESE LISTS UP TO DATE, people! Anyone adds a new copy
of the licence or the copyright notice, shout about it in here.
Likewise any file that needs to know the current release number and
can't get away with referencing LATEST.VER.
Simon Tatham [Sun, 12 Jan 2003 15:36:05 +0000 (15:36 +0000)]
Ahem. Global replace of `cfg' with `inst->cfg' is all very well, but
let's try to make sure it doesn't happen inside any strings! The
-cfg option for cursor foreground colour nearly had a nasty accident
there.
Simon Tatham [Sun, 12 Jan 2003 15:32:31 +0000 (15:32 +0000)]
Having laid all the groundwork, we can now remove the global `cfg'
completely from putty.h. It's now static in each of the command-line
front ends, shared only between window.c and windlg.c in PuTTY
proper (I've tested this by doing #define cfg cfgsillyname in those
two files only, and it still links so nobody else is using that
symbol!), and part of the `inst' structure in pterm. I think that
only leaves the Unicode module as the last stubborn holdout in the
anti-global-variables campaign.
Simon Tatham [Sun, 12 Jan 2003 15:26:10 +0000 (15:26 +0000)]
proxy.c now no longer refers to `cfg'. Instead, each of the three
proxy-indirection network functions (name_lookup, new_connection,
new_listener) takes a `const Config *' as an argument, and extracts
enough information from it before returning to handle that
particular network operation in accordance with the proxy settings
it specifies. This involved {win,ux}net.c due to a `const'
repercussion.
Simon Tatham [Sun, 12 Jan 2003 14:59:54 +0000 (14:59 +0000)]
The Unicode module no longer depends on `cfg', since it gets the
relevant bits of it passed in to init_ucs(). (Actually I pass in all
of it in the Windows version, since it's a bit hairy in there.)
Simon Tatham [Sun, 12 Jan 2003 14:56:19 +0000 (14:56 +0000)]
There's no real need for portfwd.c to reference `cfg' directly, when
it only needs one item from it and that can easily be passed in from
the call site in ssh.c.
Simon Tatham [Sun, 12 Jan 2003 14:48:29 +0000 (14:48 +0000)]
The back ends now contain their own copies of the Config structure,
and have a function to pass in a new one. (Well, actually several
back ends don't actually bother to do this because they need nothing
out of Config after the initial setup phase, but they could if they
wanted to.)
Simon Tatham [Sun, 12 Jan 2003 14:30:02 +0000 (14:30 +0000)]
term->cfg is now a full copy of the Config structure, not a pointer;
and term_reconfig() now passes in a new structure which is copied
over the top. This means that the old and new structures can be
compared, and the _current_ as well as default states of auto wrap
mode, DEC origin mode, BCE, blinking text and character classes can
be conveniently reconfigured in mid-session without requiring a
terminal reset.
Simon Tatham [Sun, 12 Jan 2003 14:11:38 +0000 (14:11 +0000)]
Support for XDM-AUTHORIZATION-1 at the SSH server end, making use of
the remote IP/port data provided by the server for forwarded
connections. Disabled by default, since it's incompatible with SSH2,
probably incompatible with some X clients, and tickles a bug in
at least one version of OpenSSH.
Simon Tatham [Sun, 12 Jan 2003 13:44:35 +0000 (13:44 +0000)]
Each platform's implementation of askappend() is no longer required
to consult cfg.logxfovr, because it gets done once in logging.c.
askappend() is now called only when a question _really_ needs to be
asked of the user. Also in this checkin, cleanup_exit() in console.c
no longer consults cfg.protocol to decide whether to save the random
seed, because random_save_seed() can make that decision for itself
and do it better.
Ben Harris [Sun, 12 Jan 2003 13:06:59 +0000 (13:06 +0000)]
Cute though DNSAddresses are, they're a poor match for the model the
rest of PuTTY has of DNS resolution, so I've replaced them with something
more conventional. Sorry.
The new code has the advantage of working, of course.
Ben Harris [Sun, 12 Jan 2003 01:24:03 +0000 (01:24 +0000)]
Change error handling to store the error number rather than the string,
and to convert to a string only on demand. This makes it possible to have
the string contain the error number if we don't recognise it.
Ben Harris [Sat, 11 Jan 2003 19:43:59 +0000 (19:43 +0000)]
Add an indirection layer between mtcpnet.c and the rest of PuTTY so that
we can have runtime switching between MacTCP and OpenTransport, and so
that we can cope if there's no TCP/IP stack available at all (albeit with
very little functionality at present).
Ben Harris [Sat, 11 Jan 2003 17:36:24 +0000 (17:36 +0000)]
Calling plug_closing() is highly likely to result in a call to sk_close(),
so arrange that mactcp_poll() can cope with that and not access freed memory
when it happens.
Ben Harris [Sat, 11 Jan 2003 17:31:59 +0000 (17:31 +0000)]
When polling MacTCP connections, check the connection state and if the far
end has sent a FIN pass that up to the plug.
TODO: handle less graceful connection closures.
Simon Tatham [Sat, 11 Jan 2003 10:05:29 +0000 (10:05 +0000)]
Yet _another_ `received data for nonexistent channel' bug. This time
it was because we received WINDOW_ADJUST on a channel we'd already
sent CLOSE on, and reflexively attempted to continue sending the
buffered data in response. Should now be fixed.
Simon Tatham [Sat, 11 Jan 2003 09:31:54 +0000 (09:31 +0000)]
Support XDM-AUTHORIZATION-1 for connecting to local X servers. If
we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...
Simon Tatham [Fri, 10 Jan 2003 18:33:35 +0000 (18:33 +0000)]
Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)
Ben Harris [Thu, 9 Jan 2003 22:39:47 +0000 (22:39 +0000)]
Take advantage of having control over the default font to do the job properly:
ask the system script what it's preferred monospaced font is, and use that
if possible. Failing, that, try the Roman script system, and if that fails,
fall back to Monaco 9.
Ben Harris [Thu, 9 Jan 2003 19:26:39 +0000 (19:26 +0000)]
Install a notification procedure (ASR) on each TCP connection that wakes
PuTTY up when something happens. This should allow it to receive data without
having to poll for it continuously.
Simon Tatham [Thu, 9 Jan 2003 19:26:12 +0000 (19:26 +0000)]
Remove the diagnostic added in rev 1.42 [r2288]; apparently it's all
true and WinSock _does_ occasionally send us netevent messages with
no socket for no reason. Ignore them when they appear.
Simon Tatham [Thu, 9 Jan 2003 18:06:29 +0000 (18:06 +0000)]
I'm sick of all those #ifdefs in settings.c, and in any case plink
and pterm need at least one default setting to be _different_ (pterm
needs the default term type to be `xterm', while plink needs it to
be taken from $TERM). So here's a completely new alternative
mechanism for platform- and app-specific default settings. Ben will
probably want to check the integrity of the Mac port, since I've
fiddled with it without testing that it still compiles.
Ben Harris [Wed, 8 Jan 2003 22:48:57 +0000 (22:48 +0000)]
The CFM-68K build isn't working at the moment (we blow past its global data
limit what with libcharset and the crypto stuff), so don't include it in
"all".
Ben Harris [Wed, 8 Jan 2003 22:46:12 +0000 (22:46 +0000)]
Fairly major hackery to get SSH going on the Mac. Half the support
functions are only dummy stubs, but it's still minimally usable. At
least, as long as you don't want to do anything complex like logging out.
Simon Tatham [Wed, 8 Jan 2003 09:15:56 +0000 (09:15 +0000)]
We just got mailed a Dr Watson log which suggests I failed to
initialise term->paste_len during initialisation, and indeed looking
at the code confirms this. I'm puzzled as to why valgrind didn't
spot this in pterm, though, since it's all in cross-platform code!
Simon Tatham [Tue, 7 Jan 2003 13:09:56 +0000 (13:09 +0000)]
Ahem. Now pterm actually uses wc_to_mb in a situation where it needs
to pass in a default character, it would help if wc_to_mb actually
_honoured_ the default-character parameter.
Ben Harris [Mon, 6 Jan 2003 21:46:56 +0000 (21:46 +0000)]
It looks like Visual C (or whatever the Windows snapshots are built with)
objects to incomplete static array declarations, which I introduced to work
around a bug in SC/MrC. Use #ifdefs to decide whether to enable the workaround
or not.
Ben Harris [Sun, 5 Jan 2003 23:28:02 +0000 (23:28 +0000)]
Move prototypes for base64_decode_atom(), base64_lines(), and base64_encode()
from import.c to ssh.h, so that the implementation can see them. This
necessitates ssh.h's including <stdio.h>.
Also remove a spare prototype for base64_encode_atom() from import.c.
Ben Harris [Sun, 5 Jan 2003 23:01:43 +0000 (23:01 +0000)]
Make ssh1_pkt_type(), ssh2_pkt_type, logeventf(), setup_userpass_input(),
process_userpass_input(), and ssh_unthrottle() static, since they're not
referenced outside this file.
Ben Harris [Sun, 5 Jan 2003 13:57:09 +0000 (13:57 +0000)]
SC (Apple's 68K C compiler) seems to treat tentative definitions of complete
arrya as full definitions, and hence gets upset when it finds a full definition
later. This is a bug (see K&R2 A10.2), but an easy one to work around by
making the tentative definitions incomplete, so I've done that.