I've done some work over last 24 hours and have an outline of
abstracting the io functions. The aim is to remove the distinction
between files, socket and pipes - replacing them with a single apr_io_t
type. The exercise of figure out how it should work certainly opened my
eyes to how complex we've made the whole thing!
I've simply added the new code at present, but in order to gain much
we'd need to ditch the older code, hence it's really a change for 2.x
and beyond.
So far I have basic creation and closing working, but now the
architecture is in place getting read/write working shouldn't be hard.
There's also a small test app to make sure it's all working as expected.
Providing the same level of access we have at present isn't as easy as
it looks, and finding a simple api that covers everything may well be
impossible, but I'm hopeful we can cover most things under a nice simple
api. Exactly how much the perf will be hurt by the changes - I'm not
sure at present but may know once I have read/write working.
A few things have cropped up though that I'm not really sure about.
Why don't we have readv?
Why don't we just have a "flagged" version of the functions to open
stdxxx? Having both seems a touch silly and dramatic overkill.
Unless people scream about this not being the right direction to go I'll
try and find some time to progress the work a little more over the next
few days.
david