Skip to content

Commit

Permalink
+ -- do a final little read before closing an HTTP connection
Browse files Browse the repository at this point in the history
+       to make sure we have no unread data in kernel (notably
+       an extra "\r\n" from an IE post), so when we do close, we
+       don't send a RST packet to the end user.  Thanks to Kevin
+       Lewandowski from discogs.com for the bug report.


git-svn-id: http://code.sixapart.com/svn/perlbal/trunk@441 6caf28e9-730f-0410-b62b-a31386fe13fb
  • Loading branch information
bradfitz committed Sep 16, 2005
1 parent ab1d962 commit 28565f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES
@@ -1,3 +1,9 @@
-- do a final little read before closing an HTTP connection
to make sure we have no unread data in kernel (notably
an extra "\r\n" from an IE post), so when we do close, we
don't send a RST packet to the end user. Thanks to Kevin
Lewandowski from discogs.com for the bug report.

-- use Danga::Socket's AddTimer interface to disconnect
stale persistent connections every 5 seconds, driven by
a timer, rather than every 15 seconds, driven by
Expand Down
4 changes: 4 additions & 0 deletions lib/Perlbal/ClientHTTPBase.pm
Expand Up @@ -145,6 +145,10 @@ sub http_response_sent {
$self->{do_die}
)
{
# do a final read so we don't have unread_data_waiting and RST
# the connection. IE and others send an extra \r\n after POSTs
my $dummy = $self->read(5);

# close if we have no response headers or they say to close
$self->close("no_keep_alive");
return 0;
Expand Down

0 comments on commit 28565f9

Please sign in to comment.