markstos (Mark Stosberg)

Name
Mark Stosberg
Website/Blog
http://mark.stosberg.com/blog
Location
Richmond, Indiana, USA
Member Since
Sep 22, 2008 (about 1 year)

Following 7 githubbers and watching 60 repositories view all →

Public Repositories (14)

Public Activity feed

markstos commented on yanick/CGI.pm Mon Dec 07 19:03:25 -0800 2009
Comment in b132e1a:

Thanks for taking a look at this Yanick.

This is an area where I would rather follow a precedent than take our own approach. The CGI::Simple logic for reading from STDIN boils down to this:

my $length = $ENV{'CONTENT_LENGTH'} || 0;

# silently discard data ??? better to just close the socket ???
while ( $length > 0 ) {
  last unless _internal_read( $self, $handle, my $buffer );
  $length -= length( $buffer );
}

#

I also tried to look at the Mojo approach. It's read loop looks like this:

Request body

my $poll = IO::Poll->new;
$poll->mask(\*STDIN, POLLIN);
while (!$req->is_finished) {
    $poll->poll(0);
    my @readers = $poll->handles(POLLIN);
    last unless @readers;
    my $read = STDIN->sysread(my $buffer, CHUNK_SIZE, 0);
    $req->parse($buffer);
}

#

Mojo defines "is_finished()" as being in any one of the following states: "done", "done_with_leftovers" and "error". I did not completely trace through the logic to see how the object gets put into all of these states.

However, I did mock-up a comparable test case for both CGI::Simple and Mojo, and neither of them hang by simply setting the REQUEST_METHOD to "PUT".

RFC 2616, the HTTP 1.1 RFC, includes this: " The presence of a message-body in a request is signaled by the
inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers."

Neither CGI.pm or CGI::Simple currently pay attention to the Transfer-Encoding header at all. Mojo appears to respect the header, but it's approach is different enough that it doesn't appear easy to "port" to CGI.pm.

So in summary, I have two questions:

  1. Is there a reason the CGI::Simple approach won't work for us here?
  2. CGI.pm does appear to handle "chunked" messages, but it decides to do so not by checking for the Transfer-Encoding header, but by finding the absence of a Content-Length. By contrast, Mojo clearly has severa references to "Transfer-Encoding" and "transfer_encoding" in it's code base. Should we also be looking at updating our handling of this header and chunked transfers? I would think if there was a problem with current implementation there were be a bug report about it by now...
markstos started watching miyagawa/Tatsumaki Sun Dec 06 17:56:31 -0800 2009
Tatsumaki's description:
Plack-based nonblocking Web framework for IO-bound delayed response, server push (streaming) and long-poll comet
markstos commented on yanick/CGI.pm Wed Dec 02 19:49:20 -0800 2009
Comment in 6b1e993:

Thanks. This looks good.

For consistency, shouldn't we also document the "max_age" method?

markstos pushed to master at markstos/CGI.pm Wed Dec 02 19:21:44 -0800 2009
HEAD is f58d1b798b3428a0e56647c28bf7485f78012ec1

5 commits »

markstos pushed to master at markstos/CGI.pm Mon Nov 23 18:26:08 -0800 2009
HEAD is ace00b58efc686038340139733ac907ae4c4360c
markstos pushed to master at markstos/CGI.pm Mon Nov 23 18:15:22 -0800 2009
HEAD is 0d02994643cdf0fcf28145c7e2dc81830bd80851

5 commits »

markstos pushed to master at markstos/CGI.pm Mon Nov 23 18:08:12 -0800 2009
HEAD is 4b65e61898734a604f82432da8546bb4e4fa6ecb
markstos pushed to master at markstos/CGI-Application-PSGI Fri Nov 06 19:53:42 -0800 2009
HEAD is 4423c3af39fe20619131bdf1c03865e993fdedc7
markstos pushed to master at markstos/CGI-Application-PSGI Fri Nov 06 19:48:27 -0800 2009
HEAD is 794fcfac2692950ef29c6466cfabdc2e6fd2a0b2
markstos started watching Corion/www-mechanize-firefox Fri Nov 06 11:22:27 -0800 2009
www-mechanize-firefox's description:
The API of WWW::Mechanize, combined with the Javascript-power of FireFOx
markstos opened issue 2 on jgm/gitit Tue Nov 03 14:09:25 -0800 2009
"forgot password" option
markstos pushed to master at markstos/bitrot Sun Oct 11 12:17:40 -0700 2009
HEAD is b552080ead0de1a3e42950423b4b7a8bd03f901d

3 commits »

markstos forked nathanielksmith/bitrot Sun Oct 11 11:22:04 -0700 2009
Forked repository is at markstos/bitrot
markstos forked nathanielksmith/bitrot Sun Oct 11 11:17:47 -0700 2009
Forked repository has since been deleted.
markstos pushed to psgi_support at markstos/CGI.pm Sat Oct 03 17:08:35 -0700 2009
HEAD is 5756ce9ffcd76a0e5bc82214dbe99f6273e773d0

5 commits »

markstos pushed to master at markstos/CGI.pm Sat Oct 03 17:08:34 -0700 2009
HEAD is 615c380b8da92f2ce05f425233723f428ee6d61d
  • Yanick Champoux committed 615c380b:
    rt-39904: CGI::Carp fatalsToBrowser does not catch stringifiable objects
markstos pushed to master at markstos/html--parser--simple Sat Oct 03 15:42:59 -0700 2009
HEAD is ae71c98a392331af1d12de34816b9af9f2d68646
markstos pushed to master at markstos/html--parser--simple Sat Oct 03 14:48:03 -0700 2009
HEAD is d6a04346cfa85dd0c9e5019985dddd8ef431d8a5

3 commits »

markstos pushed to master at markstos/html--parser--simple Sat Oct 03 14:25:28 -0700 2009
HEAD is 8baaddbbeacc6f0cacb21d55407d5b99fbb04356
markstos pushed to master at markstos/html--parser--simple Sat Oct 03 14:02:23 -0700 2009
HEAD is 94ce4df3780aba083dd97c61397bfe29b5106ec9
markstos pushed to master at markstos/html--parser--simple Thu Oct 01 19:35:28 -0700 2009
HEAD is c2dfae72890a14a6e11d36893b142a358db23f24

3 commits »

markstos started watching gfx/Perl-HTML-FillInForm-Lite Thu Oct 01 09:32:09 -0700 2009
Perl-HTML-FillInForm-Lite's description:
A repository for HTML::FillInForm::Lite