Changeset 17753
- Timestamp:
- 08/17/08 12:25:01 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-Engine/trunk/lib/HTTP/Engine/Interface/Standalone.pm
r17742 r17753 139 139 while (1) { 140 140 # FIXME refactor an HTTP push parser 141 my($path, $query_string) = split /\?/, $uri, 2;142 143 my $headers;144 141 145 142 # Parse headers 146 143 # taken from HTTP::Message, which is unfortunately not really reusable 147 if ($protocol >= 1) { 148 my @hdr; 149 while ( length(my $line = $self->_get_line($remote)) ) { 150 if ($line =~ s/^([^\s:]+)[ \t]*: ?(.*)//) { 151 push(@hdr, $1, $2); 144 my $headers = do { 145 if ($protocol >= 1) { 146 my @hdr; 147 while ( length(my $line = $self->_get_line($remote)) ) { 148 if ($line =~ s/^([^\s:]+)[ \t]*: ?(.*)//) { 149 push(@hdr, $1, $2); 150 } 151 elsif (@hdr && $line =~ s/^([ \t].*)//) { 152 $hdr[-1] .= "\n$1"; 153 } else { 154 last; 155 } 152 156 } 153 elsif (@hdr && $line =~ s/^([ \t].*)//) { 154 $hdr[-1] .= "\n$1"; 155 } else { 156 last; 157 } 157 HTTP::Headers->new(@hdr); 158 } else { 159 HTTP::Headers->new; 158 160 } 159 $headers = HTTP::Headers->new(@hdr); 160 } else { 161 $headers = HTTP::Headers->new; 162 } 161 }; 163 162 164 163 # Pass flow control to HTTP::Engine … … 204 203 } 205 204 206 $self->request_builder->_io_read($remote, my $buf, 4096) if $sel->can_read(0); # IE bk205 $self->request_builder->_io_read($remote, my $buf, 4096) if $sel->can_read(0); # IE hack 207 206 close $remote; 208 207 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)