Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tools-mirror
Micropython
提交
d529c206
M
Micropython
项目概览
tools-mirror
/
Micropython
10 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Micropython
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d529c206
编写于
8月 09, 2023
作者:
D
Damien George
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
extmod/modssl_mbedtls: Fix ioctl of a socket in closed/error state.
Signed-off-by:
N
Damien George
<
damien@micropython.org
>
上级
20d3a6b1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
5 deletion
+10
-5
extmod/modssl_mbedtls.c
extmod/modssl_mbedtls.c
+9
-4
tests/extmod/ssl_ioctl.py.exp
tests/extmod/ssl_ioctl.py.exp
+1
-1
未找到文件。
extmod/modssl_mbedtls.c
浏览文件 @
d529c206
...
...
@@ -486,15 +486,20 @@ STATIC mp_uint_t socket_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, i
mp_uint_t
ret
=
0
;
uintptr_t
saved_arg
=
0
;
mp_obj_t
sock
=
self
->
sock
;
if
(
sock
==
MP_OBJ_NULL
||
(
request
!=
MP_STREAM_CLOSE
&&
self
->
last_error
!=
0
))
{
// Closed or error socket:
return
MP_STREAM_POLL_NVAL
;
}
if
(
request
==
MP_STREAM_CLOSE
)
{
if
(
sock
==
MP_OBJ_NULL
)
{
// Already closed socket, do nothing.
return
0
;
}
self
->
sock
=
MP_OBJ_NULL
;
mbedtls_ssl_free
(
&
self
->
ssl
);
}
else
if
(
request
==
MP_STREAM_POLL
)
{
if
(
sock
==
MP_OBJ_NULL
||
self
->
last_error
!=
0
)
{
// Closed or error socket, return NVAL flag.
return
MP_STREAM_POLL_NVAL
;
}
// If the library signaled us that it needs reading or writing, only check that direction,
// but save what the caller asked because we need to restore it later
if
(
self
->
poll_mask
&&
(
arg
&
MP_STREAM_POLL_RDWR
))
{
...
...
tests/extmod/ssl_ioctl.py.exp
浏览文件 @
d529c206
...
...
@@ -3,4 +3,4 @@
10 OSError
4 0
3 32
4
32
4
0
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录