You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Supun Kamburugamuva <su...@gmail.com> on 2008/06/05 10:32:01 UTC

Moving axis2_*iis/apache2*_worker_process_request logic to a common place - Correct mail

Hi List,

We have a very large code inside both axis2_apache2_worker_process_request
and axis2_iis_worker_process_request methods. Both these codes are similar
and use the same logic. It is hard to maintain the same code in may places
and I would like to suggest to move the common logic in to the
http_transport_utils.c.

In oder to introduce a common method we need to pass lot of information from
the HTTP servers to this new method. We can do this by introducing a new
structure.

typedef struct {
    int content_lenght;
    axis2_char_t *url;
    axis2_char_t *http_method;
    axis2_conf_ctx_t *conf_ctx;
    axis2_char_t *soap_action;
    void *stream;
   /* There may be lot of other fields  */
} axis2_tranport_in_t;

Also we need a method to give what ever the processed information back to
the transport level. We can introduce another structure to do that

typedef struct {
    void *stream;
    int status;
    axis2_char_t *custom_error_messages;
    /* There may be other fields, feel free to comment on them */
} axis2_tranport_out_t;

So the Transport writers can fill this structure and give it to the method

axis2_status_t
axis2_http_tranport_utils_process_request(axutil_env_t *env,
                                                              const
axis2_transport_in_t *tr_in,

axutil_tranport_out_t *tr_our);

for processing. This method will fill the axutil_tranport_out_t and give it
back to the transport layer. Also we shouldn't add respective getter and
setter fields to these structures, since we are using these structures for
information exchange between two methods.

This is the rough idea that came into my mind and I'm sure all of you may
have better ideas than me -).

Regards,
Supun..

Re: Moving axis2_*iis/apache2*_worker_process_request logic to a common place - Correct mail

Posted by Samisa Abeysinghe <sa...@wso2.com>.
+1.

Samisa...

Nandika Jayawardana wrote:
> +1. I think this is a good approach. I think we should have the
> message context as  a member variable in both of these variables. In
> that way, what ever the module specific information can be passed
> through message context.  Since this is specific to http, I think
> these two structures should rather be axis2_http_transport_in and
> axis2_http_transport_out.
>
> 1+ for not having getter setter functions.
>
> Regards
> Nandika
>
> On Thu, Jun 5, 2008 at 2:02 PM, Supun Kamburugamuva <su...@gmail.com> wrote:
>   
>> Hi List,
>>
>> We have a very large code inside both axis2_apache2_worker_process_request
>> and axis2_iis_worker_process_request methods. Both these codes are similar
>> and use the same logic. It is hard to maintain the same code in may places
>> and I would like to suggest to move the common logic in to the
>> http_transport_utils.c.
>>
>> In oder to introduce a common method we need to pass lot of information from
>> the HTTP servers to this new method. We can do this by introducing a new
>> structure.
>>
>> typedef struct {
>>     int content_lenght;
>>     axis2_char_t *url;
>>     axis2_char_t *http_method;
>>     axis2_conf_ctx_t *conf_ctx;
>>     axis2_char_t *soap_action;
>>     void *stream;
>>    /* There may be lot of other fields  */
>> } axis2_tranport_in_t;
>>
>> Also we need a method to give what ever the processed information back to
>> the transport level. We can introduce another structure to do that
>>
>> typedef struct {
>>     void *stream;
>>     int status;
>>     axis2_char_t *custom_error_messages;
>>     /* There may be other fields, feel free to comment on them */
>> } axis2_tranport_out_t;
>>
>> So the Transport writers can fill this structure and give it to the method
>>
>> axis2_status_t
>> axis2_http_tranport_utils_process_request(axutil_env_t *env,
>>                                                               const
>> axis2_transport_in_t *tr_in,
>>
>> axutil_tranport_out_t *tr_our);
>>
>> for processing. This method will fill the axutil_tranport_out_t and give it
>> back to the transport layer. Also we shouldn't add respective getter and
>> setter fields to these structures, since we are using these structures for
>> information exchange between two methods.
>>
>> This is the rough idea that came into my mind and I'm sure all of you may
>> have better ideas than me -).
>>
>> Regards,
>> Supun..
>>
>>
>>     
>
>
>
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.0.0/1484 - Release Date: 6/4/2008 4:40 PM
>   


-- 
Samisa Abeysinghe 
Director, Engineering; WSO2 Inc.

http://www.wso2.com/ - "The Open Source SOA Company"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Re: Moving axis2_*iis/apache2*_worker_process_request logic to a common place - Correct mail

Posted by Nandika Jayawardana <ja...@gmail.com>.
+1. I think this is a good approach. I think we should have the
message context as  a member variable in both of these variables. In
that way, what ever the module specific information can be passed
through message context.  Since this is specific to http, I think
these two structures should rather be axis2_http_transport_in and
axis2_http_transport_out.

1+ for not having getter setter functions.

Regards
Nandika

On Thu, Jun 5, 2008 at 2:02 PM, Supun Kamburugamuva <su...@gmail.com> wrote:
> Hi List,
>
> We have a very large code inside both axis2_apache2_worker_process_request
> and axis2_iis_worker_process_request methods. Both these codes are similar
> and use the same logic. It is hard to maintain the same code in may places
> and I would like to suggest to move the common logic in to the
> http_transport_utils.c.
>
> In oder to introduce a common method we need to pass lot of information from
> the HTTP servers to this new method. We can do this by introducing a new
> structure.
>
> typedef struct {
>     int content_lenght;
>     axis2_char_t *url;
>     axis2_char_t *http_method;
>     axis2_conf_ctx_t *conf_ctx;
>     axis2_char_t *soap_action;
>     void *stream;
>    /* There may be lot of other fields  */
> } axis2_tranport_in_t;
>
> Also we need a method to give what ever the processed information back to
> the transport level. We can introduce another structure to do that
>
> typedef struct {
>     void *stream;
>     int status;
>     axis2_char_t *custom_error_messages;
>     /* There may be other fields, feel free to comment on them */
> } axis2_tranport_out_t;
>
> So the Transport writers can fill this structure and give it to the method
>
> axis2_status_t
> axis2_http_tranport_utils_process_request(axutil_env_t *env,
>                                                               const
> axis2_transport_in_t *tr_in,
>
> axutil_tranport_out_t *tr_our);
>
> for processing. This method will fill the axutil_tranport_out_t and give it
> back to the transport layer. Also we shouldn't add respective getter and
> setter fields to these structures, since we are using these structures for
> information exchange between two methods.
>
> This is the rough idea that came into my mind and I'm sure all of you may
> have better ideas than me -).
>
> Regards,
> Supun..
>
>



-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org