jdk/src/share/classes/sun/rmi/transport/proxy/HttpInputStream.java
changeset 16095 6aa0f442dccb
parent 12040 558b0e0d5910
child 16100 379f48d34516
equal deleted inserted replaced
16094:ac85c7fc438d 16095:6aa0f442dccb
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    68 
    68 
    69             if (line == null)
    69             if (line == null)
    70                 throw new EOFException();
    70                 throw new EOFException();
    71 
    71 
    72             if (line.toLowerCase().startsWith(key)) {
    72             if (line.toLowerCase().startsWith(key)) {
    73                 // if contentLengthFound is true
    73                 if (contentLengthFound) {
    74                 // we should probably do something here
    74                     throw new IOException(
    75                 bytesLeft =
    75                             "Multiple Content-length entries found.");
    76                     Integer.parseInt(line.substring(key.length()).trim());
    76                 } else {
    77                 contentLengthFound = true;
    77                     bytesLeft =
       
    78                         Integer.parseInt(line.substring(key.length()).trim());
       
    79                     contentLengthFound = true;
       
    80                 }
    78             }
    81             }
    79 
    82 
    80             // The idea here is to go past the first blank line.
    83             // The idea here is to go past the first blank line.
    81             // Some DataInputStream.readLine() documentation specifies that
    84             // Some DataInputStream.readLine() documentation specifies that
    82             // it does include the line-terminating character(s) in the
    85             // it does include the line-terminating character(s) in the