src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
changeset 53720 3e451bff6f7f
parent 47216 71c04702a3d5
child 54147 8f91e1a7ebdc
equal deleted inserted replaced
53719:3a56e823d843 53720:3e451bff6f7f
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2019, 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
   169      * <p>
   169      * <p>
   170      * If the content-length response header has not already been set then
   170      * If the content-length response header has not already been set then
   171      * this is set to the appropriate value depending on the response length parameter.
   171      * this is set to the appropriate value depending on the response length parameter.
   172      * <p>
   172      * <p>
   173      * This method must be called prior to calling {@link #getResponseBody()}.
   173      * This method must be called prior to calling {@link #getResponseBody()}.
       
   174      *
       
   175      * @implNote This implementation allows the caller to instruct the
       
   176      * server to force a connection close after the exchange terminates, by
       
   177      * supplying a {@code Connection: close} header to the {@linkplain
       
   178      * #getResponseHeaders() response headers} before {@code sendResponseHeaders}
       
   179      * is called.
       
   180      *
   174      * @param rCode the response code to send
   181      * @param rCode the response code to send
   175      * @param responseLength if {@literal > 0}, specifies a fixed response
   182      * @param responseLength if {@literal > 0}, specifies a fixed response
   176      *        body length and that exact number of bytes must be written
   183      *        body length and that exact number of bytes must be written
   177      *        to the stream acquired from getResponseBody(), or else
   184      *        to the stream acquired from getResponseBody(), or else
   178      *        if equal to 0, then chunked encoding is used,
   185      *        if equal to 0, then chunked encoding is used,