Some PSGI questions and another anyevent server

22 views
Skip to first unread message

Thorben J

unread,
Jan 9, 2014, 2:15:30 AM1/9/14
to psgi-...@googlegroups.com
Hi all,

I was recently away without internet, but had some downtime. So I
decided to scratch an itch.

I have been using Twiggy as a test server for a framework and app that
I'm working on. However it involves WebDav, which requires HTTP 1.1. and
then things like Transfer-Encoding: chunked or Connection: keep-alive.

Originally I wrote a middleware module to use under twiggy and it sort
of worked, but the point of this email is, that I wrote a new anyevent
server implementation.

One can find it here:

http://yr.aran.eryri.ch/scratch/PxServer-AnyEvent-v0.5.0.tar.gz

Check the POD for a list of features. I am really happy with its
performance under the OS X webdav client.

I have a few questions:-

Why does the PSGI specs forbid an apps $env from having
HTTP_CONTENT_LENGTH or HTTP_CONTENT_TYPE?

My server always gives a buffered input stream and CONTENT_LENGTH gives
the number of bytes available in it. I thought that maybe some apps or
middleware would like to compare that with the original HTTP headers.
(Its a check my server does). I also thought I might do a magic number
mimetype check and set CONTENT_TYPE from that, but still keep the
original headers.

At the moment Plack's Lint module complains about the
HTTP_CONTENT_{TYPE,LENGTH}. My plan is to filter those headers out, if
loaded via its Plack::Handler module, but I was wondering why one would
want to remove any of the original headers?

WRT Transfer-Encoding, chunks are processed, CONTENT_LENGTH is set, but
I leave HTTP_TRANSFER_ENCODING as it is. I looked at the CGI RFC and
couldn't see if the PSGI spec got it from there.

My preference would be to leave all original headers available with the
HTTP_ prefix, all the info from the server is without that prefix.


Although the server scratches my itch, feedback is always welcome.


My other question is about naming. I'm not a fan of really deep
namespace paths names ABC::DEF::EFG::HIJ or names that give no hint as
to what the modules for.

So I was thinking about some short prefixes for various PSGI
parts/roles, followed by a name of the developers choice. In my case:

PxServer::AnyEvent or PxSvr::AnyEvent; - Linked above.

PxMidware::DeChunk; or PxMW::DeChunk; - Already mentioned, will upload.

PxFramework::ModMap or PxFW::ModMap; - Maps URLs to module names and
methods to subs within (includes WebDav support).

PxApp::Eluned - My web app.

Maybe PxServer::Twiggy ;-)

I have a pause account, but I thought I'd get some feedback before I
upload anything.

Regards,

Thorben

Pedro Melo

unread,
Jan 9, 2014, 6:41:18 AM1/9/14
to psgi-...@googlegroups.com
Hi,

out of curiosity, did you check Feersum as an alternative?

Bye,




--

--- You received this message because you are subscribed to the Google Groups "psgi-plack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psgi-plack+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Pedro Melo
@pedromelo
http://www.simplicidade.org/
xmpp:me...@simplicidade.org
mailto:me...@simplicidade.org

Thorben J

unread,
Jan 9, 2014, 6:54:10 AM1/9/14
to psgi-...@googlegroups.com
Hi Pedro,

No. Since I had no internet at the time, and if I had, I'm not sure that
I would have stumbled across it, for a number of reasons.

Regards,

Thorben
>> email to psgi-plack+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages