You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "JupiterHost.Net" <ml...@jupiterhost.net> on 2006/05/04 21:41:11 UTC

[users@httpd] Apache 1.3 to 2.X module porting: function "name/argument/return/include" changes?

In porting a module from apache 1.3 to 2.0/2.2

I'm seeing these apache specific elements:

request_rec * r:
static int foo (request_rec * r)
r->uri
r->server->server_hostname
r->pool

ap_getword:
w = ap_getword(r->pool, &dnam, '/');  /* previosuly: char *name = 
r->uri; ... dname = name + 2; */

ap_pstrcat:
filename = ap_pstrcat (r->pool, XYZROOT, "/", w, NULL); /* previously: 
#define BWROOT "/var/cpanel/bwlimited" */

ap_basic_http_header(r)
ap_rvputs(r, "text", NULL);
ap_rputs("text", r);
ap_kill_timeout (r);
ap_finalize_request_protocol (r);
ap_rflush(r)

I can't seem to find the Apache 2.X equivalents for them so my questions 
would be for each one:

a) What are apache 2.0 and 2.2's equivalent name?

b) Does it take the same arguments as the examples above?

c) Does it return the same things when called with equivalent arguments??

d) Is it still part of one of the following includes or do I need to 
include a new .h?

#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_log.h"
#include "http_request.h"

Any input is greatly appreciated 'cause I am stuck :) !!

TIA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 1.3 to 2.X module porting: function "name/argument/return/include" changes?

Posted by "JupiterHost.Net" <ml...@jupiterhost.net>.
I've commented on each one with what I have deduced so far, any insight 
into if I am correct or not or are missing something would be awesome :)

JupiterHost.Net wrote:

> In porting a module from apache 1.3 to 2.0/2.2
> 
> I'm seeing these apache specific elements:
> 
> request_rec * r:
> static int foo (request_rec * r)
> r->uri
> r->server->server_hostname
> r->pool

Those 4 are the same in 2.0/2.2 and 1.3

> ap_getword:
> w = ap_getword(r->pool, &dnam, '/');  /* previosuly: char *name = 
> r->uri; ... dname = name + 2; */

??? Can't seem to find documentation

> ap_pstrcat:
> filename = ap_pstrcat (r->pool, XYZROOT, "/", w, NULL); /* previously: 
> #define XYZROOT "/var/cpanel/bwlimited" */

??? Can't seem to find documentation

> ap_basic_http_header(r)

Need to:
    #include <apr_buckets.h>
and call with BB:
    ap_basic_http_header(r, apr_bucket_brigade * bb)

> ap_rvputs(r, "text", NULL);
> ap_rputs("text", r);

Those two are the same in 2.0/2.2 and 1.3

> ap_kill_timeout (r);

This one appears to not be in apache 2.X or have an equivelent. Do we 
just remove it and hope it all works out?

> ap_finalize_request_protocol (r);
> ap_rflush(r)

Those two are the same in 2.0/2.2 and 1.3

> I can't seem to find the Apache 2.X equivalents for them so my questions 
> would be for each one:
> 
> a) What are apache 2.0 and 2.2's equivalent name?
> 
> b) Does it take the same arguments as the examples above?
> 
> c) Does it return the same things when called with equivalent arguments??
> 
> d) Is it still part of one of the following includes or do I need to 
> include a new .h?
> 
> #include "httpd.h"
> #include "http_core.h"
> #include "http_config.h"
> #include "http_log.h"
> #include "http_request.h"
> 
> Any input is greatly appreciated 'cause I am stuck :) !!
> 
> TIA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org