Signal Handling in mod_perl ...

2002-11-08 Thread Sylbert L




Hi,
 
I have this response handler, within which I've 
written this signal handler. When I pass a signal to that particular process, it 
is handled only when a request is processed, not when the signal is really 
received & all this is over a keepalive connection. I guess the Apache 
Process catches the signal .. but does nothing about it. Its only when the 
response handler is called, that the signal is passed to my signal handler. 
So in effect, my signal handler is used only when a request is processed & 
not when the signal is actually received by the process. 
 
What I'm trying to do is  .. communicate 
between processes & i'm using FIFOs ok  & i don't wanna use 
blocking IO. So when I write to a FIFO .. I want to send a custom 
signal to the appropriate process to read. Does anyone have any ideas ? see if i 
do this with perl it works just fine .. thats coz perl has control over the 
process in question .. but in this case its apache :( 
 
Thanks a bunch ..
 
Regards,
 
Sylbert L


installing a signal handler in module ..

2002-10-24 Thread Sylbert L
Hi ..

I need to catch a custom signal in my module. How do I do this ? I tried
writing a signal handler .. & put it into my Responsehandler module .. but
it doesn't seem to work. Is this possible ? How do I achieve this ?

Thanks ..




IO function ...

2002-10-23 Thread Sylbert L
Hi there .. i know this question doesn't really belong to this list .. but
does anyone have any idea if the standard IO functions in glibc 2.2.2-10 are
thread safe? Thanks a lot ...




getting the PID for a request

2002-10-18 Thread Sylbert L
Is there any way I can get the Process Id or thread ID for a particular
process / thread that is handling my request ? thanks a bunch ..




Passing data from ConnectionHandler to a ProtocolHandler ..

2002-09-25 Thread Sylbert L

Hi,

I need to modify the request object before it is handed over to a protocol
handler. I'm using 2.0, so suppose I implement a Connection Handler, within
which i read from the socket directly .. modify the data read, now how do I
pass on this modified data to the Protocol Handler ?

Tx




help with a simple redirect

2002-09-18 Thread Sylbert L

Hi ..

I'm trying to do a simple redirect using mod_perl 2.0, Apache 2.0.40  ..
just doesn't seem to work.

This is my code, in a file called MySocket.pm

package Apache::MySocket;

use strict;
use Apache::RequestRec ();
use Apache::compat();
use Apache::Const -compile => qw(OK REDIRECT);

sub handler {
my $r = shift;
$r->header_out("/test.html");
return Apache::REDIRECT;
}
1;

This is what i added to httpd.conf :

-

SetHandler modperl
PerlResponseHandler Apache::MySocket

-

When I do this : http://localhost/ok/ok i want the web server to redirect
to: http://localhost/test.html

Where am i going wrong ? I'm not getting any errors .. even 'error_log ' is
blank. Any clues ?

Thanks




Re: help getting started ..

2002-09-05 Thread Sylbert L

Thanks Stas, the code works just fine now.

This is what i'd read :

[Apache 1.3 is hardwired to speak only one protocol, HTTP. Apache 2.0 has
moved to more of a "server  framework" architecture making it possible to
plugin handlers for protocols other than HTTP. The protocol module design
also abstracts the transport layer so protocols such as SSL can be hooked
into the server without requiring modifications to the Apache source code.
This allows Apache to be extended much further than in the past, making it
possible to add support for protocols such as FTP, SMTP, RPC flavors and the
like. The main advantage being that protocol plugins can take advantage of
Apache's portability, process/thread management, configuration mechanism and
plugin API.]

So if this is true, then shouldn't it be possible for me to implment a
constant connection using Apache 2.0 ?

Thanks again,

Sylbert L

PS : Any idea when the API docs will be available ?

> I'm using Apache 2.0.40, with mod_perl 2.0, Perl 5.8.0 on Red Hat Linux
7.2.
>
> Also, I was just reading up on the mod_perl handlers. Is it possible to
> modify the working of apache, such that, it doesn't close the connection
> with the client ? and the connection with the client remains a constant
one
> until the client explicitly closes the connection ? Can this be done at a
> module level ? Or do I need to modify the Apache source to acomplish the
> same ? If its possible with mod_perl, which PerlHandler(s) need to be used
?

HTTP is a stateless protocol and while you have the KeepAlive
functionality to serve several requests over the same connection, you
cannot rely on that to keep the connection open.




help getting started ..

2002-09-05 Thread Sylbert L

Hi,

I'm just getting started with mod_perl. Was trying out the
Apache::CommandServer sample code provided in the documentation, but I seem
to get this error : Can't locate object method "run_access_checker" via
package "Apache::RequestRec" at .

I'm using Apache 2.0.40, with mod_perl 2.0, Perl 5.8.0 on Red Hat Linux 7.2.

Also, I was just reading up on the mod_perl handlers. Is it possible to
modify the working of apache, such that, it doesn't close the connection
with the client ? and the connection with the client remains a constant one
until the client explicitly closes the connection ? Can this be done at a
module level ? Or do I need to modify the Apache source to acomplish the
same ? If its possible with mod_perl, which PerlHandler(s) need to be used ?

Thanks a whole lot. I've just recently purchased Oreilly's "Writing Apache
Modules with Perl and C", but  realized that it isn't too much of help, coz
I'm dealing with Apache 2.0 & the book is all about Apache 1.3 & theres such
a drastic difference between the two mod_perl implementations. Is there any
other source of documentation / help I can find ?

Thanks Again,

Sylbert L

PS : The Code that I'm using can be found at :
http://perl.apache.org/docs/2.0/user/overview/overview.html#Apache__CommandS
erver_Source