On 19/03/2020 13:49, [email protected] wrote:
> This is an automated email from the ASF dual-hosted git repository.
>
> remm pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
> new c870a1e Add a test case for BZ64240
> c870a1e is described below
>
> commit c870a1ea7f09b885ff724702562b3e1df14ff06e
> Author: remm <[email protected]>
> AuthorDate: Thu Mar 19 14:49:21 2020 +0100
>
> Add a test case for BZ64240
There is a test for this already in TestHttp11InputBufferCRLF.
I have some patches for that class that will trigger some failures but
not the one described in BZ 64240.
Mark
>
> I couldn't reproduce it, so tried a test case (with some sleeps to see
> if there would be some state problem when going to the poller). Works
> for me.
> ---
> .../coyote/http11/TestHttp11InputBuffer.java | 45
> ++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
> b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
> index a1d50d0..c9204a2 100644
> --- a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
> +++ b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
> @@ -17,8 +17,15 @@
>
> package org.apache.coyote.http11;
>
> +import java.io.BufferedReader;
> import java.io.IOException;
> +import java.io.InputStream;
> +import java.io.InputStreamReader;
> +import java.io.OutputStream;
> +import java.io.OutputStreamWriter;
> import java.io.PrintWriter;
> +import java.io.Writer;
> +import java.net.Socket;
> import java.util.Enumeration;
>
> import jakarta.servlet.ServletException;
> @@ -656,6 +663,44 @@ public class TestHttp11InputBuffer extends
> TomcatBaseTest {
>
>
> @Test
> + public void testValidHttp09() throws Exception {
> +
> + Tomcat tomcat = getTomcatInstance();
> +
> + tomcat.addContext("", TEMP_DIR);
> + tomcat.start();
> +
> + Socket socket = null;
> + OutputStream os = null;
> + InputStream is = null;
> + BufferedReader reader = null;
> + Writer writer = null;
> + final String encoding = "ISO-8859-1";
> +
> + for (int i = 0; i < 10; i++) {
> + socket = new Socket("localhost", getPort());
> + os = socket.getOutputStream();
> + writer = new OutputStreamWriter(os, encoding);
> + writer.write("GET /");
> + writer.flush();
> + Thread.sleep(10);
> + writer.write(CR);
> + writer.flush();
> + Thread.sleep(10);
> + writer.write(LF);
> + writer.flush();
> + is = socket.getInputStream();
> + reader = new BufferedReader(new InputStreamReader(is));
> + String line = reader.readLine();
> + Assert.assertNotNull(line);
> + Assert.assertTrue(line.indexOf("404") != -1);
> + socket.close();
> + }
> +
> + }
> +
> +
> + @Test
> public void testInvalidHttp09() {
>
> String[] request = new String[1];
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]