Re: Module that forward requests

2009-07-14 Thread ricardo13

Any suggestion ?

Ricardo



ricardo13 wrote:
> 
> Hi all,
> 
> This attached file is my proxy module.
> 
> When I start APACHE write in log_error_log
> Configuration Failed
> 
> What's error ??
> 
> Thank you
> Ricardo
> 
> 
> ricardo13 wrote:
>> 
>> hi,
>> 
>> I'm newbie in APR and need develop a module that forward request to
>> cluster. The same in mod_rewrite with flag [P].
>> 
>> That module, I processing the object request_rec->uri and set what
>> machine in cluster forward the request.
>> 
>> Thank you.
>> Ricardo
>> 
>  http://www.nabble.com/file/p24478628/meu_modulo.c meu_modulo.c 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24479756.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-14 Thread ricardo13

Hi all,

This attached file is my proxy module.

When I start APACHE write in log_error_log
Configuration Failed

What's error ??

Thank you
Ricardo


ricardo13 wrote:
> 
> hi,
> 
> I'm newbie in APR and need develop a module that forward request to
> cluster. The same in mod_rewrite with flag [P].
> 
> That module, I processing the object request_rec->uri and set what machine
> in cluster forward the request.
> 
> Thank you.
> Ricardo
> 
http://www.nabble.com/file/p24478628/meu_modulo.c meu_modulo.c 
-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24478628.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-14 Thread ricardo13



Eric Covener wrote:
> 
> On Tue, Jul 14, 2009 at 7:37 AM, Tom Evans
> wrote:
>> On Tue, 2009-07-14 at 03:22 -0700, ricardo13 wrote:
> 
>>> r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", "http",
>>> "ip_machine",
>>> "port_machine", r->filename);
> 
> 
> # of %s in format doesn't agree with # of arguments, right?
> 
> Ok. I don't see. I've resolved this problem.
> And about proxy ?? That's right ??
> 
> Thank you.
> Ricardo
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24477945.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-14 Thread ricardo13



Tom Evans-3 wrote:
> 
> On Tue, 2009-07-14 at 03:22 -0700, ricardo13 wrote:
>> Hi,
>> 
>> Yesterday, I studied mod_rewrite very much and I believe that
>> fully_qualify_uri() function is where mod_rewrite does proxy.
>> 
>> That's right ?? This is way ??
>> 
>> Other question, I copied fully_qualify_uri() function, but when print
>> value
>> r->filename give error:
>> For example, in code:
>> 
>> r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", "http",
>> "ip_machine",
>> "port_machine", r->filename);
>> 
>> ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,"MEU_MODULE
>> PROXY:
>> %s", r->filename);
>> 
>> In error_log shows:
>> MEU_MODULE PROXY:
>> http://ip_machine:port_machine(null)\x18#W\xb7[$\x07\bHl\xef\t\xd4m\xef\t\xdcm\xef\t\x04\n\xef\t
>> 
>> What's this ?
>> 
>> Thank you.
>> Ricardo
>> 
> 
> It's called C. Character arrays are null terminated, and if they are
> not, things that print it tend to keep printing random bits of memory
> until they happen to hit a null byte. 
> 
> OK. And about proxy ? That's right ?
> Remenber that Im trying to develop a module contains reverse proxy.
> 
> Thank you
> Ricardo
> 
> Cheers
> 
> Tom
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24477905.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-14 Thread Eric Covener
On Tue, Jul 14, 2009 at 7:37 AM, Tom Evans wrote:
> On Tue, 2009-07-14 at 03:22 -0700, ricardo13 wrote:

>> r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", "http", "ip_machine",
>> "port_machine", r->filename);


# of %s in format doesn't agree with # of arguments, right?

-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-14 Thread Tom Evans
On Tue, 2009-07-14 at 03:22 -0700, ricardo13 wrote:
> Hi,
> 
> Yesterday, I studied mod_rewrite very much and I believe that
> fully_qualify_uri() function is where mod_rewrite does proxy.
> 
> That's right ?? This is way ??
> 
> Other question, I copied fully_qualify_uri() function, but when print value
> r->filename give error:
> For example, in code:
> 
> r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", "http", "ip_machine",
> "port_machine", r->filename);
> 
> ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,"MEU_MODULE PROXY:
> %s", r->filename);
> 
> In error_log shows:
> MEU_MODULE PROXY:
> http://ip_machine:port_machine(null)\x18#W\xb7[$\x07\bHl\xef\t\xd4m\xef\t\xdcm\xef\t\x04\n\xef\t
> 
> What's this ?
> 
> Thank you.
> Ricardo
> 

It's called C. Character arrays are null terminated, and if they are
not, things that print it tend to keep printing random bits of memory
until they happen to hit a null byte. 

Cheers

Tom



Re: Module that forward requests

2009-07-14 Thread ricardo13

Hi,

Yesterday, I studied mod_rewrite very much and I believe that
fully_qualify_uri() function is where mod_rewrite does proxy.

That's right ?? This is way ??

Other question, I copied fully_qualify_uri() function, but when print value
r->filename give error:
For example, in code:

r->filename = apr_psprintf(r->pool, "%s://%s%s%s%s", "http", "ip_machine",
"port_machine", r->filename);

ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,"MEU_MODULE PROXY:
%s", r->filename);

In error_log shows:
MEU_MODULE PROXY:
http://ip_machine:port_machine(null)\x18#W\xb7[$\x07\bHl\xef\t\xd4m\xef\t\xdcm\xef\t\x04\n\xef\t

What's this ?

Thank you.
Ricardo


ricardo13 wrote:
> 
> hi,
> 
> I'm newbie in APR and need develop a module that forward request to
> cluster. The same in mod_rewrite with flag [P].
> 
> That module, I processing the object request_rec->uri and set what machine
> in cluster forward the request.
> 
> Thank you.
> Ricardo
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24476948.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 1:30 PM, ricardo13 wrote:
> r->proxyreq == PROXYREQ_PROXY;
>
> But in httpd.h, the request_rec object hasn't field proxyreq.
> What's this ??

In my 2.2.x headers it's an int in the request_rec.

-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-13 Thread ricardo13

Hi,

I'm studying proxy in mod_rewrite and I saw the following line:

request_rec *r;

r->proxyreq == PROXYREQ_PROXY;

But in httpd.h, the request_rec object hasn't field proxyreq.
What's this ??

Thank you
Ricardo


ricardo13 wrote:
> 
> hi,
> 
> I'm newbie in APR and need develop a module that forward request to
> cluster. The same in mod_rewrite with flag [P].
> 
> That module, I processing the object request_rec->uri and set what machine
> in cluster forward the request.
> 
> Thank you.
> Ricardo
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24465978.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread ricardo13



Eric Covener wrote:
> 
> On Mon, Jul 13, 2009 at 10:46 AM, ricardo13
> wrote:
> 
>>> Not arbitrarily.  You can store that value in a note (r->notes) and
>>> set/query via rewrite if you're not looking to do much development.
>>>
>>>
>>> You can store that value in a note (r->notes)
>>> How do I do it ?? Remember, using external program. Because my external
>>> program classifies requests.
>>>
> 
> Why do your followups have the same level of quoting as the thing
> you're replying to?
> Weird  :confused:
> 
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24463773.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 10:46 AM, ricardo13 wrote:

>> Not arbitrarily.  You can store that value in a note (r->notes) and
>> set/query via rewrite if you're not looking to do much development.
>>
>>
>> You can store that value in a note (r->notes)
>> How do I do it ?? Remember, using external program. Because my external
>> program classifies requests.
>>

Why do your followups have the same level of quoting as the thing
you're replying to?

-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-13 Thread ricardo13



Eric Covener wrote:
> 
> On Mon, Jul 13, 2009 at 10:33 AM, ricardo13
> wrote:
>>
>>
>>
>> Eric Covener wrote:
>>>
>>> On Mon, Jul 13, 2009 at 10:06 AM, ricardo13
>>> wrote:
>>>>>> It's difficult. I'd suggest finding a way to use existing modules.
>>>>>
>>>>> Use or modify, that is.
>>>>> Can my module to use mod_proxy for forward requests ? How do I do it ?
>>>
>>> I'm not convinced you need a module.  mod_rewrite already illustrates
>>> this with the P flag.
>>>
>>> Because I need modify request_rec object. You told me (in other topic)
>>> that cannot modify request_rec object in external program in
>>> mod_rewrite.
>>> I use external program for schedule request.
>>>
>>> My idea is prioritize requests. I will do this form:
>>>
>>> 1° Modify field priority in request_rec. (I will create this field in
>>> request_rec)
> 
> Not arbitrarily.  You can store that value in a note (r->notes) and
> set/query via rewrite if you're not looking to do much development.
> 
> 
> You can store that value in a note (r->notes)
> How do I do it ?? Remember, using external program. Because my external
> program classifies requests.
> 
> 
> if you're not looking to do much development
> Sure !! Because I don't know nothing about APR. 
> 
> Thank you.
> Ricardo
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24463143.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 10:33 AM, ricardo13 wrote:
>
>
>
> Eric Covener wrote:
>>
>> On Mon, Jul 13, 2009 at 10:06 AM, ricardo13
>> wrote:
> It's difficult. I'd suggest finding a way to use existing modules.

 Use or modify, that is.
 Can my module to use mod_proxy for forward requests ? How do I do it ?
>>
>> I'm not convinced you need a module.  mod_rewrite already illustrates
>> this with the P flag.
>>
>> Because I need modify request_rec object. You told me (in other topic)
>> that cannot modify request_rec object in external program in mod_rewrite.
>> I use external program for schedule request.
>>
>> My idea is prioritize requests. I will do this form:
>>
>> 1° Modify field priority in request_rec. (I will create this field in
>> request_rec)

Not arbitrarily.  You can store that value in a note (r->notes) and
set/query via rewrite if you're not looking to do much development.




-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-13 Thread ricardo13



Eric Covener wrote:
> 
> On Mon, Jul 13, 2009 at 10:06 AM, ricardo13
> wrote:
>>>> It's difficult. I'd suggest finding a way to use existing modules.
>>>
>>> Use or modify, that is.
>>> Can my module to use mod_proxy for forward requests ? How do I do it ?
> 
> I'm not convinced you need a module.  mod_rewrite already illustrates
> this with the P flag.
> 
> Because I need modify request_rec object. You told me (in other topic)
> that cannot modify request_rec object in external program in mod_rewrite.
> I use external program for schedule request.
> 
> My idea is prioritize requests. I will do this form:
> 
> 1° Modify field priority in request_rec. (I will create this field in
> request_rec) 
> 2° After modified, I schedule the request to another machine. (using
> proxy)
> 3° When request arrive this machine, my worker.c will be able to analyze
> request_rec->priority (1 or 2) then threads priotize the requests.
> 
> Thank you
> Ricardo
> 
> 
> 
> 
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24462868.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 10:06 AM, ricardo13 wrote:
>>> It's difficult. I'd suggest finding a way to use existing modules.
>>
>> Use or modify, that is.
>> Can my module to use mod_proxy for forward requests ? How do I do it ?

I'm not convinced you need a module.  mod_rewrite already illustrates
this with the P flag.

-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-13 Thread ricardo13



Eric Covener wrote:
> 
> On Mon, Jul 13, 2009 at 9:53 AM, Eric Covener wrote:
>> On Mon, Jul 13, 2009 at 9:48 AM, ricardo13
>> wrote:
>>
>>>> Only opinion. Is this difficult ?? or easy ??
>>>> Because I haven't idea !!
>>
>> It's difficult. I'd suggest finding a way to use existing modules.
> 
> Use or modify, that is.
> Can my module to use mod_proxy for forward requests ? How do I do it ?
> 
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24462385.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



RE: Module that forward requests

2009-07-13 Thread ricardo13

Hi,


Houser, Rick wrote:
> 
>> I'm newbie in APR ... the same in mod_rewrite with flag [P].
> 
> If the mod_rewrite does what you need, you should use that rather than
> re-writing an alternate version on your own.
> 
> Yep, but mod_rewrite doesn't enable I modify request_rec structure, then I
> will do my module.
> My module is very simply, it does this:
> 
> char* ip;
> if(request_rec->variable = 1)
> strcpy(ip, "xxx.xxx.xxx.xxx");
> else
> strcpy(ip, "yyy.yyy.yyy.yyy");
> 
> forward_to_machine(ip);
> 
> Just it. My doubt is forward request as like mod_proxy, or flag [P] in
> mod_rewrite.
> I'm reading mod_proxy, but doesn't understood.
> 
> Thank you
> Ricardo 
> 
> 
> 
> 
> Thanks,
> 
> Rick Houser
> Auto-Owners Insurance
> Systems Support
> (517)703-2580
> 
> -Original Message-
> From: ricardo13 [mailto:ricardoogra...@gmail.com] 
> Sent: Monday, July 13, 2009 9:34 AM
> To: modules-dev@httpd.apache.org
> Subject: Module that forward requests
> 
> 
> hi,
> 
> I'm newbie in APR and need develop a module that forward request to
> cluster.
> The same in mod_rewrite with flag [P].
> 
> That module, I processing the object request_rec->uri and set what
> machine in cluster forward the request.
> 
> Thank you.
> Ricardo
> --
> View this message in context:
> http://www.nabble.com/Module-that-forward-requests-tp24461810p24461810.h
> tml
> Sent from the Apache HTTP Server - Module Writers mailing list archive
> at Nabble.com.
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24462303.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 9:53 AM, Eric Covener wrote:
> On Mon, Jul 13, 2009 at 9:48 AM, ricardo13 wrote:
>
>>> Only opinion. Is this difficult ?? or easy ??
>>> Because I haven't idea !!
>
> It's difficult. I'd suggest finding a way to use existing modules.

Use or modify, that is.

-- 
Eric Covener
cove...@gmail.com


RE: Module that forward requests

2009-07-13 Thread Houser, Rick
> I'm newbie in APR ... the same in mod_rewrite with flag [P].

If the mod_rewrite does what you need, you should use that rather than
re-writing an alternate version on your own.



Thanks,

Rick Houser
Auto-Owners Insurance
Systems Support
(517)703-2580

-Original Message-
From: ricardo13 [mailto:ricardoogra...@gmail.com] 
Sent: Monday, July 13, 2009 9:34 AM
To: modules-dev@httpd.apache.org
Subject: Module that forward requests


hi,

I'm newbie in APR and need develop a module that forward request to
cluster.
The same in mod_rewrite with flag [P].

That module, I processing the object request_rec->uri and set what
machine in cluster forward the request.

Thank you.
Ricardo
--
View this message in context:
http://www.nabble.com/Module-that-forward-requests-tp24461810p24461810.h
tml
Sent from the Apache HTTP Server - Module Writers mailing list archive
at Nabble.com.





Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 9:48 AM, ricardo13 wrote:

>> Only opinion. Is this difficult ?? or easy ??
>> Because I haven't idea !!

It's difficult. I'd suggest finding a way to use existing modules.

-- 
Eric Covener
cove...@gmail.com


Re: Module that forward requests

2009-07-13 Thread ricardo13



Eric Covener wrote:
> 
> On Mon, Jul 13, 2009 at 9:34 AM, ricardo13
> wrote:
>>
>> hi,
>>
>> I'm newbie in APR and need develop a module that forward request to
>> cluster.
>> The same in mod_rewrite with flag [P].
>>
>> That module, I processing the object request_rec->uri and set what
>> machine
>> in cluster forward the request.
> 
> Look at mod_proxy, mod_jk, mod_serf.
> ok !!!
> 
> Only opinion. Is this difficult ?? or easy ??
> Because I haven't idea !!
> 
> Thank you
> Ricardo 
> 
> 
> -- 
> Eric Covener
> cove...@gmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24462055.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.



Re: Module that forward requests

2009-07-13 Thread Eric Covener
On Mon, Jul 13, 2009 at 9:34 AM, ricardo13 wrote:
>
> hi,
>
> I'm newbie in APR and need develop a module that forward request to cluster.
> The same in mod_rewrite with flag [P].
>
> That module, I processing the object request_rec->uri and set what machine
> in cluster forward the request.

Look at mod_proxy, mod_jk, mod_serf.


-- 
Eric Covener
cove...@gmail.com


Module that forward requests

2009-07-13 Thread ricardo13

hi,

I'm newbie in APR and need develop a module that forward request to cluster.
The same in mod_rewrite with flag [P].

That module, I processing the object request_rec->uri and set what machine
in cluster forward the request.

Thank you.
Ricardo
-- 
View this message in context: 
http://www.nabble.com/Module-that-forward-requests-tp24461810p24461810.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at 
Nabble.com.