Re: [PATCH v9 2/3] http-backend: respect CONTENT_LENGTH as specified by rfc3875

2018-08-04 Thread Junio C Hamano
Max Kirillov writes: > On Sat, Aug 04, 2018 at 08:34:08AM +0200, Duy Nguyen wrote: >> On Fri, Jul 27, 2018 at 5:50 AM Max Kirillov wrote: >>> + if (max_request_buffer < req_len) { >>> + die("request was larger than our maximum size (%lu): " >>> + "%"

Re: [PATCH v9 2/3] http-backend: respect CONTENT_LENGTH as specified by rfc3875

2018-08-04 Thread Max Kirillov
On Sat, Aug 04, 2018 at 08:34:08AM +0200, Duy Nguyen wrote: > On Fri, Jul 27, 2018 at 5:50 AM Max Kirillov wrote: >> + if (max_request_buffer < req_len) { >> + die("request was larger than our maximum size (%lu): " >> + "%" PRIuMAX "; try setting

Re: [PATCH v9 2/3] http-backend: respect CONTENT_LENGTH as specified by rfc3875

2018-08-04 Thread Duy Nguyen
On Fri, Jul 27, 2018 at 5:50 AM Max Kirillov wrote: > -static void inflate_request(const char *prog_name, int out, int buffer_input) > +static ssize_t read_request_fixed_len(int fd, ssize_t req_len, unsigned char > **out) > +{ > + unsigned char *buf = NULL; > + ssize_t cnt = 0; > + >

[PATCH v9 2/3] http-backend: respect CONTENT_LENGTH as specified by rfc3875

2018-07-26 Thread Max Kirillov
http-backend reads whole input until EOF. However, the RFC 3875 specifies that a script must read only as many bytes as specified by CONTENT_LENGTH environment variable. Web server may exercise the specification by not closing the script's standard input after writing content. In that case