Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
cb4fbc88
Commit
cb4fbc88
authored
Jan 21, 2016
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix/modsocket: accept(): Make IPv6-clean.
By reserving enough space for peer address.
parent
f22844b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
unix/modsocket.c
unix/modsocket.c
+4
-2
No files found.
unix/modsocket.c
View file @
cb4fbc88
...
...
@@ -155,9 +155,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_listen_obj, socket_listen);
STATIC
mp_obj_t
socket_accept
(
mp_obj_t
self_in
)
{
mp_obj_socket_t
*
self
=
MP_OBJ_TO_PTR
(
self_in
);
struct
sockaddr
addr
;
// sockaddr_storage isn't stack-friendly (129 bytes or so)
//struct sockaddr_storage addr;
byte
addr
[
32
];
socklen_t
addr_len
=
sizeof
(
addr
);
int
fd
=
accept
(
self
->
fd
,
&
addr
,
&
addr_len
);
int
fd
=
accept
(
self
->
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addr_len
);
RAISE_ERRNO
(
fd
,
errno
);
mp_obj_tuple_t
*
t
=
MP_OBJ_TO_PTR
(
mp_obj_new_tuple
(
2
,
NULL
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment