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
e139bde6
Commit
e139bde6
authored
Dec 11, 2015
by
Deomid Ryabkov
Committed by
rojer
Dec 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A couple SSL-related fixes for Mongoose
PUBLISHED_FROM=03297850f7a620588de851ef86be25e17a04ad28
parent
5f629511
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
mongoose.c
mongoose.c
+10
-4
No files found.
mongoose.c
View file @
e139bde6
...
...
@@ -3015,8 +3015,6 @@ static void mg_write_to_socket(struct mg_connection *nc) {
int
ssl_err
=
mg_ssl_err
(
nc
,
n
);
if
(
ssl_err
==
SSL_ERROR_WANT_READ
||
ssl_err
==
SSL_ERROR_WANT_WRITE
)
{
return
;
/* Call us again */
}
else
{
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
}
else
{
/* Successful SSL operation, clear off SSL wait flags */
...
...
@@ -3117,8 +3115,16 @@ static void mg_handle_udp_read(struct mg_connection *nc) {
#ifdef MG_ENABLE_SSL
static
int
mg_ssl_err
(
struct
mg_connection
*
conn
,
int
res
)
{
int
ssl_err
=
SSL_get_error
(
conn
->
ssl
,
res
);
if
(
ssl_err
==
SSL_ERROR_WANT_READ
)
conn
->
flags
|=
MG_F_WANT_READ
;
if
(
ssl_err
==
SSL_ERROR_WANT_WRITE
)
conn
->
flags
|=
MG_F_WANT_WRITE
;
DBG
((
"%p %d -> %d"
,
conn
,
res
,
ssl_err
));
if
(
ssl_err
==
SSL_ERROR_WANT_READ
)
{
conn
->
flags
|=
MG_F_WANT_READ
;
}
else
if
(
ssl_err
==
SSL_ERROR_WANT_WRITE
)
{
conn
->
flags
|=
MG_F_WANT_WRITE
;
}
else
{
/* There could be an alert to deliver. Try our best. */
SSL_write
(
conn
->
ssl
,
""
,
0
);
conn
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
return
ssl_err
;
}
...
...
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