You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/05/10 05:11:12 UTC

[PATCH] internal redirect must inherit the_request

>Is it possible that they are sub-requested CGI requests for which
>
>    r->the_request == NULL  ???
>
>That is the only case I could find using
>
>   cvs diff -c -r APACHE_1_2b10
>
>It would cause a SEGV in the util_script.c changes.  The fix is
>to find where the_request is getting screwed over.

Even if this doesn't fix Chuck's problem, it needs fixing anyway.
I thought of it because of an old bug report, which I can't seem
to find in the bugdb.  It would cause a segv on any error that
logged the_request.

....Roy

Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.119
diff -c -r1.119 http_protocol.c
*** http_protocol.c	1997/05/08 11:27:28	1.119
--- http_protocol.c	1997/05/10 03:12:32
***************
*** 847,852 ****
--- 847,854 ----
  
  void set_sub_req_protocol (request_rec *rnew, const request_rec *r)
  {
+     rnew->the_request = r->the_request;  /* Keep original request-line */
+ 
      rnew->assbackwards = 1;	/* Don't send headers from this. */
      rnew->no_local_copy = 1;	/* Don't try to send USE_LOCAL_COPY for a
  				 * fragment.
Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.48
diff -c -r1.48 http_request.c
*** http_request.c	1997/05/08 13:09:24	1.48
--- http_request.c	1997/05/10 03:12:32
***************
*** 1040,1045 ****
--- 1040,1047 ----
      
      /* Inherit the rest of the protocol info... */
  
+     new->the_request = r->the_request;
+ 
      new->method = r->method;
      new->method_number = r->method_number;
      new->allowed = r->allowed;

Re: [PATCH] internal redirect must inherit the_request

Posted by Chuck Murcko <ch...@topsail.org>.
Agreed. +1. Problem is, I'm even core dumping on HEAD requests at the
moment. 

Roy T. Fielding wrote:
> 
> >Is it possible that they are sub-requested CGI requests for which
> >
> >    r->the_request == NULL  ???
> >
> >That is the only case I could find using
> >
> >   cvs diff -c -r APACHE_1_2b10
> >
> >It would cause a SEGV in the util_script.c changes.  The fix is
> >to find where the_request is getting screwed over.
> 
> Even if this doesn't fix Chuck's problem, it needs fixing anyway.
> I thought of it because of an old bug report, which I can't seem
> to find in the bugdb.  It would cause a segv on any error that
> logged the_request.
> 
> ....Roy
> 
> Index: http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> retrieving revision 1.119
> diff -c -r1.119 http_protocol.c
> *** http_protocol.c     1997/05/08 11:27:28     1.119
> --- http_protocol.c     1997/05/10 03:12:32
> ***************
> *** 847,852 ****
> --- 847,854 ----
> 
>   void set_sub_req_protocol (request_rec *rnew, const request_rec *r)
>   {
> +     rnew->the_request = r->the_request;  /* Keep original request-line */
> +
>       rnew->assbackwards = 1;   /* Don't send headers from this. */
>       rnew->no_local_copy = 1;  /* Don't try to send USE_LOCAL_COPY for a
>                                  * fragment.
> Index: http_request.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_request.c,v
> retrieving revision 1.48
> diff -c -r1.48 http_request.c
> *** http_request.c      1997/05/08 13:09:24     1.48
> --- http_request.c      1997/05/10 03:12:32
> ***************
> *** 1040,1045 ****
> --- 1040,1047 ----
> 
>       /* Inherit the rest of the protocol info... */
> 
> +     new->the_request = r->the_request;
> +
>       new->method = r->method;
>       new->method_number = r->method_number;
>       new->allowed = r->allowed;

-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org

Re: [PATCH] internal redirect must inherit the_request

Posted by Chuck Murcko <ch...@topsail.org>.
Roy T. Fielding wrote:
> 
> >Is it possible that they are sub-requested CGI requests for which
> >
> >    r->the_request == NULL  ???
> >
> >That is the only case I could find using
> >
> >   cvs diff -c -r APACHE_1_2b10
> >
> >It would cause a SEGV in the util_script.c changes.  The fix is
> >to find where the_request is getting screwed over.
> 
> Even if this doesn't fix Chuck's problem, it needs fixing anyway.
> I thought of it because of an old bug report, which I can't seem
> to find in the bugdb.  It would cause a segv on any error that
> logged the_request.
> 
Indeed. Once I got a debugger on httpd, this was the problem. The patch
fixes it.
-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org