Reference to core request fails during compile

2019-01-26 Thread miim
I have undefined reference errors in an Apache module. I've cut the source code down to a minimum that reproduces the error. Below is the source for "mod_test.c" ... #include "httpd.h" #include "http_config.h"

Re: Reference to core request fails during compile

2019-01-27 Thread miim
Eric, you nailed the problem down precisely. Unfortunately while digging through the core source code it develops that getting the document root out of the core data structures is not a 100% reliable solution. Comments associated with the document root entries specifically state that If the

IPv4 vs IPv6 addressing

2021-09-13 Thread miim
I've reviewed the last three years of the list and I can't find a commentary on this issue, nor was I able to find one on goofle. Consider an incoming request which might have either an IPv4 or an IPv6 address. The module wants to know which one. It is possible to sscanf the value in

IPv4 vs IPv6 addressing

2021-09-14 Thread miim
Sorin, thank you. I now have a small chunk of code that appears to do the job. I do not have access to an IPv6 system to test with but it does identify the connection type correctly on my IPv4 system. I am not sure what APR_UNIX is, but it is referenced in the Apache source. /*

Re: Chasing a segfault, part II

2021-10-27 Thread miim
rin Manolache wrote: On 26/10/2021 08.18, miim wrote: > ua_pointer = apr_table_get(r->headers_in, "User-Agent"); >        /* Find out how long the Apache-supplied string is */ >    ualength = strlen(ua_pointer); If the request does not contain any user-agent then ua_po

Chasing a segfault

2021-10-22 Thread miim
I have a relatively simple module which is nonetheless causing Apache to intermittently segfault. I've added debugging trace messages to be sent to the error log, but the lack of anything in the log at the time of the segfault leads me to think that the error log is not flushed when a message

Chasing a segfault, part II

2021-10-26 Thread miim
My thanks to everyone for their input on this problem. While I was unable to get the backtrace and whatkilledus modules to report on failure, I isolated the cause to the following code in the handler. The code itself does not segfault and indeed it appears to execute properly, retrieving

Module portability

2021-12-08 Thread miim
I am not sure if this is a question for this list or for the APR forum, but it seems to me that this forum is more likely to have an answer. To what extent can I expect a module compiled on system A to be portable to system B: -- if both are running the same distribution of linux, though

Shared memory - Data between threads

2023-03-23 Thread miim
I used a mutex in implementing mod_spamhaus, mod_sorbscheck and mod_torcheck to maintain consistency across threads. I have not seen problems since. I found the Apache mutex code to be somewhat opaque, so I wrote my own. I did find that "interesting" but after several revisions I had