Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
8065439f
Commit
8065439f
authored
Sep 14, 2017
by
Deomid Ryabkov
Committed by
Cesanta Bot
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Acquire lock when manipulating rx in SSL recv path
PUBLISHED_FROM=a34cfa3ebc12daf75d7f24c8d3f3707dcc33d9a2
parent
62c896a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
mongoose.c
mongoose.c
+2
-0
No files found.
mongoose.c
View file @
8065439f
...
@@ -15465,6 +15465,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
...
@@ -15465,6 +15465,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
}
}
size_t
seg_len
=
(
seg
->
len
-
cs
->
rx_offset
);
size_t
seg_len
=
(
seg
->
len
-
cs
->
rx_offset
);
DBG
((
"%u %u %u %u"
,
len
,
cs
->
rx_chain
->
len
,
seg_len
,
cs
->
rx_chain
->
tot_len
));
DBG
((
"%u %u %u %u"
,
len
,
cs
->
rx_chain
->
len
,
seg_len
,
cs
->
rx_chain
->
tot_len
));
mgos_lock
();
len
=
MIN
(
len
,
seg_len
);
len
=
MIN
(
len
,
seg_len
);
pbuf_copy_partial
(
seg
,
buf
,
len
,
cs
->
rx_offset
);
pbuf_copy_partial
(
seg
,
buf
,
len
,
cs
->
rx_offset
);
cs
->
rx_offset
+=
len
;
cs
->
rx_offset
+=
len
;
...
@@ -15476,6 +15477,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
...
@@ -15476,6 +15477,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
pbuf_free
(
seg
);
pbuf_free
(
seg
);
cs
->
rx_offset
=
0
;
cs
->
rx_offset
=
0
;
}
}
mgos_unlock
();
LOG
(
LL_DEBUG
,
(
"%p <- %d"
,
nc
,
(
int
)
len
));
LOG
(
LL_DEBUG
,
(
"%p <- %d"
,
nc
,
(
int
)
len
));
return
len
;
return
len
;
}
}
...
...
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