Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
History of file network.h at check-in c9f194519298d736
|
2013-11-17
| ||
| 08:05 | Implement connection sharing between instances of PuTTY. The basic strategy is described at the top of the new source file sshshare.c. In very brief: an 'upstream' PuTTY opens a Unix-domain socket or Windows named pipe, and listens for connections from other PuTTYs wanting to run sessions on the same server. The protocol spoken down that socket/pipe is essentially the bare ssh-connection protocol, using a trivial binary packet protocol with no encryption, and the upstream has to do some fiddly transformations that I've been referring to as 'channel-number NAT' to avoid resource clashes between the sessions it's managing. This is quite different from OpenSSH's approach of using the Unix- domain socket as a means of passing file descriptors around; the main reason for that is that fd-passing is Unix-specific but this system has to work on Windows too. However, there are additional advantages, such as making it easy for each downstream PuTTY to run its own independent set of port and X11 forwardings (though the method for making the latter work is quite painful). Sharing is off by default, but configuration is intended to be very easy in the normal case - just tick one box in the SSH config panel and everything else happens automatically. file: [9ddfa50e88] check-in: [998dfad436] user: simon branch: trunk, size: 9477 | |
| 08:04 | Remove sk_{get,set}_private_ptr completely! It was only actually used in X11 and port forwarding, to find internal state structures given only the Socket that ssh.c held. So now that that lookup has been reworked to be the sensible way round, private_ptr is no longer used for anything and can be removed. file: [8dca4db614] check-in: [19677e577d] user: simon branch: trunk, size: 9324 | |
| 08:03 | Replace the hacky 'OSSocket' type with a closure. The mechanism for constructing a new connection-type Socket when a listening one receives an incoming connection previously worked by passing a platform-specific 'OSSocket' type to the plug_accepting function, which would then call sk_register to wrap it with a proper Socket instance. This is less flexible than ideal, because it presumes that only one kind of OS object might ever need to be turned into a Socket. So I've replaced OSSocket throughout the code base with a pair of parameters consisting of a function pointer and a context such that passing the latter to the former returns the appropriate Socket; this will permit different classes of listening Socket to pass different function pointers. In deference to the reality that OSSockets tend to be small integers or pointer-sized OS handles, I've made the context parameter an int/pointer union that can hold either of those directly, rather than the usual approach of making it a plain 'void *' and requiring a context structure to be dynamically allocated every time. file: [2c33fc6344] check-in: [c7d41826aa] user: simon branch: trunk, size: 9789 | |
| 08:03 | Add a Socket implementation which just holds an error message. This isn't yet used, but I plan to use it in situations where you have to report errors by returning a valid Socket on which the client wlil call sk_socket_error, but in fact you notice the error _before_ instantiating your usual kind of Socket. The resulting Socket is usable for nothing except reading out the error string and closing it. file: [27989e8f94] check-in: [20d72c8bd1] user: simon branch: trunk, size: 9545 | |
|
2013-08-17
| ||
| 11:06 | Revamp net_pending_errors using toplevel callbacks. Again, I've removed the special-purpose ad-hockery from the assorted front end message loops that dealt with deferred handling of socket errors, and instead uxnet.c and winnet.c arrange that for themselves by calling the new general top-level callback mechanism. file: [2487e1300f] check-in: [441fc5a4dd] user: simon branch: trunk, size: 9397 | |
|
2013-07-27
| ||
| 13:35 | Add an assortment of missing consts I've just noticed. file: [1c90d0708e] check-in: [9388e0e1ae] user: simon branch: trunk, size: 9554 | |
|
2012-10-16
| ||
| 15:15 | If you configure Unix PuTTY to use a proxy, tell it to even proxy localhost connections, and also enable X forwarding in such a way that it will attempt to connect to a Unix-domain X server socket, an assertion will fail when proxy_for_destination() tries to call sk_getaddr(). Fix by ensuring that Unix-domain sockets are _never_ proxied, since they fundamentally can't be. file: [eb05e8b66f] check-in: [fbf994f8bf] user: simon branch: trunk, size: 9548 | |
|
2011-09-13
| ||
| 06:44 | Revamp of EOF handling in all network connections, pipes and other data channels. Should comprehensively fix 'half-closed', in principle, though it's a big and complicated change and so there's a good chance I've made at least one mistake somewhere. All connections should now be rigorous about propagating end-of-file (or end-of-data-stream, or socket shutdown, or whatever) independently in both directions, except in frontends with no mechanism for sending explicit EOF (e.g. interactive terminal windows) or backends which are basically always used for interactive sessions so it's unlikely that an application would be depending on independent EOF (telnet, rlogin). EOF should now never accidentally be sent while there's still buffered data to go out before it. (May help fix 'portfwd-corrupt', and also I noticed recently that the ssh main session channel can accidentally have MSG_EOF sent before the output bufchain is clear, leading to embarrassment when it subsequently does send the output). file: [5ad0f4a6ad] check-in: [0831792ea4] user: simon branch: trunk, size: 9500 | |
|
2011-07-14
| ||
| 13:52 | Post-release destabilisation! Completely remove the struct type 'Config' in putty.h, which stores all PuTTY's settings and includes an arbitrary length limit on every single one of those settings which is stored in string form. In place of it is 'Conf', an opaque data type everywhere outside the new file conf.c, which stores a list of (key, value) pairs in which every key contains an integer identifying a configuration setting, and for some of those integers the key also contains extra parts (so that, for instance, CONF_environmt is a string-to-string mapping). Everywhere that a Config was previously used, a Conf is now; everywhere there was a Config structure copy, conf_copy() is called; every lookup, adjustment, load and save operation on a Config has been rewritten; and there's a mechanism for serialising a Conf into a binary blob and back for use with Duplicate Session. User-visible effects of this change _should_ be minimal, though I don't doubt I've introduced one or two bugs here and there which will eventually be found. The _intended_ visible effects of this change are that all arbitrary limits on configuration strings and lists (e.g. limit on number of port forwardings) should now disappear; that list boxes in the configuration will now be displayed in a sorted order rather than the arbitrary order in which they were added to the list (since the underlying data structure is now a sorted tree234 rather than an ad-hoc comma-separated string); and one more specific change, which is that local and dynamic port forwardings on the same port number are now mutually exclusive in the configuration (putting 'D' in the key rather than the value was a mistake in the first place). One other reorganisation as a result of this is that I've moved all the dialog.c standard handlers (dlg_stdeditbox_handler and friends) out into config.c, because I can't really justify calling them generic any more. When they took a pointer to an arbitrary structure type and the offset of a field within that structure, they were independent of whether that structure was a Config or something completely different, but now they really do expect to talk to a Conf, which can _only_ be used for PuTTY configuration, so I've renamed them all things like conf_editbox_handler and moved them out of the nominally independent dialog-box management module into the PuTTY-specific config.c. file: [9792ef8e1c] check-in: [a2c0243430] user: simon branch: trunk, size: 9418 | |
|
2009-02-23
| ||
| 19:01 | Since r8305, Unix PuTTY has always "upgraded" an X11 display like "localhost:0" to a Unix-domain socket. This typically works fine when PuTTY is run on the same machine as the X server, but it's broken multi-hop X forwarding through OpenSSH; when OpenSSH creates a proxy X server "localhost:10", it only listens on TCP, not on a Unix-domain socket. Instead, when deciding on the details of the display, we actively probe to see if there's a Unix-domain socket we can use instead, and only use it if it's there, falling back to the specified IP "localhost" if not. Independently, when looking for local auth details in Xauthority for a "localhost" TCP display, we prefer a matching Unix-domain entry, but will fall back to an IP "localhost" entry (which would be unusual, but we don't trust a Windows X server not to do it) -- this is a generalisation of the special case added in r2538 (but removed in r8305, as the automatic upgrade masked the need for it). (This is now done in platform-independent code, so a side-effect is that get_hostname() is now part of the networking abstraction on all platforms.) file: [219a5c33f0] check-in: [d5c507e1ed] user: jacob branch: trunk, size: 9450 | |
|
2008-11-08
| ||
| 10:58 | Implement sk_addr_dup(). file: [f9eeac9428] check-in: [eed2c42118] user: simon branch: trunk, size: 9337 | |
|
2005-01-16
| ||
| 08:29 | Support for falling back through the list of addresses returned from a DNS lookup, whether they're IPv4, v6 or a mixture of both. file: [76afa82c32] check-in: [d774282d73] user: simon branch: trunk, size: 8999 | |
|
2004-12-30
| ||
| 10:45 | Integrate unfix.org's IPv6 patches up to level 10, with rather a lot of polishing to bring them to what I think should in principle be release quality. Unlike the unfix.org patches themselves, this checkin enables IPv6 by default; if you want to leave it out, you have to build with COMPAT=-DNO_IPV6. I have tested that this compiles on Visual C 7 (so the nightlies _should_ acquire IPv6 support without missing a beat), but since I don't have IPv6 set up myself I haven't actually tested that it _works_. It still seems to make correct IPv4 connections, but that's all I've been able to verify for myself. Further testing is needed. file: [984ce591f5] check-in: [99d7fec46d] user: simon branch: trunk, size: 8272 | |
|
2004-06-20
| ||
| 12:07 | Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off. No very good reason, but I've occasionally wanted to frob it to see if it makes any difference to problems I'm having, and it was easy. Tested that it does actually cause keepalives on Windows (with tcpdump); should also work on Unix. Not implemented on Mac (does nothing), but then neither is TCP_NODELAY. Quite a big checkin, much of which is adding `keepalive' alongside `nodelay' in network function calls. file: [470f3f7888] check-in: [d6cbea6730] user: jacob branch: trunk, size: 8248 | |
|
2003-08-07
| ||
| 11:04 | Control of 'addr' is now handed over to {platform_,}new_connection() and sk_new() on invocation; these functions become responsible for (eventually) freeing it. The caller must not do anything with 'addr' after it's been passed in. (Ick.) Why: A SOCKS5 crash appears to have been caused by overzealous freeing of a SockAddr (ssh.c:1.257 [r2492]), which for proxied connections is squirreled away long-term (and this can't easily be avoided). It would have been nice to make a copy of the SockAddr, in case the caller has a use for it, but one of the implementations (uxnet.c) hides a "struct addrinfo" in there, and we have no defined way to duplicate those. (None of the current callers _do_ have a further use for the SockAddr.) As far as I can tell, everything _except_ proxying only needs addr for the duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it should at least be easier to find the offending free()... file: [a04a08c72b] check-in: [d318104cf5] user: jacob branch: trunk, size: 8203 | |
|
2003-06-06
| ||
| 05:42 | Move prototype for platform_new_connection() to a header file so the definitions can be checked against it. file: [b72e0a1643] check-in: [ee0a576001] user: ben branch: trunk, size: 7929 | |
|
2003-05-10
| ||
| 03:35 | Fixes for Debian bug #192701 (64-bit gccs warn about casts between ptrs and ints of different size and -Werror makes this serious). The GTK bits are done by Colin's patch to use GINT_TO_POINTER (thanks); the uxnet bits are done by cleaning up the rest of the code. In particular, network.h now typedefs `OSSocket' to be a type capable of holding whatever the OS's socket data type is that underlies our socket abstraction. Individual platforms can make this typedef themselves if they define OSSOCKET_DEFINED to prevent network.h redoing it; so the Unix OSSocket is now int. Default is still void *, so other platforms should be unaffected. file: [c37f496b51] check-in: [e1f861acb0] user: simon branch: trunk, size: 7697 | |
|
2003-05-04
| ||
| 09:18 | Colin's const-fixing Patch Of Death. Seems to build fine on Windows as well as Unix, so it can go in. file: [3fcdb8e2a6] check-in: [c9f1945192] user: simon branch: trunk, size: 7634 | |
|
2003-01-12
| ||
| 09:26 | 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. file: [8d031d35ed] check-in: [894cb1e750] user: simon branch: trunk, size: 7616 | |
|
2003-01-10
| ||
| 12:33 | 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.) file: [80a2cd177d] check-in: [5ec7a0298b] user: simon branch: trunk, size: 7366 | |
|
2002-12-18
| ||
| 10:23 | Support for doing DNS at the proxy end. I've invented a new type of SockAddr, which just contains an unresolved hostname and is created by a stub function in *net.c. It's an error to pass this to most of the real-meat functions in *net.c; these fake addresses should have been dealt with by the time they get down that far. proxy.c now contains name_lookup(), a wrapper on sk_namelookup() which decides whether or not to do real DNS, and the individual proxy implementations each deal sensibly with being handed an unresolved address and avoid ever passing one down to *net.c. file: [b9541e80bc] check-in: [8d3480376f] user: simon branch: trunk, size: 7354 | |
| 06:18 | Stop proxying connections to localhost by default; should fix `x11-proxy-crash'. file: [a979a751ff] check-in: [414b5ad689] user: simon branch: trunk, size: 7235 | |
| 05:39 | Implement `portfwd-loopback-choice'. Works on local side in Unix as well, though it's a lot less useful since you still can't bind to low-numbered ports of odd loopback IPs. Should work in principle for SSH2 remote forwardings as well as local ones, but OpenSSH seems unwilling to cooperate. file: [f5e9087044] check-in: [dbd436ea57] user: simon branch: trunk, size: 7157 | |
|
2002-10-30
| ||
| 11:57 | More preparatory work: remove the <windows.h> include from lots of source files in which it's no longer required (it was previously required in anything that included <putty.h>, but not any more). Also moved a couple of stray bits of exposed WinSock back into winnet.c (getservbyname from ssh.c and AF_INET from proxy.c). file: [43e43dd32b] check-in: [28f44ea3f8] user: simon branch: trunk, size: 7127 | |
|
2002-04-27
| ||
| 10:01 | SOCKS proxy support added (next instalment of Justin Bradford's proxy work). SOCKS 5 username/password authentication still unsupported. file: [ff65f4c559] check-in: [12982b75cc] user: simon branch: trunk, size: 6744 | |
|
2002-03-23
| ||
| 11:47 | Justin Bradford's proxy support patch. Currently supports only HTTP CONNECT, but contains an extensible framework to allow other proxies. Apparently SOCKS and ad-hoc-telnet-proxy are already planned (the GUI mentions them already even though they don't work yet). GUI includes full configurability and allows definition of exclusion zones. Rock and roll. file: [063563b162] check-in: [dea04539ac] user: simon branch: trunk, size: 6668 | |
|
2002-03-06
| ||
| 14:13 | Ensure our network layer is properly cleaned up before PuTTY exits. Specifically, we explicitly closesocket() all open sockets, which appears to be necessary since otherwise Windows sends RST rather than FIN. I'm _sure_ that's a Windows bug, but there we go. file: [6138a09f3b] check-in: [c483e38b9f] user: simon branch: trunk, size: 6204 | |
|
2001-11-29
| ||
| 15:47 | Configurable TCP_NODELAY option on network connections file: [da9a07ebe2] check-in: [8daaf4c09d] user: simon branch: trunk, size: 6135 | |
|
2001-10-30
| ||
| 14:57 | Tidy up the SERIOUS NETWORK ERROR fixes file: [e38d6df395] check-in: [a36d0f7bf5] user: simon branch: trunk, size: 6122 | |
|
2001-09-07
| ||
| 17:39 | Robert de Bath's asynchronous-connect patch. Helps a lot in port forwarding; improves Event Log; and causes the PuTTY window to appear earlier in the setup process. file: [259620bb9d] check-in: [30ca2ba730] user: simon branch: trunk, size: 5965 | |
|
2001-08-27
| ||
| 10:59 | Port forwarding update: local-host-only listening sockets are now done properly (by binding to INADDR_LOOPBACK) instead of hackishly (by binding to INADDR_ANY, looking at the peer address when a connection is accepted, and slamming the connection shut at that point). file: [01f3d8cc9e] check-in: [da6aaddf6b] user: simon branch: trunk, size: 5910 | |
|
2001-08-25
| ||
| 12:09 | Extensive changes that _should_ fix the socket buffering problems, by ceasing to listen on input channels if the corresponding output channel isn't accepting data. Has had basic check-I-didn't-actually- break-anything-too-badly testing, but hasn't been genuinely tested in stress conditions (because concocting stress conditions is non- trivial). file: [662b20f345] check-in: [e84a3c910c] user: simon branch: trunk, size: 5925 | |
|
2001-08-08
| ||
| 15:44 | SSH port forwarding! How cool is that? Only currently works on SSH1; SSH2 should be doable but it's late and I have other things to do tonight. The Cool Guy award for this one goes to Nicolas Barry, for doing most of the work and actually understanding the code he was adding to. file: [6a269832d7] check-in: [c9959c44e1] user: simon branch: trunk, size: 5166 | |
|
2001-05-06
| ||
| 09:35 | Run entire source base through GNU indent to tidy up the varying coding styles of the various contributors! Woohoo! file: [cae08d8691] check-in: [18fcbbf5a2] user: simon branch: trunk, size: 4503 | |
|
2001-03-13
| ||
| 04:22 | Dave Hinton's modifications to the network layer interface, which should make it possible to add SSL support later. file: [033a984f36] check-in: [0c3b3070c4] user: simon branch: trunk, size: 4426 | |
|
2001-02-01
| ||
| 08:11 | Yet another attempt at OOB handling in the network abstraction. This version allows you to specify, per socket, which sockets receive OOB data in-line (so that you know what was before the mark and what was after) and which receive it out of line (so it's really a one-byte out-of-band facility rather than discard-to-mark). This reflects the fact that rlogin appears to make more sense in the latter mode, and telnet in the former. This patch makes rlogin work right for me. file: [9b1f4f13c5] check-in: [a766f640f1] user: simon branch: trunk, size: 2149 | |
|
2001-01-24
| ||
| 04:11 | Improve socket error handling so that a socket error isn't an automatic fatalbox(). Instead, the error is passed to the receiver routine, which can decide just how fatal the problem really is. file: [f8d2ead751] check-in: [d2802d2956] user: simon branch: trunk, size: 2120 | |
|
2001-01-19
| ||
| 04:10 | Experimental Rlogin support, thanks to Delian Delchev. Local flow control is unsupported, and server-to-client comms may fail for want of working TCP Urgent. file: [308c333242] check-in: [da6b4093b4] user: simon branch: trunk, size: 1687 | |
|
2000-10-24
| ||
| 05:47 | Fix miscellaneous compiler warnings. Thanks to Jacob Nevins file: [ff45bedd0d] check-in: [8952007fd8] user: simon branch: trunk, size: 1673 | |
|
2000-10-23
| ||
| 06:55 | Added: Created a shiny new abstraction for the socket handling. Has many advantages: - protocol modules can call sk_write() without having to worry about writes blocking, because blocking writes are handled in the abstraction layer and retried later. - `Lost connection while sending' is a thing of the past. - <winsock.h> is no longer needed in most modules, because "putty.h" doesn't have to declare `SOCKET' variables any more, only the abstracted `Socket' type. - select()-equivalent between multiple sockets will now be handled sensibly, which opens the way for things like SSH port forwarding. file: [c764f5fefe] check-in: [59c2b0e4fd] user: simon branch: trunk, size: 1616 | |