RFR: 8314978: Multiple server call from connection failing with expect100 in getOutputStream [v3]

Vyom Tewari vtewari at openjdk.org
Wed Sep 27 10:55:46 UTC 2023


> With the current implementation of HttpURLConnection  if server rejects the  “Expect 100-continue” then there will be ‘java.net.ProtocolException’ will be thrown from 'expect100Continue()' method. 
> 
> After the exception thrown, If we call any other method on the same instance (ex getHeaderField(), or getHeaderFields()). They will internally call getOuputStream() which invokes writeRequests(), which make the actual server call.
> 
> The code change will sets the existing variable ‘rememberedException’ when there is exception and getOutputStream0() will re-throw ‘rememberedException’  if the ‘rememberedException’ is not null. 
> 
> Note: getOutputStream0() also call’s  ‘expect100Continue()’  if ‘expectContinue’ is true.

Vyom Tewari has updated the pull request incrementally with one additional commit since the last revision:

  Incorporated the review comments

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/15483/files
  - new: https://git.openjdk.org/jdk/pull/15483/files/0f506e1c..5f6510aa

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15483&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15483&range=01-02

  Stats: 10 lines in 1 file changed: 4 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/15483.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15483/head:pull/15483

PR: https://git.openjdk.org/jdk/pull/15483


More information about the net-dev mailing list