Attempting to write a plugin

nginx.devlist.alias at fremnet.net nginx.devlist.alias at fremnet.net
Sun Mar 18 11:26:09 UTC 2012


So in the end, I gave up on C and made a perl module... not what I 
wanted but it works - and a whole lot less code

package SecureLink;

use strict;
use warnings;
use nginx;
use Digest::MD5 qw/md5/;
use MIME::Base64;

sub secure {
         my ($r, $secret, $path, $ttl) = @_;
         $ttl //= 1800;
         my $timeout = time() + $ttl;
         my $secure = encode_base64(md5("$timeout.$path.$secret"));
         $secure =~ tr!+/!-_!;
         chomp($secure);
         $r->print("$secure,$timeout");
         return OK;
}


On 17/03/2012 11:29 AM, Alexandr Gomoliako wrote:
>> I'm afraid all that did was showed me that the crash was happening in the
>> gzip filter - but it wasn't crashing before I added my module so I'm still
>> lost...
> I guess you have no choice but to play with gdb. It's not that hard actually:
>
>      gdb --args ./objs/nginx -p mynginx
>      >  r
>      ...
>      >  bt
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel



More information about the nginx-devel mailing list