You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by 张 臻博 <la...@hotmail.com> on 2007/01/09 14:40:47 UTC

process the request

hello

I am reading the code of apache. Is there anybody who knows whether 
ap_run_pre_connection() and ap_run_process_connection() are functions or 
macro? and where is the definition for those two , as i can not find any 
detailed code for them?

Can anybody give me a hint? Thanks a lot!!!

br
frankie

_________________________________________________________________
与世界各地的朋友进行交流,免费下载  Live Messenger; 
http://get.live.com/messenger/overview 


Re: process the request

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
张 臻博 wrote:
> hello
> 
> I am reading the code of apache. Is there anybody who knows whether
> ap_run_pre_connection() and ap_run_process_connection() are functions or
> macro? and where is the definition for those two , as i can not find any
> detailed code for them?

Sorry for the long thread when there's a short answer.

Look for /AP_IMPLEMENT_HOOK_/ declarations, specifically in connection.c,
but I'm not sure if you want those, or the sources that ap_hook_pre_connection
and ap_hook_process_connection in the chain.  (Or both).



Re: process the request

Posted by Hongyuan Wang <gl...@gmail.com>.
张 臻博 wrote:
> hello
> 
> I am reading the code of apache. Is there anybody who knows whether 
> ap_run_pre_connection() and ap_run_process_connection() are functions or 
> macro? and where is the definition for those two , as i can not find any 
> detailed code for them?
> 
> Can anybody give me a hint? Thanks a lot!!!
> 
> br
> frankie

They are a part of the expansion result of macro
APR_DECLARE_EXTERNAL_HOOK and APR_IMPLEMENT_EXTERNAL_HOOK_*.
You can find the the definition of these macros in
./srclib/apr-util/include/apr_hooks.h


Re: process the request

Posted by Issac Goldstand <ma...@beamartyr.net>.
They're basically macros.  More accurately they trigger every module
which registers hooks for pre_connection or process_connection to run
the function they have registered.

  Issac


�� �鲩 wrote:
> hi,
> 
> Acturally, from APR, you can not find any hint for those two. As you
> search from this place: http://docx.itscales.com/annotated.html  you can
> not find the link for those two.... anyone knows where can find the
> source code or some information?
> 
> br
> frankie
> 
> 
>> From: Guy Hulbert <gw...@eol.ca>
>> Reply-To: dev@httpd.apache.org
>> To: dev@httpd.apache.org
>> Subject: Re: process the request
>> Date: Tue, 09 Jan 2007 08:58:36 -0500
>>
>> On Tue, 2007-09-01 at 13:40 +0000, �?臻博 wrote:
>> > hello
>> >
>> > I am reading the code of apache. Is there anybody who knows whether
>> > ap_run_pre_connection() and ap_run_process_connection() are functions 
> or
>> > macro? and where is the definition for those two , as i can not find 
> any
>> > detailed code for them?
>> >
>> > Can anybody give me a hint? Thanks a lot!!!
>>
>> I'm just lurking here but I think you want to be looking at the apr
>> mailing lists:
>>
>> http://apr.apache.org/mailing-lists.html
>>
>> >
>> > br
>> > frankie
>> >
>> > _________________________________________________________________
>> > 与世界各地的朋友进行交流,免费下�? Live Messenger;
>> > http://get.live.com/messenger/overview
>> >
>>
>> -- 
>> --gh
>>
>>
> 
> _________________________________________________________________
> �����������ѽ��н�������ʹ�� Live Messenger;
> http://get.live.com/messenger/overview

Re: process the request

Posted by Guy Hulbert <gw...@eol.ca>.
On Tue, 2007-09-01 at 14:03 +0000, 张 臻博 wrote:
> hi,
> 
> Acturally, from APR, you can not find any hint for those two. As you search 
> from this place: http://docx.itscales.com/annotated.html  you can not find 
> the link for those two.... anyone knows where can find the source code or 
> some information?

Sorry, I was being stupid.  Obviously ap_ is apache and apr_ is apr.

I can't see the version number at the URL above but there are THREE
different branches of apache2: 2.0, 2.2 and 2.3

http://httpd.apache.org/dev/devnotes.html

You can check these out using a subversion client and you can browse the
sources here:

http://svn.apache.org/repos/asf/httpd/httpd/

versions 2.3 is under 'trunk' and the other two are under 'branches'.

It would probably faster to find the data structures you are looking for
by checking the code out (use 'trunk' first) and using:
	find -name '*.[ch] | grep 'ap_run_pre_connection'
to find which file they are defined in.


<snip>

-- 
--gh



Re: process the request

Posted by 张 臻博 <la...@hotmail.com>.
hi,

Acturally, from APR, you can not find any hint for those two. As you search 
from this place: http://docx.itscales.com/annotated.html  you can not find 
the link for those two.... anyone knows where can find the source code or 
some information?

br
frankie


>From: Guy Hulbert <gw...@eol.ca>
>Reply-To: dev@httpd.apache.org
>To: dev@httpd.apache.org
>Subject: Re: process the request
>Date: Tue, 09 Jan 2007 08:58:36 -0500
>
>On Tue, 2007-09-01 at 13:40 +0000, �?臻博 wrote:
> > hello
> >
> > I am reading the code of apache. Is there anybody who knows whether
> > ap_run_pre_connection() and ap_run_process_connection() are functions 
or
> > macro? and where is the definition for those two , as i can not find 
any
> > detailed code for them?
> >
> > Can anybody give me a hint? Thanks a lot!!!
>
>I'm just lurking here but I think you want to be looking at the apr
>mailing lists:
>
>http://apr.apache.org/mailing-lists.html
>
> >
> > br
> > frankie
> >
> > _________________________________________________________________
> > 与世界各地的朋友进行交流,免费下�? Live Messenger;
> > http://get.live.com/messenger/overview
> >
>
>--
>--gh
>
>

_________________________________________________________________
�����������ѽ��н�������ʹ�� Live Messenger; 
http://get.live.com/messenger/overview 


Re: process the request

Posted by Guy Hulbert <gw...@eol.ca>.
On Tue, 2007-09-01 at 13:40 +0000, 张 臻博 wrote:
> hello
> 
> I am reading the code of apache. Is there anybody who knows whether 
> ap_run_pre_connection() and ap_run_process_connection() are functions or 
> macro? and where is the definition for those two , as i can not find any 
> detailed code for them?
> 
> Can anybody give me a hint? Thanks a lot!!!

I'm just lurking here but I think you want to be looking at the apr
mailing lists:

http://apr.apache.org/mailing-lists.html

> 
> br
> frankie
> 
> _________________________________________________________________
> 与世界各地的朋友进行交流,免费下载  Live Messenger; 
> http://get.live.com/messenger/overview 
> 

-- 
--gh



Re: process the request

Posted by Ruediger Pluem <rp...@apache.org>.

On 01/09/2007 10:23 PM, Ruediger Pluem wrote:
> 
> On 01/09/2007 08:52 PM, Sander Temme wrote:
> 
>>Frankie,
>>
>>On Jan 9, 2007, at 11:37 AM, 张 臻博 wrote:
>>
>>
>>>Thanks all for your valuable answer. I think now i am clear. 
>>>Acturally, I am now trying to write some new code for Apache. It 
>>>makes Apache be possible to be used in another protocol layer...
>>
>>
>>If you are looking to implement different protocols, you may look at 
>>mod_pop3 and mod_ftp for examples.
> 
> 
> http://svn.apache.org/viewvc/httpd/mod_pop3/
> http://svn.apache.org/viewvc/incubator/mod_ftp/
> 
> Or mod_smtp
> 
> http://svn.apache.org/viewvc/httpd/mod_smtpd/

Forgot mod_echo (part of httpd) of course as one of the simplest non HTTP(S)
implementing modules.

Regards

Rüdiger



Re: process the request

Posted by Ruediger Pluem <rp...@apache.org>.

On 01/09/2007 08:52 PM, Sander Temme wrote:
> Frankie,
> 
> On Jan 9, 2007, at 11:37 AM, 张 臻博 wrote:
> 
>> Thanks all for your valuable answer. I think now i am clear. 
>> Acturally, I am now trying to write some new code for Apache. It 
>> makes Apache be possible to be used in another protocol layer...
> 
> 
> If you are looking to implement different protocols, you may look at 
> mod_pop3 and mod_ftp for examples.

http://svn.apache.org/viewvc/httpd/mod_pop3/
http://svn.apache.org/viewvc/incubator/mod_ftp/

Or mod_smtp

http://svn.apache.org/viewvc/httpd/mod_smtpd/

Regards

Rüdiger


Re: process the request

Posted by Sander Temme <sc...@apache.org>.
Frankie,

On Jan 9, 2007, at 11:37 AM, 张 臻博 wrote:

> Thanks all for your valuable answer. I think now i am clear.  
> Acturally, I am now trying to write some new code for Apache. It  
> makes Apache be possible to be used in another protocol layer...

If you are looking to implement different protocols, you may look at  
mod_pop3 and mod_ftp for examples.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF



Re: process the request

Posted by 张 臻博 <la...@hotmail.com>.
Hello,

Thanks all for your valuable answer. I think now i am clear. Acturally, I 
am now trying to write some new code for Apache. It makes Apache be 
possible to be used in another protocol layer...

Thanks a lot.
br
frankie


>From: "Jeff Trawick" <tr...@gmail.com>
>Reply-To: dev@httpd.apache.org
>To: dev@httpd.apache.org
>Subject: Re: process the request
>Date: Tue, 9 Jan 2007 13:32:43 -0500
>
>On 1/9/07, 张 臻博 <la...@hotmail.com> wrote:
>>hello
>>
>>I am reading the code of apache. Is there anybody who knows whether
>>ap_run_pre_connection() and ap_run_process_connection() are 
>>functions or
>>macro? and where is the definition for those two , as i can not 
>>find any
>>detailed code for them?
>
>macros
>
>The chase begins with http_connection.h:
>
>/**
>* This hook gives protocol modules an opportunity to set everything 
>up
>* before calling the protocol handler.  All pre-connection hooks are
>* run until one returns something other than ok or decline
>* @param c The connection on which the request has been received.
>* @param csd The mechanism on which this connection is to be read.
>*            Most times this will be a socket, but it is up to the 
>module
>*            that accepts the request to determine the exact type.
>* @return OK or DECLINED
>*/
>AP_DECLARE_HOOK(int,pre_connection,(conn_rec *c, void *csd))
>
>/**
>* This hook implements different protocols.  After a connection has 
>been
>* established, the protocol module must read and serve the request.  
>This
>* function does that for each protocol module.  The first protocol 
>module
>* to handle the request is the last module run.
>* @param c The connection on which the request has been received.
>* @return OK or DECLINED
>*/
>AP_DECLARE_HOOK(int,process_connection,(conn_rec *c))
>
>
>What do you want to find out?  The actual implementation isn't so
>interesting.  If you want to see how to implement your own 
>connection
>hook, see how the "process_connection" string is used in Apache in a
>few macro invocations.

_________________________________________________________________
与世界各地的朋友进行交流,免费下载  Live Messenger; 
http://get.live.com/messenger/overview 


Re: process the request

Posted by Jeff Trawick <tr...@gmail.com>.
On 1/9/07, 张 臻博 <la...@hotmail.com> wrote:
> hello
>
> I am reading the code of apache. Is there anybody who knows whether
> ap_run_pre_connection() and ap_run_process_connection() are functions or
> macro? and where is the definition for those two , as i can not find any
> detailed code for them?

macros

The chase begins with http_connection.h:

/**
 * This hook gives protocol modules an opportunity to set everything up
 * before calling the protocol handler.  All pre-connection hooks are
 * run until one returns something other than ok or decline
 * @param c The connection on which the request has been received.
 * @param csd The mechanism on which this connection is to be read.
 *            Most times this will be a socket, but it is up to the module
 *            that accepts the request to determine the exact type.
 * @return OK or DECLINED
 */
AP_DECLARE_HOOK(int,pre_connection,(conn_rec *c, void *csd))

/**
 * This hook implements different protocols.  After a connection has been
 * established, the protocol module must read and serve the request.  This
 * function does that for each protocol module.  The first protocol module
 * to handle the request is the last module run.
 * @param c The connection on which the request has been received.
 * @return OK or DECLINED
 */
AP_DECLARE_HOOK(int,process_connection,(conn_rec *c))


What do you want to find out?  The actual implementation isn't so
interesting.  If you want to see how to implement your own connection
hook, see how the "process_connection" string is used in Apache in a
few macro invocations.