On Mon, Aug 15, 2022 at 12:35:14PM +0200, Claudio Jeker wrote:
> There is no need to use void * for clt_descreq and clt_descresp.
> The only thing these point to are struct http_descriptor. So make
> them struct http_descriptor pointers. This kills a typecast in
> server_fcgi.c.

ok

I suspect a few of the 'struct http_descriptor *desc = clt->clt_descreq;'
also go away, but that's probably more churn than it's worth.

> 
> -- 
> :wq Claudio
> 
> Index: httpd.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/httpd/httpd.h,v
> retrieving revision 1.160
> diff -u -p -r1.160 httpd.h
> --- httpd.h   2 Mar 2022 11:10:43 -0000       1.160
> +++ httpd.h   15 Aug 2022 10:34:29 -0000
> @@ -332,8 +332,8 @@ struct client {
>       struct bufferevent      *clt_bev;
>       struct evbuffer         *clt_output;
>       struct event             clt_ev;
> -     void                    *clt_descreq;
> -     void                    *clt_descresp;
> +     struct http_descriptor  *clt_descreq;
> +     struct http_descriptor  *clt_descresp;
>       int                      clt_sndbufsiz;
>       uint64_t                 clt_boundary;
>  
> Index: server_fcgi.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/httpd/server_fcgi.c,v
> retrieving revision 1.94
> diff -u -p -r1.94 server_fcgi.c
> --- server_fcgi.c     15 Aug 2022 10:29:03 -0000      1.94
> +++ server_fcgi.c     15 Aug 2022 10:34:29 -0000
> @@ -581,8 +581,7 @@ server_fcgi_read(struct bufferevent *bev
>                               }
>                               /* Don't send content for HEAD requests */
>                               if (clt->clt_fcgi.headerssent &&
> -                                 ((struct http_descriptor *)
> -                                 clt->clt_descreq)->http_method
> +                                 clt->clt_descreq->http_method
>                                   == HTTP_METHOD_HEAD)
>                                       /* nothing */ ;
>                               else if (server_fcgi_writechunk(clt) == -1) {
> 

Reply via email to