BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
314a6ea4
Commit
314a6ea4
authored
Apr 05, 2019
by
Zahid Chowdhury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the timeout for connection phase of the curl lib
parent
e5b44666
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
CombainHttp.cpp
apps/locationService/combain/CombainHttp.cpp
+5
-0
No files found.
apps/locationService/combain/CombainHttp.cpp
View file @
314a6ea4
...
...
@@ -3,6 +3,8 @@
#include "legato.h"
#include "interfaces.h"
#define CURL_CONNECT_TIMEOUT_SECONDS 10L
static
ThreadSafeQueue
<
std
::
tuple
<
ma_combainLocation_LocReqHandleRef_t
,
std
::
string
>>
*
RequestJson
;
static
ThreadSafeQueue
<
std
::
tuple
<
ma_combainLocation_LocReqHandleRef_t
,
std
::
string
>>
*
ResponseJson
;
static
le_event_Id_t
ResponseAvailableEvent
;
...
...
@@ -91,6 +93,9 @@ void *CombainHttpThreadFunc(void *context)
LE_ASSERT
(
curl_easy_setopt
(
curl
,
CURLOPT_WRITEFUNCTION
,
WriteMemCallback
)
==
CURLE_OK
);
LE_ASSERT
(
curl_easy_setopt
(
curl
,
CURLOPT_WRITEDATA
,
(
void
*
)
&
HttpReceiveBuffer
)
==
CURLE_OK
);
// Set the timeout for connection phase
LE_ASSERT
(
curl_easy_setopt
(
curl
,
CURLOPT_CONNECTTIMEOUT
,
CURL_CONNECT_TIMEOUT_SECONDS
)
==
CURLE_OK
);
const
CURLcode
res
=
curl_easy_perform
(
curl
);
if
(
res
!=
CURLE_OK
)
{
...
...
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