You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Andriy Gapon <an...@hybridcluster.com> on 2013/09/26 10:35:07 UTC

mod_fcgid: consolidate command and vhost comparison

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