You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stefan Eissing <st...@greenbytes.de> on 2016/09/28 15:16:57 UTC

connection ids

I added a test suite putting load onto a CGI script to test IO and got spurious 500 responses. The log showed the infamous "End of script output before headers" which we had in another context already. Turns out that mod_cgid sends the conn_rec->id to the daemon as an identifier for the *request*. That did not work well, with http2 slave connections having the same id as their master (until today). 

Any advice on how to convert the master connection id into a unique slave connection id with high probability? I currently do a XOR with the requests pool address, but casting to (unsigned long) might be a constant value on some architectures. Some APR random() thingie you can recommend? Add a function to mpm to hand out ids?

-Stefan

Re: connection ids

Posted by "Helmut K. C. Tessarek" <te...@evermeet.cx>.
On 2016-09-28 11:16, Stefan Eissing wrote:
> Any advice on how to convert the master connection id into a unique
> slave connection id with high probability? 

How about using a UUID? Either v4 or a somewhat derived version of it:

mmmmmmmm-xxxx-4xxx-yxxx-xxxxxxxxxxxx

e.g. use the first part (mmmmmmmm) to indicate the master connection.

Cheers,
  K. C.

-- 
regards Helmut K. C. Tessarek
lookup http://sks.pkqs.net for KeyID 0xC11F128D

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/