On Wed, Oct 22, 2008 at 11:28:45AM -0700, Sebastien Delafond wrote:
> I still got a 400 this morning, but when I tried the second time
> around I could not reproduce it; looking at your patch again, I see
> you're not retrying the sysread call if somehow it failed the first
> time, whereas initially proposed on the ubuntu bug report did
> that... That's the only difference I can see.
Disappointed by that!
I didn't like the try again part of the patch. The point of this
function is to prevent a DOS. I could see that by keeping a socket open,
but not sending anything, you could create exactly that.
I really wish I could reproduce this -- it would help a lot.
Alternatively, debug info from you from when it does. Can you enable it
to catch the next one?
The 400 error is to the client not just in the log?
I have since modified it further to detect early closure of the
connection. Not sure that will help though:
diff --git a/apt-cacher b/apt-cacher
index 76aba0a..48a7c22 100755
--- a/apt-cacher
+++ b/apt-cacher
@@ -1638,7 +1638,7 @@ sub getRequestLine {
}
if([EMAIL PROTECTED]) {
# Fill buffer
- if (my $ret=sysread($source, my $buf, 1024)) {
+ if ($source->opened && (my $ret=sysread($source, my $buf, 1024))) {
$buf=$reqTail.$buf if(defined($reqTail));
undef $reqTail;
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]