nor chunked encoding. We don't know the length of the HTTP body in
this case, so it only works for single-pass HTTP responses without
subsequent HTTP response headers in the stream. You can still enforce
the Content-Length header with an "expect" rule.
For example, this fixes response handling from undeadly.org (thttpd)
if relayd is running as a transparent HTTP proxy.
-/* $OpenBSD: relay.c,v 1.96 2008/08/08 08:51:21 thib Exp $ */
+/* $OpenBSD: relay.c,v 1.97 2008/08/08 18:38:14 reyk Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org>
case HTTP_METHOD_PUT:
case HTTP_METHOD_RESPONSE:
/* HTTP request payload */
- if (cre->toread) {
+ if (cre->toread)
bev->readcb = relay_read_httpcontent;
- break;
- }
- /* FALLTHROUGH */
+
+ /* Single-pass HTTP response */
+ bev->readcb = relay_read;
+ break;
default:
/* HTTP handler */
bev->readcb = relay_read_http;