add close boolean to govern Connection: setting on requests in test
This commit is contained in:
parent
8de385992e
commit
23a2081168
|
@ -102,7 +102,7 @@ public class GzipWithPipeliningTest
|
||||||
client.connect();
|
client.connect();
|
||||||
|
|
||||||
// Request text that will be gzipped + chunked in the response
|
// Request text that will be gzipped + chunked in the response
|
||||||
client.issueGET("/lots-of-fantasy-names.txt",true);
|
client.issueGET("/lots-of-fantasy-names.txt",true, false);
|
||||||
|
|
||||||
respHeader = client.readResponseHeader();
|
respHeader = client.readResponseHeader();
|
||||||
System.out.println("Response Header #1 --\n" + respHeader);
|
System.out.println("Response Header #1 --\n" + respHeader);
|
||||||
|
@ -122,7 +122,7 @@ public class GzipWithPipeliningTest
|
||||||
System.out.printf("Read %,d bytes%n",readBytes);
|
System.out.printf("Read %,d bytes%n",readBytes);
|
||||||
|
|
||||||
// Issue another request
|
// Issue another request
|
||||||
client.issueGET("/jetty_logo.png",true);
|
client.issueGET("/jetty_logo.png",true, true);
|
||||||
|
|
||||||
// Finish reading chunks
|
// Finish reading chunks
|
||||||
System.out.println("Finish reading remaining chunks ...");
|
System.out.println("Finish reading remaining chunks ...");
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class PipelineHelper
|
||||||
* to turn on acceptance of GZIP compressed responses
|
* to turn on acceptance of GZIP compressed responses
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void issueGET(String path, boolean acceptGzipped) throws IOException
|
public void issueGET(String path, boolean acceptGzipped, boolean close) throws IOException
|
||||||
{
|
{
|
||||||
LOG.debug("Issuing GET on " + path);
|
LOG.debug("Issuing GET on " + path);
|
||||||
StringBuilder req = new StringBuilder();
|
StringBuilder req = new StringBuilder();
|
||||||
|
@ -79,7 +79,15 @@ public class PipelineHelper
|
||||||
req.append("Accept-Encoding: gzip, deflate\r\n");
|
req.append("Accept-Encoding: gzip, deflate\r\n");
|
||||||
}
|
}
|
||||||
req.append("Cookie: JSESSIONID=spqx8v8szylt1336t96vc6mw0\r\n");
|
req.append("Cookie: JSESSIONID=spqx8v8szylt1336t96vc6mw0\r\n");
|
||||||
req.append("Connection: keep-alive\r\n");
|
if ( close )
|
||||||
|
{
|
||||||
|
req.append("Connection: close\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
req.append("Connection: keep-alive\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
req.append("\r\n");
|
req.append("\r\n");
|
||||||
|
|
||||||
LOG.debug("Request:" + req);
|
LOG.debug("Request:" + req);
|
||||||
|
|
Loading…
Reference in New Issue