提交 eeda34b3 编写于 作者: D dmocek

8001242: Improve RMI HTTP conformance

Reviewed-by: ahgross, mchung, smarks
上级 f81b55b2
...@@ -293,11 +293,14 @@ final class CGIForwardCommand implements CGICommandHandler { ...@@ -293,11 +293,14 @@ final class CGIForwardCommand implements CGICommandHandler {
"unexpected EOF reading server response"); "unexpected EOF reading server response");
if (line.toLowerCase().startsWith(key)) { if (line.toLowerCase().startsWith(key)) {
// if contentLengthFound is true if (contentLengthFound) {
// we should probably do something here throw new CGIServerException(
responseContentLength = "Multiple Content-length entries found.");
Integer.parseInt(line.substring(key.length()).trim()); } else {
contentLengthFound = true; responseContentLength =
Integer.parseInt(line.substring(key.length()).trim());
contentLengthFound = true;
}
} }
} while ((line.length() != 0) && } while ((line.length() != 0) &&
(line.charAt(0) != '\r') && (line.charAt(0) != '\n')); (line.charAt(0) != '\r') && (line.charAt(0) != '\n'));
......
/* /*
* Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -70,11 +70,14 @@ class HttpInputStream extends FilterInputStream { ...@@ -70,11 +70,14 @@ class HttpInputStream extends FilterInputStream {
throw new EOFException(); throw new EOFException();
if (line.toLowerCase().startsWith(key)) { if (line.toLowerCase().startsWith(key)) {
// if contentLengthFound is true if (contentLengthFound) {
// we should probably do something here throw new IOException(
bytesLeft = "Multiple Content-length entries found.");
Integer.parseInt(line.substring(key.length()).trim()); } else {
contentLengthFound = true; bytesLeft =
Integer.parseInt(line.substring(key.length()).trim());
contentLengthFound = true;
}
} }
// The idea here is to go past the first blank line. // The idea here is to go past the first blank line.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册