jdk/src/share/classes/sun/rmi/transport/proxy/CGIHandler.java
Print this page
rev 5725 : Merge
*** 1,7 ****
/*
! * Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 151,161 ****
returnClientError(e.getMessage());
} catch (CGIServerException e) {
returnServerError(e.getMessage());
}
else
! returnClientError("invalid command: " + command);
} catch (Exception e) {
returnServerError("internal error: " + e.getMessage());
}
System.exit(0);
}
--- 151,161 ----
returnClientError(e.getMessage());
} catch (CGIServerException e) {
returnServerError(e.getMessage());
}
else
! returnClientError("invalid command.");
} catch (Exception e) {
returnServerError("internal error: " + e.getMessage());
}
System.exit(0);
}
*** 223,233 ****
int port;
try {
port = Integer.parseInt(param);
} catch (NumberFormatException e) {
! throw new CGIClientException("invalid port number: " + param);
}
if (port <= 0 || port > 0xFFFF)
throw new CGIClientException("invalid port: " + port);
if (port < 1024)
throw new CGIClientException("permission denied for port: " +
--- 223,233 ----
int port;
try {
port = Integer.parseInt(param);
} catch (NumberFormatException e) {
! throw new CGIClientException("invalid port number.");
}
if (port <= 0 || port > 0xFFFF)
throw new CGIClientException("invalid port: " + port);
if (port < 1024)
throw new CGIClientException("permission denied for port: " +
*** 291,306 ****
if (line == null)
throw new CGIServerException(
"unexpected EOF reading server response");
if (line.toLowerCase().startsWith(key)) {
! // if contentLengthFound is true
! // we should probably do something here
responseContentLength =
Integer.parseInt(line.substring(key.length()).trim());
contentLengthFound = true;
}
} while ((line.length() != 0) &&
(line.charAt(0) != '\r') && (line.charAt(0) != '\n'));
if (!contentLengthFound || responseContentLength < 0)
throw new CGIServerException(
--- 291,309 ----
if (line == null)
throw new CGIServerException(
"unexpected EOF reading server response");
if (line.toLowerCase().startsWith(key)) {
! if (contentLengthFound) {
! throw new CGIServerException(
! "Multiple Content-length entries found.");
! } else {
responseContentLength =
Integer.parseInt(line.substring(key.length()).trim());
contentLengthFound = true;
}
+ }
} while ((line.length() != 0) &&
(line.charAt(0) != '\r') && (line.charAt(0) != '\n'));
if (!contentLengthFound || responseContentLength < 0)
throw new CGIServerException(