Permalink
Browse files

Changes to try to work with new master. Unsuccessful so far.

  • Loading branch information...
1 parent 60f17b2 commit c48251aa0f6fdcc92d9e243f03bf15fd4f02c972 @supernovus committed Mar 2, 2010
Showing with 29 additions and 7 deletions.
  1. +29 −7 SCGI.pm
View
@@ -30,17 +30,35 @@ class SCGI::Request {
my $offset = ~$0.chars + 1;
my $env_string = $.request.substr($offset, $length);
my $comma = $.request.substr($offset+$length, 1);
- return self.err("malformed netstring, expecting terminating comma, found \"$comma\"") if $comma ne ',';
+ ## Does not work in Rakudo new master.
+ #return self.err("malformed netstring, expecting terminating comma, found \"$comma\"") if $comma ne ',';
+ ## Begin replacement.
+ if $comma ne ',' {
+ return self.err("malformed netstring, expecting terminating comma, found \"$comma\"");
+ }
+ ## End replacement.
$.body = $.request.substr($offset+$length+1);
my @env = $env_string.split("\0");
@env.pop;
%.env = @env;
if $!strict {
- return self.err("malformed or missing CONTENT_LENGTH header")\
- unless defined %.env<CONTENT_LENGTH> \
- && %.env<CONTENT_LENGTH> ~~ / ^ \d+ $ /;
- return self.err("missing SCGI header")\
- unless %.env<SCGI> && %.env<SCGI> eq '1';
+ ## Does not work in Rakudo new master.
+ #return self.err("malformed or missing CONTENT_LENGTH header")\
+ #unless defined %.env<CONTENT_LENGTH> \
+ #&& %.env<CONTENT_LENGTH> ~~ / ^ \d+ $ /;
+ ## Begin replacement.
+ unless defined %.env<CONTENT_LENGTH> && %.env<CONTENT_LENGTH> ~~ / ^ \d+ $ / {
+ return self.err("malformed or missing CONTENT_LENGTH header");
+ }
+ ## End replacement.
+ ## Does not work in Rakudo new master.
+ #return self.err("missing SCGI header")\
+ #unless %.env<SCGI> && %.env<SCGI> eq '1';
+ ## Begin replacement.
+ unless %.env<SCGI> && %.env<SCGI> eq '1' {
+ return self.err: "missing SCGI header";
+ }
+ ## End replacement.
}
return 1;
}
@@ -69,9 +87,13 @@ class SCGI {
has Int $!port = 8080;
has Str $!addr = 'localhost';
- has IO::Socket $.socket = IO::Socket::INET.socket(2, 1, 6)\
+ ## The following doesn't work on Rakudo new master.
+ #has IO::Socket
+ ## Removing the IO::Socket part allows it to compile.
+ has $.socket = IO::Socket::INET.socket(2, 1, 6)\
.bind($!addr, $!port)\
.listen();
+
has $!bodykey = 'SCGI.Body';
has $!requestkey = 'SCGI.Request';
has $!scgikey = 'SCGI.Object';

0 comments on commit c48251a

Please sign in to comment.