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
b4dbc825
Commit
b4dbc825
authored
Feb 25, 2016
by
Deomid Ryabkov
Committed by
Marko Mikulicic
Feb 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes to Mongoose
PUBLISHED_FROM=8a8692e5cfaab63723fc9e241a50e8f229a26438
parent
4a0cc822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
mongoose.c
mongoose.c
+7
-6
No files found.
mongoose.c
View file @
b4dbc825
...
...
@@ -2123,7 +2123,9 @@ void mg_if_timer(struct mg_connection *c, double now) {
}
void
mg_if_poll
(
struct
mg_connection
*
nc
,
time_t
now
)
{
mg_call
(
nc
,
NULL
,
MG_EV_POLL
,
&
now
);
if
(
nc
->
ssl
==
NULL
||
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
))
{
mg_call
(
nc
,
NULL
,
MG_EV_POLL
,
&
now
);
}
}
static
void
mg_destroy_conn
(
struct
mg_connection
*
conn
)
{
...
...
@@ -3236,6 +3238,7 @@ static void mg_write_to_socket(struct mg_connection *nc) {
if
(
nc
->
ssl
!=
NULL
)
{
if
(
nc
->
flags
&
MG_F_SSL_HANDSHAKE_DONE
)
{
n
=
SSL_write
(
nc
->
ssl
,
io
->
buf
,
io
->
len
);
DBG
((
"%p %d bytes -> %d (SSL)"
,
nc
,
n
,
nc
->
sock
));
if
(
n
<=
0
)
{
int
ssl_err
=
mg_ssl_err
(
nc
,
n
);
if
(
ssl_err
==
SSL_ERROR_WANT_READ
||
ssl_err
==
SSL_ERROR_WANT_WRITE
)
{
...
...
@@ -3253,10 +3256,9 @@ static void mg_write_to_socket(struct mg_connection *nc) {
#endif
{
n
=
(
int
)
MG_SEND_FUNC
(
nc
->
sock
,
io
->
buf
,
io
->
len
,
0
);
DBG
((
"%p %d bytes -> %d"
,
nc
,
n
,
nc
->
sock
));
}
DBG
((
"%p %d bytes -> %d"
,
nc
,
n
,
nc
->
sock
));
if
(
n
>
0
)
{
mbuf_remove
(
io
,
n
);
}
...
...
@@ -3361,7 +3363,7 @@ static int mg_ssl_err(struct mg_connection *conn, int res) {
}
static
void
mg_ssl_begin
(
struct
mg_connection
*
nc
)
{
int
server_side
=
nc
->
listener
!=
NULL
;
int
server_side
=
(
nc
->
listener
!=
NULL
)
;
int
res
=
server_side
?
SSL_accept
(
nc
->
ssl
)
:
SSL_connect
(
nc
->
ssl
);
DBG
((
"%p %d res %d %d"
,
nc
,
server_side
,
res
,
errno
));
...
...
@@ -3372,8 +3374,7 @@ static void mg_ssl_begin(struct mg_connection *nc) {
if
(
server_side
)
{
union
socket_address
sa
;
socklen_t
sa_len
=
sizeof
(
sa
);
/* In case port was set to 0, get the real port number */
(
void
)
getsockname
(
nc
->
sock
,
&
sa
.
sa
,
&
sa_len
);
(
void
)
getpeername
(
nc
->
sock
,
&
sa
.
sa
,
&
sa_len
);
mg_if_accept_tcp_cb
(
nc
,
&
sa
,
sa_len
);
}
else
{
mg_if_connect_cb
(
nc
,
0
);
...
...
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