httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: questions related to compile!
Date Thu, 08 Feb 2007 16:26:13 GMT

On Feb 6, 2007, at 11:54 PM, 张 臻博 wrote:

> hello!
>>> How can i include the source file that i made in the Apache  
>>> server  comiplation process, while the module is still built as a  
>>> DSO by  using apxs
>> You would have to declare the structure in a header file, which  
>> you  #include in both your module source code and in the Apache  
>> source  file where you reference it. Then, when you configure  
>> httpd, you can  tell it where your header file lives by passing an  
>> environment  variable, like:
>> CFLAGS="-I/path/to/your/module/source" ./configure ...
> Thanks a lot to your kindly reply. The structure is declared in the  
> header file, however, it is initialized in the C source file(.c) in  
> the module part during the process of create_server_config. If i  
> just include the header file, will it work?
> Please let me describe what i want to do in a bit more detail.  
> Actually i try to implement a different layer to handle http  
> request&response. In the module part, in the header file i will  
> declare and in the c source file i will initialize a socket  
> structure that is different from the normal tcp socket structure. 
> (ap_listen_rec *ap_listeners). This new socket structure will be  
> used in the prefork.c & pollset.c during the polling procedure.  
> That is why i have to include the source file in the comiplation  
> procedure. What should be the best way to handle this situation?
> After the polling process, if the tcp socket is selected, then the  
> normal procedure handling the http request will be followed. 
> (ap_run_create_connection,ap_process_connection). If another type  
> of socket that is implemented by me is selected then one module in  
> my module will be called. The data will be read from this socket  
> and parsed to the normal http request. Then I will try to call the  
> (ap_rn_pre_connection,ap_run_process_connection) hook again. Before  
> sending back the resources, i will try to patch them back to the  
> data structure that is suitable for my layer's communication and  
> send it back. I am now just in the step implementing the new  
> polling procedure. Would you please give me some comments that will  
> be helpful for me to realize the goal(any comments will be  
> beneficial both in the polling process and the whole feature)?

It sounds almost like you might want to write your own MPM, and  
incorporate your code and data structure into that instead of calling  
back to another module.

Anyone else have an opinion on this?

> I just wonder if i successfully realize this feature. Is it  
> possible to include the modification to the new release of Apache  
> http server.

We welcome contributions to Apache, and have a page of guidelines for  

However, I would like to add some remarks that are my personal  
opinion, but I think reflect the attitude of the project contributors:

* We can only consider contributions in the form of source code. We
   can encourage ideas, but cannot make a decision based on anything
   but code patches

* For us to accept a patch, we will consider whether it serves a general
   need, and whether it will be used by Apache users other than yourself

* We will also look at the design and implementation of the patch, and
   how cleanly it applies to Apache (hint: making APR dependent on
   httpd would not be a good idea, see below)

* Apache 2.2.x is a stable/maintenance branch, and we are not putting
   any new features into it. New features and improvements go into the
   development trunk at:

* Finally, if the patch is large, or implements a significant new idea,
   we need to be certain that it can be maintained. This means that we
   need to fully understand what it does and how it works, or be sure
   that the contributor is an active member of the development
   community. Anyone can become part of the development community by
   participating in the mailinglist, submitting
   patches to fix bugs, testing releases and generally participating
   in the discussion. To judge whether someone is an active contributor,
   we look back at their past submissions and contributions

> Any comments are greatly appreciated. Thanks a lot in advance!

Regarding the header problem you describe in your other message, it  
looks like you included your module header file in an APR source  
file, and your build failed when compiling part of APR.  This  
happened because the APR build couldn't find the httpd headers that  
your header file includes... when you look back at the build output  
you posted you'll see that there is no reference to include  
directories under httpd.  The -I./include applies to srclib/apr/ 
include, because that is where that build happens.  You would  
probably better include those httpd headers from your C source file  
than from your header file.

Also, APR, the Apache Portable Runtime, is a library that is called  
(extensively) by the Apache source, but it is completely separate  
from httpd itself, and only bundled with httpd releases for  
convenience. APR knows nothing about the applications (like httpd)  
that use it, and this must remain so because of the code design.


PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

View raw message