Merge branch 'master' into jetty-8

This commit is contained in:
Jesse McConnell 2011-12-23 07:44:29 -06:00
commit ed46b71f37
2 changed files with 82 additions and 2 deletions

View File

@ -42,6 +42,26 @@ jetty-8.1.0.RC0 - 30 November 2011
+ 364283 can't parse the servlet multipart-config for the web.xml
+ 364430 Support web.xml enabled state for servlets
jetty-7.6.0.RC2 - 22 December 2011
+ 364638 HttpParser closes if data received while seeking EOF. Tests fixed to
cope
+ 364921 Made test less time sensitive for ssl
+ 364936 use Resource for opening URL streams
+ 365267 NullPointerException in bad Address
+ 365375 ResourceHandler should be a HandlerWrapper
+ 365750 Support WebSocket over SSL, aka wss://
+ 365932 Produce jetty-websocket aggregate jar for android use
+ 365947 Set headers for Auth failure and retry in http-spi
+ 366316 Superfluous printStackTrace on 404
+ 366342 Dont persist DosFilter trackers in http session
+ 366730 pass the time idle to onIdleExpire
+ 367048 test harness for guard on suspended requests
+ 367175 SSL 100% CPU spin in case of blocked write and RST.
+ 367219 WebSocketClient.open() fails when URI uses default ports.
+ JETTY-1460 suppress PrintWriter exceptions
+ JETTY-1463 websocket D0 parser should return progress even if no fill done
+ JETTY-1465 NPE in ContextHandler.toString
jetty-7.6.0.RC1 - 04 December 2011
+ 352565 cookie httponly flag ignored
+ 353285 ServletSecurity annotation ignored

View File

@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.SocketException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
@ -32,6 +33,8 @@ import java.util.zip.Inflater;
import javax.servlet.http.HttpServletRequest;
import junit.framework.Assert;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.ByteArrayEndPoint;
import org.eclipse.jetty.server.Connector;
@ -1314,7 +1317,7 @@ public class WebSocketMessageRFC6455Test
}
@Test
public void testClose() throws Exception
public void testTCPClose() throws Exception
{
Socket socket = new Socket("localhost", __connector.getLocalPort());
OutputStream output = socket.getOutputStream();
@ -1350,7 +1353,6 @@ public class WebSocketMessageRFC6455Test
socket.close();
assertTrue(__serverWebSocket.awaitDisconnected(500));
try
{
@ -1362,6 +1364,64 @@ public class WebSocketMessageRFC6455Test
assertTrue(true);
}
}
@Test
public void testTCPHalfClose() throws Exception
{
Socket socket = new Socket("localhost", __connector.getLocalPort());
OutputStream output = socket.getOutputStream();
output.write(
("GET /chat HTTP/1.1\r\n"+
"Host: server.example.com\r\n"+
"Upgrade: websocket\r\n"+
"Connection: Upgrade\r\n"+
"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n"+
"Sec-WebSocket-Origin: http://example.com\r\n"+
"Sec-WebSocket-Protocol: onConnect\r\n" +
"Sec-WebSocket-Version: "+WebSocketConnectionRFC6455.VERSION+"\r\n"+
"\r\n").getBytes("ISO-8859-1"));
output.flush();
// Make sure the read times out if there are problems with the implementation
socket.setSoTimeout(1000);
InputStream input = socket.getInputStream();
lookFor("HTTP/1.1 101 Switching Protocols\r\n",input);
skipTo("Sec-WebSocket-Accept: ",input);
lookFor("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=",input);
skipTo("\r\n\r\n",input);
assertTrue(__serverWebSocket.awaitConnected(1000));
assertNotNull(__serverWebSocket.connection);
assertEquals(0x81,input.read());
assertEquals(0x0f,input.read());
lookFor("sent on connect",input);
socket.shutdownOutput();
assertTrue(__serverWebSocket.awaitDisconnected(500));
assertEquals(0x88,input.read());
assertEquals(0x00,input.read());
assertEquals(-1,input.read());
// look for broken pipe
try
{
for (int i=0;i<1000;i++)
output.write(0);
Assert.fail();
}
catch(SocketException e)
{
// expected
}
}
@Test
public void testParserAndGenerator() throws Exception