jdk/src/share/classes/sun/rmi/transport/proxy/HttpInputStream.java

Print this page
rev 5725 : Merge

*** 1,7 **** /* ! * Copyright (c) 1996, 2001, 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
*** 68,83 **** if (line == null) throw new EOFException(); if (line.toLowerCase().startsWith(key)) { ! // if contentLengthFound is true ! // we should probably do something here bytesLeft = Integer.parseInt(line.substring(key.length()).trim()); contentLengthFound = true; } // The idea here is to go past the first blank line. // Some DataInputStream.readLine() documentation specifies that // it does include the line-terminating character(s) in the // returned string, but it actually doesn't, so we'll cover --- 68,86 ---- if (line == null) throw new EOFException(); if (line.toLowerCase().startsWith(key)) { ! if (contentLengthFound) { ! throw new IOException( ! "Multiple Content-length entries found."); ! } else { bytesLeft = Integer.parseInt(line.substring(key.length()).trim()); contentLengthFound = true; } + } // The idea here is to go past the first blank line. // Some DataInputStream.readLine() documentation specifies that // it does include the line-terminating character(s) in the // returned string, but it actually doesn't, so we'll cover