Permalink
Browse files

State via psgix.body.scalar_refs that we support refs in the body

  • Loading branch information...
1 parent 50117a6 commit 90a076365d7e611301c8b2b2ada5db819d6a1cb5 @stash committed Aug 29, 2010
Showing with 8 additions and 4 deletions.
  1. +3 −2 Feersum.xs
  2. +2 −1 TODO
  3. +3 −1 t/03-env-hash.t
View
@@ -1582,8 +1582,9 @@ env (struct feer_conn *c, HV *e)
hv_store(e, "psgi.multithreaded", 18, &PL_sv_no, 0);
hv_store(e, "psgi.streaming", 14, &PL_sv_yes, 0);
hv_store(e, "psgi.errors", 11, newRV((SV*)PL_stderrgv), 0);
- hv_store(e, "psgix.input.buffered", 20, &PL_sv_yes, 0);
- hv_store(e, "psgix.output.buffered", 21, &PL_sv_yes, 0);
+ hv_store(e, "psgix.input.buffered", 20, &PL_sv_yes, 0);
+ hv_store(e, "psgix.output.buffered", 21, &PL_sv_yes, 0);
+ hv_store(e, "psgix.body.scalar_refs", 22, &PL_sv_yes, 0);
hv_store(e, "REQUEST_URI", 11, newSVpvn(r->path,r->path_len),0);
hv_store(e, "REQUEST_METHOD", 14, newSVpvn(r->method,r->method_len),0);
hv_store(e, "SCRIPT_NAME", 11, newSVpvn("",0),0);
View
3 TODO
@@ -20,6 +20,8 @@ streamed responses
* allow streaming responses to be HTTP/1.0 "Connection: close" rather than
HTTP/1.1 "Transfer-Encoding: chunked". match up the streaming flavour
with the request version?
+ * instead of an implicit "low water mark" of 0 for the poll_cb
+ writer-object callback, a configurable number of bytes can be used.
Handle requests that don't require a body (optional entities).
@@ -33,7 +35,6 @@ Lazy I/O watcher initialization?
Per-client "drain" and "completion" callbacks?
- * "drain" is effectively the poll_cb() ?
* "completion" is when finished sending a full HTTP response (so apps can
make request-completion assertions); could be accomplished with guards instead.
View
@@ -1,7 +1,7 @@
#!perl
use warnings;
use strict;
-use Test::More tests => 51;
+use Test::More tests => 53;
use Test::Exception;
use utf8;
use lib 't'; use Utils;
@@ -37,6 +37,8 @@ $evh->request_handler(sub {
is $env->{'psgi.url_scheme'}, "http", 'got psgi.url_scheme';
ok $env->{'psgi.nonblocking'}, 'got psgi.nonblocking';
ok exists $env->{'psgi.multithreaded'}, 'got psgi.multithreaded';
+ ok $env->{'psgix.body.scalar_refs'}, 'Feersum supports scalar-refs in the body part of the response (psgix.body.scalar_refs)';
+
my $errfh = $env->{'psgi.errors'};
ok $errfh, 'got psgi.errors';
lives_ok { $errfh->print() } "errors fh can print()";

0 comments on commit 90a0763

Please sign in to comment.