API is not super convenient and implementation is lousy, but uploading
files is not a super common operation so that should be fine.
At least it supports large files with only a single in-memory copy.
Compress::Zstd decided to bundle libzstd instead of linking to the
system lib, and it predictably hasn't been updated in 6 years. I
consider that broken to the point of DO-NOT-USE.
Maybe I'll do a custom dlopen() wrapper for that later, but for now
let's just stick with gzip.
Copied from TUWF::Validate with a few small changes. I have a few more
features planned, but let's see how this goes first.
It's been an incredibly useful module in the past, I'm not sure right
now if I had ideas for potential improvements at some point, will need
to check notes.
And with this, I have a working rewrite of the manned.org backend into
FU. \o/
The $st->row methods are very useful even for queries that may not
return anything, so their old behavior was unhelpful. Interestingly
enough, the error-on-multiple-rows did catch an actual bug in
Manned.org, so I'm keeping that behavior.
Realized that, since html_() now returns a string, it's just as easy to
just pass that to fu->set_body(); no need for integration complexity.
Combined import options don't save much typing, not worth the overhead
either.
I initially planned to only implement the bare minimum to support
FastCGI under nginx, but ended up implementing the full protocol
instead. This is more code than I had expected and the code is also less
trivial than I had hoped. Will need to do more testing, pretty sure
there's bugs left.
Also TODO: test under alternative process managers + document
FU_LISTEN_PROTO.
I've also removed the max_request_body setting, this is something that
really ought to be configured in the web server instead.
A little tricky to get right, but it works pretty well.
TODO: Do something with --monitor.
I initially wanted to avoid the exec() and just let Perl continue
running the rest of the script after fork(), but that runs into the
problem that perl really doesn't like it when you fork() in BEGIN.