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
5cdf8383
Commit
5cdf8383
authored
Nov 17, 2015
by
Deomid Ryabkov
Committed by
Sergey Lyubka
Nov 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error handling in async resolver
PUBLISHED_FROM=1e8558ec08f8e72d70163d34e0920f80f74372d1
parent
6418cad3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
mongoose.c
mongoose.c
+18
-5
No files found.
mongoose.c
View file @
5cdf8383
...
...
@@ -7796,8 +7796,6 @@ static void mg_resolve_async_eh(struct mg_connection *nc, int ev, void *data) {
case
MG_EV_CONNECT
:
case
MG_EV_POLL
:
if
(
req
->
retries
>
req
->
max_retries
)
{
req
->
callback
(
NULL
,
req
->
data
);
MG_FREE
(
req
);
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
break
;
}
...
...
@@ -7812,13 +7810,28 @@ static void mg_resolve_async_eh(struct mg_connection *nc, int ev, void *data) {
if
(
mg_parse_dns
(
nc
->
recv_mbuf
.
buf
,
*
(
int
*
)
data
,
msg
)
==
0
&&
msg
->
num_answers
>
0
)
{
req
->
callback
(
msg
,
req
->
data
);
}
else
{
req
->
callback
(
NULL
,
req
->
data
);
nc
->
user_data
=
NULL
;
MG_FREE
(
req
);
}
MG_FREE
(
req
);
MG_FREE
(
msg
);
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
break
;
case
MG_EV_SEND
:
/*
* If a send error occurs, prevent closing of the connection by the core.
* We will retry after timeout.
*/
nc
->
flags
&=
~
MG_F_CLOSE_IMMEDIATELY
;
mbuf_remove
(
&
nc
->
send_mbuf
,
nc
->
send_mbuf
.
len
);
break
;
case
MG_EV_CLOSE
:
/* If we got here with request still not done, fire an error callback. */
if
(
req
!=
NULL
)
{
req
->
callback
(
NULL
,
req
->
data
);
nc
->
user_data
=
NULL
;
MG_FREE
(
req
);
}
break
;
}
}
...
...
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