Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
21443c39
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
21443c39
编写于
12月 07, 2010
作者:
M
michaelm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7005016: sqe test jhttp/HttpServer150013/HttpServer150013.java
Reviewed-by: chegar
上级
cb4e3e98
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
109 addition
and
3 deletion
+109
-3
src/share/classes/sun/net/httpserver/Request.java
src/share/classes/sun/net/httpserver/Request.java
+15
-1
src/share/classes/sun/net/httpserver/SSLStreams.java
src/share/classes/sun/net/httpserver/SSLStreams.java
+1
-1
src/share/classes/sun/net/httpserver/ServerConfig.java
src/share/classes/sun/net/httpserver/ServerConfig.java
+1
-1
test/com/sun/net/httpserver/Test10.java
test/com/sun/net/httpserver/Test10.java
+92
-0
未找到文件。
src/share/classes/sun/net/httpserver/Request.java
浏览文件 @
21443c39
...
@@ -129,9 +129,22 @@ class Request {
...
@@ -129,9 +129,22 @@ class Request {
hdrs
=
new
Headers
();
hdrs
=
new
Headers
();
char
s
[]
=
new
char
[
10
];
char
s
[]
=
new
char
[
10
];
int
len
=
0
;
int
firstc
=
is
.
read
();
int
firstc
=
is
.
read
();
// check for empty headers
if
(
firstc
==
CR
||
firstc
==
LF
)
{
int
c
=
is
.
read
();
if
(
c
==
CR
||
c
==
LF
)
{
return
hdrs
;
}
s
[
0
]
=
(
char
)
firstc
;
len
=
1
;
firstc
=
c
;
}
while
(
firstc
!=
LF
&&
firstc
!=
CR
&&
firstc
>=
0
)
{
while
(
firstc
!=
LF
&&
firstc
!=
CR
&&
firstc
>=
0
)
{
int
len
=
0
;
int
keyend
=
-
1
;
int
keyend
=
-
1
;
int
c
;
int
c
;
boolean
inKey
=
firstc
>
' '
;
boolean
inKey
=
firstc
>
' '
;
...
@@ -191,6 +204,7 @@ class Request {
...
@@ -191,6 +204,7 @@ class Request {
else
else
v
=
String
.
copyValueOf
(
s
,
keyend
,
len
-
keyend
);
v
=
String
.
copyValueOf
(
s
,
keyend
,
len
-
keyend
);
hdrs
.
add
(
k
,
v
);
hdrs
.
add
(
k
,
v
);
len
=
0
;
}
}
return
hdrs
;
return
hdrs
;
}
}
...
...
src/share/classes/sun/net/httpserver/SSLStreams.java
浏览文件 @
21443c39
...
@@ -74,8 +74,8 @@ class SSLStreams {
...
@@ -74,8 +74,8 @@ class SSLStreams {
private
void
configureEngine
(
HttpsConfigurator
cfg
,
InetSocketAddress
addr
){
private
void
configureEngine
(
HttpsConfigurator
cfg
,
InetSocketAddress
addr
){
if
(
cfg
!=
null
)
{
if
(
cfg
!=
null
)
{
Parameters
params
=
new
Parameters
(
cfg
,
addr
);
Parameters
params
=
new
Parameters
(
cfg
,
addr
);
cfg
.
configure
(
params
);
//BEGIN_TIGER_EXCLUDE
//BEGIN_TIGER_EXCLUDE
cfg
.
configure
(
params
);
SSLParameters
sslParams
=
params
.
getSSLParameters
();
SSLParameters
sslParams
=
params
.
getSSLParameters
();
if
(
sslParams
!=
null
)
{
if
(
sslParams
!=
null
)
{
engine
.
setSSLParameters
(
sslParams
);
engine
.
setSSLParameters
(
sslParams
);
...
...
src/share/classes/sun/net/httpserver/ServerConfig.java
浏览文件 @
21443c39
...
@@ -42,7 +42,7 @@ class ServerConfig {
...
@@ -42,7 +42,7 @@ class ServerConfig {
static
final
int
DEFAULT_CLOCK_TICK
=
10000
;
// 10 sec.
static
final
int
DEFAULT_CLOCK_TICK
=
10000
;
// 10 sec.
/* These values must be a reasonable multiple of clockTick */
/* These values must be a reasonable multiple of clockTick */
static
final
long
DEFAULT_IDLE_INTERVAL
=
30
0
;
// 5 min
static
final
long
DEFAULT_IDLE_INTERVAL
=
30
;
// 5 min
static
final
int
DEFAULT_MAX_IDLE_CONNECTIONS
=
200
;
static
final
int
DEFAULT_MAX_IDLE_CONNECTIONS
=
200
;
static
final
long
DEFAULT_MAX_REQ_TIME
=
-
1
;
// default: forever
static
final
long
DEFAULT_MAX_REQ_TIME
=
-
1
;
// default: forever
...
...
test/com/sun/net/httpserver/Test10.java
0 → 100644
浏览文件 @
21443c39
/*
* Copyright (c) 2010 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 7005016
* @summary pit jdk7 b121 sqe test jhttp/HttpServer150013 failing
* @run main/othervm -Dsun.net.httpserver.clockTick=1000 -Dsun.net.httpserver.idleInterval=3 Test10
*/
import
com.sun.net.httpserver.*
;
import
java.io.*
;
import
java.net.*
;
import
java.util.concurrent.*
;
/*
* Test handling of empty Http headers
*/
public
class
Test10
extends
Test
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
out
.
print
(
"Test10: "
);
Handler
handler
=
new
Handler
();
InetSocketAddress
addr
=
new
InetSocketAddress
(
0
);
HttpServer
server
=
HttpServer
.
create
(
addr
,
0
);
int
port
=
server
.
getAddress
().
getPort
();
HttpContext
c2
=
server
.
createContext
(
"/test"
,
handler
);
ExecutorService
exec
=
Executors
.
newCachedThreadPool
();
server
.
setExecutor
(
exec
);
try
{
server
.
start
();
doClient
(
port
);
System
.
out
.
println
(
"OK"
);
}
finally
{
delay
();
if
(
server
!=
null
)
server
.
stop
(
2
);
if
(
exec
!=
null
)
exec
.
shutdown
();
}
}
static
class
Handler
implements
HttpHandler
{
volatile
int
invocation
=
0
;
public
void
handle
(
HttpExchange
t
)
throws
IOException
{
InputStream
is
=
t
.
getRequestBody
();
while
(
is
.
read
()
!=
-
1
);
Headers
map
=
t
.
getRequestHeaders
();
t
.
sendResponseHeaders
(
200
,
-
1
);
t
.
close
();
}
}
public
static
void
doClient
(
int
port
)
throws
Exception
{
String
s
=
"GET /test/1.html HTTP/1.1\r\n\r\n"
;
Socket
socket
=
new
Socket
(
"localhost"
,
port
);
OutputStream
os
=
socket
.
getOutputStream
();
os
.
write
(
s
.
getBytes
());
socket
.
setSoTimeout
(
10
*
1000
);
InputStream
is
=
socket
.
getInputStream
();
int
c
;
byte
[]
b
=
new
byte
[
1024
];
while
((
c
=
is
.
read
(
b
))
!=
-
1
)
;
is
.
close
();
socket
.
close
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录