~mdw
/
odin-cgi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgi/ip: Be a FastCGI program.
[odin-cgi]
/
cgi
/
ip
diff --git
a/cgi/ip
b/cgi/ip
index
997bcbc
..
c2c8cc0
100755
(executable)
--- a/
cgi/ip
+++ b/
cgi/ip
@@
-1,4
+1,5
@@
-#! /usr/bin/perl
+#! /usr/bin/cgi-fcgi-interp /usr/bin/perl
+### -*-perl-*-
###
### IP-address reporting webservice for Odin
###
###
### IP-address reporting webservice for Odin
###
@@
-25,11
+26,14
@@
use lib 'lib';
use Odin;
use lib 'lib';
use Odin;
+use CGI::Fast;
-print <<EOF;
+while (my $cgi = CGI::Fast->new) {
+ my $addr = $cgi->remote_addr;
+ print <<EOF;
Content-type: text/plain; charset=us-ascii
X-AGPL-Source: $Odin::SRCURL
Content-type: text/plain; charset=us-ascii
X-AGPL-Source: $Odin::SRCURL
-$
ENV{REMOTE_ADDR}
+$
addr
EOF
EOF
-exit 0;
+}