simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Feb 6 21:48:58 GMT 2019


TL;DR:
  26beafe9 do_telnet_read: replace ad-hoc strbuf-alike with strbuf.
  0f405ae8 Work around unhelpful GTK event ordering.
  eb16dee2 proxy.c: make get_line_end return a bool.
  0aa8cf7b Add some missing 'const'.
  a742abae Remove ProxySocket's sent_bufsize field.
  f60fe670 handle_{got,sent}data: separate length and error params.
  0cda34c6 Make lots of 'int' length fields into size_t.
  59f7b24b Make bufchain_prefix return a ptrlen.
  751a9890 Add and use BinarySource_*INIT_PL.
  5b17a2ce Assorted further migration to ptrlen.
  85eaaa86 Avoid undefined left shift in ANSI macro.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-02-06 21:48:58

commit 26beafe984c5f9947aca9578bd6b420a5e4b62d1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=26beafe984c5f9947aca9578bd6b420a5e4b62d1;hp=bd84c5e4b3ff18be6eb33acfdaf3a19745685735
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 20:45:40 2019 +0000

    do_telnet_read: replace ad-hoc strbuf-alike with strbuf.
    
    The ADDTOBUF macro and the three outbuf variables are trying to be a
    strbuf, and not doing it as well as the real one.
    
    Since c_write takes an int length parameter but outbuf->len is now a
    size_t, I've also arranged to flush outbuf periodically during the
    function, just in case it gets too big.

 telnet.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

commit 0f405ae8a3a1d721b6c4af7d4c5a8df5d474c9f4
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0f405ae8a3a1d721b6c4af7d4c5a8df5d474c9f4;hp=26beafe984c5f9947aca9578bd6b420a5e4b62d1
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 06:52:25 2019 +0000

    Work around unhelpful GTK event ordering.
    
    If the SSH socket is readable, GTK will preferentially give us a
    callback to read from it rather than calling its idle functions. That
    means the ssh->in_raw bufchain can just keep accumulating data, and
    the callback that gets the BPP to take data back off that bufchain
    will never be called at all.
    
    The solution is to use sk_set_frozen after a certain point, to stop
    reading further data from the socket (and, more importantly, disable
    GTK's I/O callback for that fd) until we've had a chance to process
    some backlog, and then unfreeze the socket again afterwards.
    
    Annoyingly, that means adding a _second_ 'frozen' flag to Ssh, because
    the one we already had has exactly the wrong semantics - it prevents
    us from _processing_ our backlog, which is the last thing we want if
    the entire problem is that we need that backlog to get smaller! So now
    there are two frozen flags, and a big comment explaining the
    difference.

 ssh.c       | 66 +++++++++++++++++++++++++++++++++++++++++++++++++------------
 ssh.h       |  3 +++
 sshcommon.c |  4 ++++
 sshserver.c |  7 +++++++
 4 files changed, 67 insertions(+), 13 deletions(-)

commit eb16dee2a4d488fe2b9c186b99fe78b80122d111
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=eb16dee2a4d488fe2b9c186b99fe78b80122d111;hp=0f405ae8a3a1d721b6c4af7d4c5a8df5d474c9f4
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:11:11 2019 +0000

    proxy.c: make get_line_end return a bool.
    
    Now the integer output value is never negative (because the condition
    that used to be signalled by setting it to -1 is now signalled by
    returning false from the actual function), which frees me to make it
    an unsigned type in an upcoming change.

 proxy.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

commit 0aa8cf7b0d93faccd62ca1f6bd6deeecf5602c7f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0aa8cf7b0d93faccd62ca1f6bd6deeecf5602c7f;hp=eb16dee2a4d488fe2b9c186b99fe78b80122d111
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:18:19 2019 +0000

    Add some missing 'const'.
    
    plug_receive(), sftp_senddata() and handle_gotdata() in particular now
    take const pointers. Also fixed 'char *receive_data' in struct
    ProxySocket.

 logging.c          | 2 +-
 network.h          | 2 +-
 nullplug.c         | 2 +-
 pageant.c          | 3 ++-
 portfwd.c          | 2 +-
 proxy.c            | 2 +-
 proxy.h            | 2 +-
 pscp.c             | 2 +-
 psftp.c            | 2 +-
 raw.c              | 2 +-
 rlogin.c           | 4 +++-
 sftp.h             | 2 +-
 ssh.c              | 2 +-
 sshserver.c        | 2 +-
 sshshare.c         | 2 +-
 telnet.c           | 4 ++--
 unix/uxpgnt.c      | 2 +-
 windows/winhsock.c | 4 ++--
 windows/winplink.c | 2 +-
 windows/winser.c   | 2 +-
 windows/winstuff.h | 2 +-
 x11fwd.c           | 2 +-
 22 files changed, 27 insertions(+), 24 deletions(-)

commit a742abae2798f3d0fdeb138355bfae550c2e3cd6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a742abae2798f3d0fdeb138355bfae550c2e3cd6;hp=0aa8cf7b0d93faccd62ca1f6bd6deeecf5602c7f
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:19:08 2019 +0000

    Remove ProxySocket's sent_bufsize field.
    
    I just spotted that it was set once and never read.

 proxy.c | 1 -
 proxy.h | 3 ---
 2 files changed, 4 deletions(-)

commit f60fe670adbd4e2b4c8534ea4fd4c619ed8352d0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f60fe670adbd4e2b4c8534ea4fd4c619ed8352d0;hp=a742abae2798f3d0fdeb138355bfae550c2e3cd6
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:36:11 2019 +0000

    handle_{got,sent}data: separate length and error params.
    
    Now we pass an error code in a separate dedicated parameter, instead
    of overloading the length parameter so that a negative value means an
    error code. This enables length to become unsigned without causing
    trouble.

 windows/winhandl.c |  8 ++++----
 windows/winhsock.c | 17 +++++++----------
 windows/winplink.c | 19 +++++++------------
 windows/winser.c   | 13 +++++++------
 windows/winstuff.h |  6 ++++--
 5 files changed, 29 insertions(+), 34 deletions(-)

commit 0cda34c6f86acbcb52e2fbcdfe4d863d646c708b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0cda34c6f86acbcb52e2fbcdfe4d863d646c708b;hp=f60fe670adbd4e2b4c8534ea4fd4c619ed8352d0
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:42:44 2019 +0000

    Make lots of 'int' length fields into size_t.
    
    This is a general cleanup which has been overdue for some time: lots
    of length fields are now the machine word type rather than the (in
    practice) fixed 'int'.

 agentf.c                |  8 ++++----
 be_misc.c               |  8 ++++----
 logging.c               | 14 +++++++-------
 mainchan.c              |  7 ++++---
 misc.c                  |  4 ++--
 misc.h                  | 20 ++++++++++----------
 network.h               | 11 ++++++-----
 nullplug.c              |  5 +++--
 pageant.c               |  4 ++--
 portfwd.c               | 10 ++++++----
 proxy.c                 | 23 +++++++++++------------
 pscp.c                  | 15 ++++++++-------
 psftp.c                 | 13 +++++++------
 putty.h                 | 15 ++++++++-------
 raw.c                   | 16 ++++++++--------
 rlogin.c                | 17 +++++++++--------
 scpserver.c             | 14 +++++++-------
 sesschan.c              | 28 ++++++++++++++++------------
 sftp.h                  |  8 ++++----
 ssh.c                   | 20 ++++++++++----------
 ssh.h                   |  4 ++--
 ssh1connection-client.c |  4 ++--
 ssh1connection-server.c |  8 ++++----
 ssh1connection.c        | 22 +++++++++++-----------
 ssh2connection.c        | 36 ++++++++++++++++++------------------
 ssh2userauth.c          |  2 +-
 sshchan.h               |  6 +++---
 sshcommon.c             |  7 ++++---
 sshserver.c             |  7 ++++---
 sshshare.c              |  6 +++---
 sshverstring.c          |  8 ++++----
 telnet.c                | 20 ++++++++++----------
 terminal.c              | 11 +++++------
 testback.c              | 16 ++++++++--------
 unix/gtkwin.c           |  4 ++--
 unix/uxcons.c           |  2 +-
 unix/uxfdsock.c         |  7 ++++---
 unix/uxnet.c            | 15 ++++++++-------
 unix/uxpgnt.c           |  4 ++--
 unix/uxplink.c          |  8 +++++---
 unix/uxpty.c            |  9 +++++----
 unix/uxser.c            | 11 ++++++-----
 utils.c                 | 25 ++++++++++++-------------
 windows/wincons.c       |  8 ++++----
 windows/window.c        |  7 ++++---
 windows/winhandl.c      | 10 +++++-----
 windows/winhsock.c      | 14 ++++++++------
 windows/winnet.c        | 14 ++++++++------
 windows/winplink.c      |  8 +++++---
 windows/winser.c        | 12 ++++++------
 windows/winstuff.h      | 12 ++++++------
 x11fwd.c                | 10 ++++++----
 52 files changed, 312 insertions(+), 285 deletions(-)

commit 59f7b24b9d50d3af4fb21429418de043c8be8b5a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=59f7b24b9d50d3af4fb21429418de043c8be8b5a;hp=0cda34c6f86acbcb52e2fbcdfe4d863d646c708b
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:46:45 2019 +0000

    Make bufchain_prefix return a ptrlen.
    
    Now that all the call sites are expecting a size_t instead of an int
    length field, it's no longer particularly difficult to make it
    actually return the pointer,length pair in the form of a ptrlen.
    
    It would be nice to say that simplifies call sites because those
    ptrlens can all be passed straight along to other ptrlen-consuming
    functions. Actually almost none of the call sites are like that _yet_,
    but this makes it possible to move them in that direction in future
    (as part of my general aim to migrate ptrlen-wards as much as I can).
    But also it's just nicer to keep the pointer and length together in
    one variable, and not have to declare them both in advance with two
    extra lines of boilerplate.

 logging.c          |  8 +++-----
 misc.h             |  2 +-
 noprint.c          |  2 +-
 proxy.c            | 29 +++++++++++++----------------
 putty.h            |  2 +-
 rlogin.c           |  6 ++----
 scpserver.c        | 25 ++++++++++---------------
 ssh.c              | 11 +++++------
 ssh1connection.c   | 12 +++++-------
 ssh2connection.c   | 26 +++++++++++---------------
 ssh2userauth.c     |  8 +++-----
 sshserver.c        | 11 +++++------
 sshverstring.c     | 31 +++++++++++++++----------------
 terminal.c         | 33 ++++++++++++++++-----------------
 unix/uxcons.c      |  7 +++----
 unix/uxfdsock.c    |  6 ++----
 unix/uxnet.c       |  6 ++++--
 unix/uxplink.c     |  9 ++++-----
 unix/uxprint.c     |  2 +-
 unix/uxpty.c       |  6 ++----
 unix/uxser.c       |  6 ++----
 utils.c            |  5 ++---
 windows/wincons.c  |  7 +++----
 windows/winhandl.c | 11 ++++-------
 windows/winhsock.c | 10 ++++------
 windows/winnet.c   |  6 ++++--
 windows/winprint.c |  4 ++--
 27 files changed, 128 insertions(+), 163 deletions(-)

commit 751a9890911046eb86f5280826c3a888a529f3dd
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=751a9890911046eb86f5280826c3a888a529f3dd;hp=59f7b24b9d50d3af4fb21429418de043c8be8b5a
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:47:18 2019 +0000

    Add and use BinarySource_*INIT_PL.
    
    A great many BinarySource_BARE_INIT calls are passing the two halves
    of a ptrlen as separate arguments. It saves a lot of call-site faff to
    have a variant of the init function that just takes the whole ptrlen
    in one go.

 import.c         | 14 +++++++-------
 marshal.h        | 28 +++++++++++++++++-----------
 ssh1censor.c     |  2 +-
 ssh1login.c      |  3 +--
 ssh2censor.c     |  2 +-
 ssh2connection.c |  3 +--
 ssh2transport.c  |  4 ++--
 ssh2userauth.c   |  9 ++++-----
 sshdss.c         |  6 +++---
 sshecc.c         | 21 ++++++++++-----------
 sshrsa.c         |  8 ++++----
 11 files changed, 51 insertions(+), 49 deletions(-)

commit 5b17a2ce20dac1043eaea3827fc8a7941c605229
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5b17a2ce20dac1043eaea3827fc8a7941c605229;hp=751a9890911046eb86f5280826c3a888a529f3dd
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:48:03 2019 +0000

    Assorted further migration to ptrlen.
    
    The local put_mp_*_from_string functions in import.c now take ptrlen
    (which simplifies essentially all their call sites); so does the local
    function logwrite() in logging.c, and so does ssh2_fingerprint_blob.

 cmdgen.c         |  2 +-
 import.c         | 61 +++++++++++++++++++++++++++-----------------------------
 logging.c        | 14 ++++++-------
 pageant.c        |  7 +++----
 ssh.h            |  2 +-
 ssh2kex-client.c |  3 +--
 sshpubk.c        | 10 +++++-----
 7 files changed, 47 insertions(+), 52 deletions(-)

commit 85eaaa86b74fe6582c7697ae7cde216ed484f9f2
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=85eaaa86b74fe6582c7697ae7cde216ed484f9f2;hp=5b17a2ce20dac1043eaea3827fc8a7941c605229
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Feb 6 20:52:45 2019 +0000

    Avoid undefined left shift in ANSI macro.
    
    If term->esc_query == -1 (reflecting an escape sequence in which the
    CSI is followed by a prefix character other than ?) then the ANSI
    macro shouldn't shift it left by 8, because that's undefined behaviour
    (although in practice I'd be very surprised if any compiler has
    actually miscompiled it yet).
    
    Multiplying it by 256 is a safe alternative which has the behaviour I
    wanted.

 terminal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list