What does the "main" pointor in request struct mean?

I found in Nginx that:
struct ngx_http_request_s {

ngx_http_request_t *main;

};
what does this argument mean?

I also found a similar argument in Apache:
request_rec* request_rec::main
//Pointer to the main request if this is a sub-request (see
http_request.h)

so,
Do they have the same meaning?
and if yes, what dose a main request and a sub-request mean? What’s the
difference between the 2 http requests?

hope anybody’s help. Thx~~

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,90805,90805#msg-90805

Just out of curiosity, if GET #1 is index.html and this file has an
img tag, is the second GET a subrequest?


() ascii-rubanda kampajno - kontraŭ html-a retpoŝto
/\ ascii ribbon campaign - against html e-mail

On Thu, May 27, 2010 at 02:55:57AM -0400, 4everpan wrote:

//Pointer to the main request if this is a sub-request (see http_request.h)

so,
Do they have the same meaning?
and if yes, what dose a main request and a sub-request mean? What’s the difference between the 2 http requests?

Yes, this is the same as in Apache.
Subrequests are requests made inside a request, for example, in SSI:

<!--# include virtual="/header.html" -->


Igor S.
http://sysoev.ru/en/

On Thu, May 27, 2010 at 09:38:07AM +0100, Nuno Magalhães wrote:

Just out of curiosity, if GET #1 is index.html and this file has an
img tag, is the second GET a subrequest?

No. The image request is a separate client request.
Subrequests are invisible to a client as well as internal redirects.


Igor S.
http://sysoev.ru/en/

Igor S. Wrote:


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx

It’s really a surprise for me that Igor S. answered my first
question in our forum! (^o^)/~

But I’m not familiar with SSI or shtml protocal… So… let me think
about it:
When I enter the URL “http://www.g.cn” into IE, the URL will be
redirected to “http://www.google.cn” such as follows:

Started Time Sent Received Method Result Type URL

Dose the GET of URL"http://www.google.cn/webhp?source=g_cn" is a
sub-request of the GET of URL"http://www.g.cn/"?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,90805,91363#msg-91363

agentzh Wrote:

  • 0.000 0.134 Â 406 Â Â 532 Â Â GET Â Â

Both of them are “main requests”.

Cheers,
-agentzh


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx

I see… thx~ seems I need to look into the details of HTTP
protocal first…

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,90805,91435#msg-91435

On Fri, May 28, 2010 at 2:19 PM, 4everpan [email protected] wrote:

But I’m not familiar with SSI or shtml protocal… So… let me think about it:
When I enter the URL “http://www.g.cn” into IE, the URL will be redirected to “http://www.google.cn” such as follows:

Started Time Sent Received Method Result Type URL

Dose the GET of URL"http://www.google.cn/webhp?source=g_cn" is a sub-request of the GET of URL"http://www.g.cn/"?

No.

Both of them are “main requests”.

Cheers,
-agentzh