Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
b5cadfb5
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b5cadfb5
编写于
11月 18, 2012
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add -naccept <n> option to s_server to automatically exit after <n> connections
上级
c4fc1722
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
8 deletion
+21
-8
apps/s_apps.h
apps/s_apps.h
+1
-1
apps/s_cb.c
apps/s_cb.c
+1
-1
apps/s_server.c
apps/s_server.c
+15
-4
apps/s_socket.c
apps/s_socket.c
+4
-2
未找到文件。
apps/s_apps.h
浏览文件 @
b5cadfb5
...
...
@@ -148,7 +148,7 @@ typedef fd_mask fd_set;
#define PORT_STR "4433"
#define PROTOCOL "tcp"
int
do_server
(
int
port
,
int
type
,
int
*
ret
,
int
(
*
cb
)
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
),
unsigned
char
*
context
);
int
do_server
(
int
port
,
int
type
,
int
*
ret
,
int
(
*
cb
)
(
char
*
hostname
,
int
s
,
unsigned
char
*
context
),
unsigned
char
*
context
,
int
naccept
);
#ifdef HEADER_X509_H
int
MS_CALLBACK
verify_callback
(
int
ok
,
X509_STORE_CTX
*
ctx
);
#endif
...
...
apps/s_cb.c
浏览文件 @
b5cadfb5
...
...
@@ -454,13 +454,13 @@ int ssl_print_curves(BIO *out, SSL *s, int noshared)
}
if
(
ncurves
==
0
)
BIO_puts
(
out
,
"NONE"
);
OPENSSL_free
(
curves
);
if
(
noshared
)
{
BIO_puts
(
out
,
"
\n
"
);
return
1
;
}
BIO_puts
(
out
,
"
\n
Shared Elliptic curves: "
);
OPENSSL_free
(
curves
);
ncurves
=
SSL_get_shared_curve
(
s
,
-
1
);
for
(
i
=
0
;
i
<
ncurves
;
i
++
)
{
...
...
apps/s_server.c
浏览文件 @
b5cadfb5
...
...
@@ -979,7 +979,7 @@ int MAIN(int argc, char *argv[])
STACK_OF
(
X509
)
*
s_chain
=
NULL
,
*
s_dchain
=
NULL
;
EVP_PKEY
*
s_key
=
NULL
,
*
s_dkey
=
NULL
;
int
no_cache
=
0
,
ext_cache
=
0
;
int
rev
=
0
;
int
rev
=
0
,
naccept
=
-
1
;
#ifndef OPENSSL_NO_TLSEXT
EVP_PKEY
*
s_key2
=
NULL
;
X509
*
s_cert2
=
NULL
;
...
...
@@ -1040,6 +1040,17 @@ int MAIN(int argc, char *argv[])
if
(
!
extract_port
(
*
(
++
argv
),
&
port
))
goto
bad
;
}
else
if
(
strcmp
(
*
argv
,
"-naccept"
)
==
0
)
{
if
(
--
argc
<
1
)
goto
bad
;
naccept
=
atol
(
*
(
++
argv
));
if
(
naccept
<=
0
)
{
BIO_printf
(
bio_err
,
"bad accept value %s
\n
"
,
*
argv
);
goto
bad
;
}
}
else
if
(
strcmp
(
*
argv
,
"-verify"
)
==
0
)
{
s_server_verify
=
SSL_VERIFY_PEER
|
SSL_VERIFY_CLIENT_ONCE
;
...
...
@@ -2000,11 +2011,11 @@ bad:
BIO_printf
(
bio_s_out
,
"ACCEPT
\n
"
);
(
void
)
BIO_flush
(
bio_s_out
);
if
(
rev
)
do_server
(
port
,
socket_type
,
&
accept_socket
,
rev_body
,
context
);
do_server
(
port
,
socket_type
,
&
accept_socket
,
rev_body
,
context
,
naccept
);
else
if
(
www
)
do_server
(
port
,
socket_type
,
&
accept_socket
,
www_body
,
context
);
do_server
(
port
,
socket_type
,
&
accept_socket
,
www_body
,
context
,
naccept
);
else
do_server
(
port
,
socket_type
,
&
accept_socket
,
sv_body
,
context
);
do_server
(
port
,
socket_type
,
&
accept_socket
,
sv_body
,
context
,
naccept
);
print_stats
(
bio_s_out
,
ctx
);
ret
=
0
;
end:
...
...
apps/s_socket.c
浏览文件 @
b5cadfb5
...
...
@@ -280,7 +280,7 @@ static int init_client_ip(int *sock, const unsigned char ip[4], int port,
return
(
1
);
}
int
do_server
(
int
port
,
int
type
,
int
*
ret
,
int
(
*
cb
)(
char
*
hostname
,
int
s
,
unsigned
char
*
context
),
unsigned
char
*
context
)
int
do_server
(
int
port
,
int
type
,
int
*
ret
,
int
(
*
cb
)(
char
*
hostname
,
int
s
,
unsigned
char
*
context
),
unsigned
char
*
context
,
int
naccept
)
{
int
sock
;
char
*
name
=
NULL
;
...
...
@@ -310,7 +310,9 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns
if
(
name
!=
NULL
)
OPENSSL_free
(
name
);
if
(
type
==
SOCK_STREAM
)
SHUTDOWN2
(
sock
);
if
(
i
<
0
)
if
(
naccept
!=
-
1
)
naccept
--
;
if
(
i
<
0
||
naccept
==
0
)
{
SHUTDOWN2
(
accept_socket
);
return
(
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录