Denys Vlasenko wrote:
> I propose just doing
>
>         post_len -= hdr_cnt;
>
> instead of that if(). If post_len will get negative, this code
> will catch that and will close CGI's input fd:
>
>                 if (toCgi_wr) {
>                         pfd[TO_CGI].fd = toCgi_wr;
>                         if (hdr_cnt > 0) {
>                                 pfd[TO_CGI].events = POLLOUT;
>                         } else if (post_len > 0) {
>                                 pfd[0].events = POLLIN;
>                         } else {
>                                 /* post_len <= 0 && hdr_cnt <= 0:
>                                  * no more POST data to CGI,
>                                  * let CGI see EOF on CGI's stdin */
> ==========>                     close(toCgi_wr);
>                                 toCgi_wr = 0;
>                         }
>                 }
>
> What do you think?
As there is no difference between (post_len == 0) and (post_len < 0), I 
think you are right.

Regards
Ralf Friedl
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to