[Solved] iterating mod_magnet lighty.server.irequests(): which one is «current»?
For some reasons when iterating lighty.server.irequests()
I realized it would be convenient in particular case to skip processing «current» request – but I failed to find a way to do it.
Seems there is not any kind of ID in request so I tried req_item.start_time()
(according to docs it returns (secs, nsecs)) but nsecs was always zero. Table lighty.r
is generally read-only so I failed to generate custom ID too...
I can rebuild lighttpd and show build logs if needed
Replies (4)
RE: iterating lighty.server.irequests(): which one is «current»? - Added by gstrauss 3 months ago
Your posts should be standalone. If you are using mod_magnet and writing lua, you should indicate that context in your posts. This is your last reminder from me.
nsecs is not available unless you have enabled high-precision timestamps in lighttpd
server.feature-flagsserver.feature-flags += ("server.metrics-high-precision" => "enable")
Table
lighty.r
is generally read-only so I failed to generate custom ID too...
lighty.r
is generally read-only on purpose. What parts of the lighttpd-provided API do allow modifications? Why not use those? lighty.r.req_env[]
RE: [Solved] iterating mod_magnet lighty.server.irequests(): which one is «current»? - Added by blz 3 months ago
If you are using mod_magnet and writing lua, you should indicate that context in your posts.
Referring to mod_magnet Lua API
is not indicating the fact of using Lua and mod_magnet
? I'm asking about lighttpd and it is implying that I'm using lighttpd. I'm asking about Lua API which is implying that I'm using Lua and mod_magnet. AFAIK there is no any [documented] possibility to call lighty.server.irequests()
outside of mod_magnet
. How can I been blamed for the logicality and consistency?
What parts of the lighttpd-provided API do allow modifications? Why not use those? lighty.r.req_env[]
From the docs: «lighty.r.req_env[] … allows get/set of request environment variables … new variables will persist into the env passed to backend scripts.». I asked about unique request ID... using environment for this purpose obviously a bad practice, especially in a «passed to backend scripts» part. Further, I can't be sure that arbitrarily using request environment will never clash with something and I know nothing about allowed types/sizes and so on (except those came from Lua).
So I'm kindly asking – what is a proper/best method to have an request ID? (inside the mod_magnet context of course ;-) )
RE: [Solved] iterating mod_magnet lighty.server.irequests(): which one is «current»? - Added by blz 3 months ago
You SHOULD remove incorrect [Solved]. It's your forum but my question. Using your words – are you smart enough to realize that proposed solution is a dirty hack but not a solution? Having a unique object ID is not a subject for a discussion, as far as putting it to environment, request body or whatever improper places. Either we have (at least) an (documented) API to store custom data or not. It is not an opinion, but axiom.
RE: [Solved] iterating mod_magnet lighty.server.irequests(): which one is «current»? - Added by gstrauss 3 months ago
I realized it would be convenient ...
You're making a feature request and yet you are acting like an entitled ass. Goodbye.