httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andriy Gapon <andriy.ga...@hybridcluster.com>
Subject mod_fcgid: consolidate command and vhost comparison
Date Thu, 26 Sep 2013 08:35:07 GMT

We would like to propose the attached patch.
It is inspired by the several iterations of changing the respective checks.

    use macros for the code that checks for command and virtual host sameness

    That code consists of several lines which were duplicated in several
    places.  Now the code is slightly more compact and all the logic is
    in a single place.

    We use macros as opposed to inline functions because we use them with
    different argument types.  The only requirement on the types is that
    the field names must follow a common convention.

Possibly the next logical step could be to introduce a new struct that would
hold all the ID fields and then use that struct as a member in all other structs
that currently keep the ID information as an assortment of the fields.
In other words, to make the following public (and with a better name):
+    struct last_id {
+        apr_ino_t inode;
+        apr_dev_t deviceid;
+        const char *cmdline;
+        gid_t gid;
+        uid_t uid;
+        int vhost_id;
+    } last_id;
-- 
Andriy Gapon

Mime
View raw message