Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

geoff (2013)

  reversethis-{gro ... om} {ta} {ffoeg}

see [] for personal information, links to presentations, GPG key, and so on.

Journal of geoff (2013)

Thursday November 04, 2004
09:36 AM


[ #21707 ]
I released Apache-SSLLookup to CPAN yesterday, which was created to address the issues mentioned in this mod_perl discussion thread.

while the module is only really useful for interacting with mod_ssl, the code itself is actually a nice, simple example of a few new mod_perl 2.0 concepts.

it is written entirely in XS (except for the Dynaloader bootstrapping, of course). that it uses XS at all means that the Makefile.PL is a good example of how mod_perl 2.0 makes it very easy to generate a Makefile that can find what it needs on all platforms. in mod_perl 1.0 you needed a Makefile.PL like this to work on Win32. there's also a cool little Apache-Test feature in use there, which shows up only if a test fails.

speaking of tests, if you want to use Apache-Test to test SSL things then you will need to generate server-side certificates for mod_ssl to use. I haven't generated certificates in ages, but fortunately I didn't need to figure it out again - simply creating the directory t/conf/ssl is enough to have Apache-Test automagically generate a handful of certificates for you. see the for an example of putting these to use so you can issue https requests in your tests.

I also had a bit of fun in that the class is a proper subclass of Apache::RequestRec, but the constructor is written entirely in XS as well. so, the module shows you what you need to do to emulate

our @ISA = qw(Apache::RequestRec);

sub new {
  my ($class, $r) = @_;

  return bless { _r => $r }, $class;

in XS.

lastly, it illustrates how to interact with Apache's new optional function hooks, which is a pretty cool thing if you happen to need to do that.

anyway, enjoy.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.