Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
non-destructive text micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
badge fixer
non-destructive text micropython
Commits
68a5d6fe
Commit
68a5d6fe
authored
6 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
extmod/modlwip: Fix case where concurrency lock isn't released on error.
parent
493ee7df
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
extmod/modlwip.c
+10
-1
10 additions, 1 deletion
extmod/modlwip.c
with
10 additions
and
1 deletion
extmod/modlwip.c
+
10
−
1
View file @
68a5d6fe
...
...
@@ -536,6 +536,15 @@ STATIC mp_uint_t lwip_udp_receive(lwip_socket_obj_t *socket, byte *buf, mp_uint_
} \
assert(socket->pcb.tcp);
// Version of above for use when lock is held
#define STREAM_ERROR_CHECK_WITH_LOCK(socket) \
if (socket->state < 0) { \
*_errno = error_lookup_table[-socket->state]; \
MICROPY_PY_LWIP_EXIT \
return MP_STREAM_ERROR; \
} \
assert(socket->pcb.tcp);
// Helper function for send/sendto to handle TCP packets
STATIC
mp_uint_t
lwip_tcp_send
(
lwip_socket_obj_t
*
socket
,
const
byte
*
buf
,
mp_uint_t
len
,
int
*
_errno
)
{
...
...
@@ -572,7 +581,7 @@ STATIC mp_uint_t lwip_tcp_send(lwip_socket_obj_t *socket, const byte *buf, mp_ui
}
// While we waited, something could happen
STREAM_ERROR_CHECK
(
socket
);
STREAM_ERROR_CHECK
_WITH_LOCK
(
socket
);
}
u16_t
write_len
=
MIN
(
available
,
len
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment