summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/c-modules/httpd_test_util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:31 +0000
commitc9cf025fadfe043f0f2f679e10d1207d8a158bb6 (patch)
tree3a94effe0bdc0a6814d8134f4ed840d7cc6b6f19 /debian/perl-framework/c-modules/httpd_test_util.c
parentAdding upstream version 2.4.57. (diff)
downloadapache2-e483aacee00195ef2e2f1f5ae6277e6e8a5e6d62.tar.xz
apache2-e483aacee00195ef2e2f1f5ae6277e6e8a5e6d62.zip
Adding debian version 2.4.57-2.debian/2.4.57-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/c-modules/httpd_test_util.c')
-rw-r--r--debian/perl-framework/c-modules/httpd_test_util.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/perl-framework/c-modules/httpd_test_util.c b/debian/perl-framework/c-modules/httpd_test_util.c
new file mode 100644
index 0000000..bc8e608
--- /dev/null
+++ b/debian/perl-framework/c-modules/httpd_test_util.c
@@ -0,0 +1,44 @@
+/* poor man's optional functions
+ * if we didn't need to support 1.x we could use optional functions.
+ * just hack in this util functions with #define/#include/static for now.
+ *
+ * tho we could create our own version optional functions using
+ * the 1.3/2.0 dlsym-ish function to lookup function pointers given a
+ * mod_httpd_test_util.so and httpd_test_util.dynamic_load_handle
+ * but thats more trouble than it is worth at the moment.
+ */
+
+#ifdef WANT_HTTPD_TEST_SPLIT_QS_NUMBERS
+
+/* split query string in the form of GET /foo?1024,5000 */
+
+static int httpd_test_split_qs_numbers(request_rec *r, ...)
+{
+ va_list va;
+ char *endptr, *args = r->args;
+
+ if (!args) {
+ return 0;
+ }
+
+ va_start(va, r);
+
+ while (1) {
+ apr_size_t *s = va_arg(va, apr_size_t *);
+ if (!s) {
+ break;
+ }
+ *s = strtol(args, &endptr, 0);
+ if (endptr && (*endptr == ',')) {
+ ++endptr;
+ args = endptr;
+ }
+ }
+
+ va_end(va);
+
+ return 1;
+}
+
+#endif /* WANT_HTTPD_TEST_SPLIT_QS_NUMBERS */
+