Mailing List Archive

#1810: HTTP/1.0 EOF from backend broken
#1810: HTTP/1.0 EOF from backend broken
----------------------+-------------------
Reporter: phk | Owner: phk
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Keywords:
----------------------+-------------------
{{{
varnishtest "POST HTTP/1.0 response"

server s1 {
non-fatal
rxreq
txresp -nolen -hdr "Connection: close"
send "Hello World\n"
delay .4
} -start

varnish v1 -vcl+backend { } -start

client c1 {
txreq -req POST -proto HTTP/1.0 -hdr "Content-Length: 0"
rxresp
expect resp.bodylen == 12
} -run
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1810: HTTP/1.0 EOF from backend broken [ In reply to ]
#1810: HTTP/1.0 EOF from backend broken
----------------------+--------------------
Reporter: phk | Owner: phk
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution:
Keywords: |
----------------------+--------------------

Comment (by phk):

This problem was found by the Wemm-Field on the FreeBSD-project cluster

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1810: HTTP/1.0 EOF from backend broken [ In reply to ]
#1810: HTTP/1.0 EOF from backend broken
----------------------+--------------------
Reporter: phk | Owner: phk
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution:
Keywords: |
----------------------+--------------------

Comment (by phk):

For all but pipe requests, the following workaround can be used, unless
the backend is known to not support HTTP/1.1:

{{{
sub vcl_backend_request {
set bereq.proto = "HTTP/1.1";
}
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1810: HTTP/1.0 EOF from backend broken [ In reply to ]
#1810: HTTP/1.0 EOF from backend broken
----------------------+--------------------
Reporter: phk | Owner: phk
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution:
Keywords: |
----------------------+--------------------

Comment (by phk):

Ok, this is more complicated than I thought.

If we send a HTTP/1.0 request to the backend, the backend is in its full
right to send us an answer with "HTTP/1.1" as protocol, *as long* as it
only uses HTTP/1.0 semantics.

We fail because we trust the protocol field and semantics match.

We need to look both at what we sent to the backend and what we got back,
to determine semantics.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810#comment:3>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1810: HTTP/1.0 EOF from backend broken [ In reply to ]
#1810: HTTP/1.0 EOF from backend broken
----------------------+---------------------
Reporter: phk | Owner: phk
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution: fixed
Keywords: |
----------------------+---------------------
Changes (by Poul-Henning Kamp <phk@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [165f191d68c2637629b6dd4303293c328745acae]:
{{{
#!CommitTicketReference repository=""
revision="165f191d68c2637629b6dd4303293c328745acae"
So one of those strange cornercases in HTTP/1

If we send the backend a HTTP/1.0 request, and it doesn't have a
Content-Length, it cannot use Chunked and must fall back to EOF.

However, the protocol field in the response tells us what version
backend *could* have used, not what it *does* use.

So we can get a response with HTTP/1.1 and EOF, following HTTP/1.0
semantics - because we asked for it.

Most sensible backends avoid this, either by buffering and creation
of a C-L or, smartly, returning "HTTP/1.0", even though that
is strictly speaking against the apocrphal texts.

Anyway, now we cope...

Fixes: #1810
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810#comment:4>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1810: HTTP/1.0 EOF from backend broken [ In reply to ]
#1810: HTTP/1.0 EOF from backend broken
----------------------+---------------------
Reporter: phk | Owner: phk
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution: fixed
Keywords: |
----------------------+---------------------

Comment (by Lasse Karstensen <lkarsten@…>):

In [d327423897e1f49323496640224227935046ebf1]:
{{{
#!CommitTicketReference repository=""
revision="d327423897e1f49323496640224227935046ebf1"
So one of those strange cornercases in HTTP/1

If we send the backend a HTTP/1.0 request, and it doesn't have a
Content-Length, it cannot use Chunked and must fall back to EOF.

However, the protocol field in the response tells us what version
backend *could* have used, not what it *does* use.

So we can get a response with HTTP/1.1 and EOF, following HTTP/1.0
semantics - because we asked for it.

Most sensible backends avoid this, either by buffering and creation
of a C-L or, smartly, returning "HTTP/1.0", even though that
is strictly speaking against the apocrphal texts.

Anyway, now we cope...

Fixes: #1810
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1810#comment:5>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs