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
d6c38804
Commit
d6c38804
authored
Jun 23, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QNX SSL upload fix
parent
6f66d794
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
mongoose.c
mongoose.c
+8
-2
No files found.
mongoose.c
View file @
d6c38804
...
@@ -752,7 +752,13 @@ static void ns_read_from_socket(struct ns_connection *conn) {
...
@@ -752,7 +752,13 @@ static void ns_read_from_socket(struct ns_connection *conn) {
#ifdef NS_ENABLE_SSL
#ifdef NS_ENABLE_SSL
if
(
conn
->
ssl
!=
NULL
)
{
if
(
conn
->
ssl
!=
NULL
)
{
if
(
conn
->
flags
&
NSF_SSL_HANDSHAKE_DONE
)
{
if
(
conn
->
flags
&
NSF_SSL_HANDSHAKE_DONE
)
{
n
=
SSL_read
(
conn
->
ssl
,
buf
,
sizeof
(
buf
));
// SSL library may have more bytes ready to read then we ask to read.
// Therefore, read in a loop until we read everything. Without the loop,
// we skip to the next select() cycle which can just timeout.
while
((
n
=
SSL_read
(
conn
->
ssl
,
buf
,
sizeof
(
buf
)))
>
0
)
{
iobuf_append
(
&
conn
->
recv_iobuf
,
buf
,
n
);
ns_call
(
conn
,
NS_RECV
,
&
n
);
}
}
else
{
}
else
{
int
res
=
SSL_accept
(
conn
->
ssl
);
int
res
=
SSL_accept
(
conn
->
ssl
);
int
ssl_err
=
SSL_get_error
(
conn
->
ssl
,
res
);
int
ssl_err
=
SSL_get_error
(
conn
->
ssl
,
res
);
...
@@ -4061,7 +4067,7 @@ int mg_terminate_ssl(struct mg_connection *c, const char *cert) {
...
@@ -4061,7 +4067,7 @@ int mg_terminate_ssl(struct mg_connection *c, const char *cert) {
// When clear-text reply is pushed to client, switch to SSL mode.
// When clear-text reply is pushed to client, switch to SSL mode.
n
=
send
(
conn
->
ns_conn
->
sock
,
ok
,
sizeof
(
ok
)
-
1
,
0
);
n
=
send
(
conn
->
ns_conn
->
sock
,
ok
,
sizeof
(
ok
)
-
1
,
0
);
DBG
((
"%p %
l
u %d SEND"
,
c
,
sizeof
(
ok
)
-
1
,
n
));
DBG
((
"%p %
z
u %d SEND"
,
c
,
sizeof
(
ok
)
-
1
,
n
));
conn
->
ns_conn
->
send_iobuf
.
len
=
0
;
conn
->
ns_conn
->
send_iobuf
.
len
=
0
;
conn
->
endpoint_type
=
EP_USER
;
// To keep-alive in close_local_endpoint()
conn
->
endpoint_type
=
EP_USER
;
// To keep-alive in close_local_endpoint()
close_local_endpoint
(
conn
);
// Clean up current CONNECT request
close_local_endpoint
(
conn
);
// Clean up current CONNECT request
...
...
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