Thread (4 messages) flat view 4 messages, 4 authors, 2016-08-11

Re: [PATCH] git-cvsimport: add suport for CVS pserver method HTTP/1.x proxying

From: Junio C Hamano <hidden>
Date: 2016-08-11 20:32:27

"Martin Langhoff (CatalystIT)" [off-list ref] writes:
Junio C Hamano wrote:
quoted
Except that this statement made me go "huh?" wondering what it
would do to the $filehandle to evaluate <$filehandle> in a void
context:

+			# Skip the empty line of the proxy server output
+			<$s>;
It's a perl idiom that will discard one line of the $filehandle. If we
are 200% certain that it is empty, then it's fine. OTOH, it may well
be a bug in the particular proxy implementation Iñaki is using -- I
don't know enough about CVS proxying to tell.
It is more about HTTP proxying and it is my understanding that
response to CONNECT method request has that empty line after the
successful (2xx) response line and zero or more response
headers.  The code is still wrong; it does not have a loop to
discard the potential response headers that come before the
empty line the code we are discussing discards.

By the way does anybody know where this behaviour is officially
specified?  Luotonen's draft-luotonen-web-proxy-tunneling-01.txt
is pretty clear about the empty line that comes after the
response headers, but that document being an internet-draft has
expired long time ago, but still seem to be quoted by others.
quoted
The "I/O Operators" section talks about evaluating <$s> in a
scalar context (i.e. "$rep = <$s>"), which we all know would
return a single line, and in list context, which swallows
This is in scalar context, and that's safe to rely on.
If it were in scalar context I would agree fully.  That
behaviour is documented.  But my point is that it is in void
context, and I did not find document specifying what should
happen.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help