Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
20
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
1b790dc7
Commit
1b790dc7
authored
4 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[*] Check for CONNECTING flag in http request timeout
parent
b159bd53
No related branches found
No related tags found
No related merge requests found
Pipeline
#7032
passed with stage
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap-sdk/net/client/dap_client_http.c
+18
-13
18 additions, 13 deletions
dap-sdk/net/client/dap_client_http.c
with
18 additions
and
13 deletions
dap-sdk/net/client/dap_client_http.c
+
18
−
13
View file @
1b790dc7
...
...
@@ -126,22 +126,27 @@ static bool s_timer_timeout_check(void * a_arg)
if
(
dap_events_socket_check_unsafe
(
l_worker
,
l_es
)
){
if
(
!
dap_uint128_check_equal
(
l_es
->
uuid
,
l_es_handler
->
uuid
)){
//
Timer esocket wrong argument, ignore this timeout...
log_it
(
L_DEBUG
,
"
Timer esocket wrong argument, ignore this timeout...
"
);
DAP_DEL_Z
(
l_es_handler
)
return
false
;
}
dap_client_http_pvt_t
*
l_http_pvt
=
PVT
(
l_es
);
log_it
(
L_WARNING
,
"Connection timeout for request http://%s:%u/%s, possible network problems or host is down"
,
l_http_pvt
->
uplink_addr
,
l_http_pvt
->
uplink_port
,
l_http_pvt
->
path
);
if
(
l_http_pvt
->
error_callback
)
{
l_http_pvt
->
error_callback
(
ETIMEDOUT
,
l_http_pvt
->
obj
);
l_http_pvt
->
were_callbacks_called
=
true
;
}
l_http_pvt
->
is_closed_by_timeout
=
true
;
log_it
(
L_INFO
,
"Close %s sock %u type %d by timeout"
,
l_es
->
remote_addr_str
?
l_es
->
remote_addr_str
:
""
,
l_es
->
socket
,
l_es
->
type
);
dap_events_socket_remove_and_delete_unsafe
(
l_es
,
true
);
}
if
(
l_es
->
flags
&
DAP_SOCK_CONNECTING
){
dap_client_http_pvt_t
*
l_http_pvt
=
PVT
(
l_es
);
log_it
(
L_WARNING
,
"Connecting timeout for request http://%s:%u/%s, possible network problems or host is down"
,
l_http_pvt
->
uplink_addr
,
l_http_pvt
->
uplink_port
,
l_http_pvt
->
path
);
if
(
l_http_pvt
->
error_callback
)
{
l_http_pvt
->
error_callback
(
ETIMEDOUT
,
l_http_pvt
->
obj
);
l_http_pvt
->
were_callbacks_called
=
true
;
}
l_http_pvt
->
is_closed_by_timeout
=
true
;
log_it
(
L_INFO
,
"Close %s sock %u type %d by timeout"
,
l_es
->
remote_addr_str
?
l_es
->
remote_addr_str
:
""
,
l_es
->
socket
,
l_es
->
type
);
dap_events_socket_remove_and_delete_unsafe
(
l_es
,
true
);
}
else
log_it
(
L_DEBUG
,
"Socket %d is connected, close check timer"
,
l_es
->
socket
);
}
else
log_it
(
L_DEBUG
,
"Esocket %p is finished, close check timer"
,
l_es
);
DAP_DEL_Z
(
l_es_handler
)
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment