Here's another reasonable-looking patch from Philippe Troin; it exposes
child_num() in Apache::Connection.

-- 
Daniel Jacobowitz                           Debian GNU/Linux Developer
Monta Vista Software                              Debian Security Team
                         "I am croutons!"


Package: libapache-mod-perl
Version: 1.25-2
Severity: wishlist

Included is more more patchlet to libapache-mod-perl.

It adds the child_num() method to the Apache::Connection class.

Why ?

  - The Apache C API has it, why not the perl API ?

  - You can do some cool stuff with it... I've used it as an index to
    a pseudo-scoreboard which forbids the same IP address to download
    the same file with two or more connection (that is bounce the
    download managers which were saturating my Apache server with
    multiple non-overlapping requests to the same file "to speed-up
    downloads").

It's a trivial patch. Please forward upstream.

Phil.

diff -ruN libapache-mod-perl-1.25.maint/Apache/Apache.pm libapache-mod-perl-1.25/Apache/Apache.pm
--- libapache-mod-perl-1.25.maint/Apache/Apache.pm	Thu Feb 22 01:01:58 2001
+++ libapache-mod-perl-1.25/Apache/Apache.pm	Thu Feb 22 01:02:13 2001
@@ -567,6 +567,10 @@
 This can be used to detect client disconnect without doing any I/O,
 e.g. using IO::Select.
 
+=item $c->child_num
+
+Returns which child number (or "slot") handles the connection.
+
 =back
 
 =back
diff -ruN libapache-mod-perl-1.25.maint/src/modules/perl/Connection.xs libapache-mod-perl-1.25/src/modules/perl/Connection.xs
--- libapache-mod-perl-1.25.maint/src/modules/perl/Connection.xs	Fri Sep 29 07:41:30 2000
+++ libapache-mod-perl-1.25/src/modules/perl/Connection.xs	Thu Feb 22 01:02:13 2001
@@ -157,6 +157,16 @@
     OUTPUT:
     RETVAL
 
+int
+child_num(conn)
+    Apache::Connection	conn
+
+    CODE:
+    RETVAL = conn->child_num;
+
+    OUTPUT:
+    RETVAL
+
 char *
 auth_type(conn, ...)
     Apache::Connection	conn


Reply via email to