Re: [PATCH v3 9/9] fixup! remote-curl: error on incomplete packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 22, 2020 at 09:33:47AM -0400, Denton Liu wrote:

> In the CGI scripts which emulate a connection being prematurely
> terminated, it doesn't make sense for there to be a trailing newline
> after the simulated connection cut. Remove these newlines.

Ah, good catch. I think in the first one it doesn't matter:

> -printf "%s%s\n" "0079" "45"
> +printf "%s%s" "0079" "45"

because we have a too-short packet, so the fact that it is 3 bytes and
not 2 does not change that.

I agree it's clearer without the newline, though. I wonder if:

  printf "0079" "fewer than 0x79 bytes"

would make it even more self-documenting. :)

> -printf "%s\n" "00"
> +printf "%s" "00"

This one is a behavior improvement: we were probably hitting "oops,
newline isn't a valid line-length character" before, and now we're
really hitting the truncated packet.

I don't know if it's worth adding an extra test with a bogus
line-length. I'm OK with with it either way.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux