Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8251517: [TESTBUG] com/sun/net/httpserver/bugs/B6393710.java does not…
… scale socket timeout

Reviewed-by: dfuchs
  • Loading branch information
nick-arm committed Aug 14, 2020
1 parent 397ce2d commit 203ab1b07cec25b2fba637371c7b37c52c914700
Showing 1 changed file with 7 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
/**
* @test
* @bug 6393710
* @library /test/lib
* @summary Non authenticated call followed by authenticated call never returns
* @run main B6393710
* @run main/othervm -Djava.net.preferIPv6Addresses=true B6393710
@@ -36,6 +37,8 @@
import java.io.*;
import java.net.*;

import jdk.test.lib.Utils;

/*
* Test checks for following bug(s) when a POST containing a request body
* needs to be authenticated
@@ -80,7 +83,7 @@ public boolean checkCredentials (String user, String pass) {
server.start ();

Socket s = new Socket (loopback, server.getAddress().getPort());
s.setSoTimeout (5000);
s.setSoTimeout ((int) Utils.adjustTimeout(5000));

OutputStream os = s.getOutputStream();
os.write (cmd.getBytes());
@@ -127,8 +130,8 @@ static boolean readAndCheck (InputStream is, String expected) throws IOException
return false;
}

public static boolean ok = false;
static int requests = 0;
public static volatile boolean ok = false;
static volatile int requests = 0;

static class Handler implements HttpHandler {
int invocation = 1;

0 comments on commit 203ab1b

Please sign in to comment.