Hi,
On Mon, Apr 03, Willy Tarreau wrote:
> - improve handling of error-file by splitting headers and body -- I
> don't know if someone is still working on this, but it's still
> welcome and should not interfer with the other devs
(Unless someone is already actively working on this). I might have some
time to work on this(read errorfile to headers/body, and with errors
send headers + \r\n + body).
I guess there're few special cases when reading errorfiles:
- empty file (errorfile 408 /dev/null): empty headers/empty body
- Hdrs: ...\r\n\r\nEOF -> Only headers, empty body
- \r\n\r\nBody...EOF -> Only body, use default headers ?
- \r\n\r\nEOF -> warning and use default headers/body ?
- something\r\nsomething2EOF -> is this only body, use default headers ?
Is the approach suggested by Michael Hamburger ("Introduction and small
changes to HAProxy for adding custom errorfiles for 401 and 407 http
status page" email thread):
struct err_hdr_body {
struct chunk *hdr;
struct chunk *body;
}
struct err_hdr_body http_err_chunks[HTTP_ERR_SIZE];
ok ?
How should for example http_server_error send headers/body ?
bo_inject headers, bo_inject "\r\n" and bo_inject body, or copy
headers/\r\n/body to trash/chunk etc. and then bo_inject ?
-Jarno
--
Jarno Huuskonen