Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
e0cabc89
Commit
e0cabc89
authored
Apr 06, 2015
by
Suresh Namla
Browse files
Dlib::http_client - Changes for configured Socket Connection Initialization Timeout
parent
80ea9c66
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
dlib/http_client/http_client.cpp
dlib/http_client/http_client.cpp
+1
-1
dlib/http_client/http_client.h
dlib/http_client/http_client.h
+3
-1
No files found.
dlib/http_client/http_client.cpp
View file @
e0cabc89
...
@@ -553,7 +553,7 @@ namespace dlib
...
@@ -553,7 +553,7 @@ namespace dlib
dlib
::
connection
*
conn
(
0
);
dlib
::
connection
*
conn
(
0
);
try
try
{
{
conn
=
dlib
::
connect
(
host
,
port
);
conn
=
dlib
::
connect
(
host
,
port
,
connection_timeout
);
}
}
catch
(
const
dlib
::
socket_error
&
e
)
catch
(
const
dlib
::
socket_error
&
e
)
{
{
...
...
dlib/http_client/http_client.h
View file @
e0cabc89
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
// Default timeout after 60 seconds
// Default timeout after 60 seconds
#define DEFAULT_TIMEOUT 60000
#define DEFAULT_TIMEOUT 60000
#define DEFAULT_CONNECTION_TIMEOUT 21000
namespace
dlib
namespace
dlib
{
{
...
@@ -50,7 +51,7 @@ namespace dlib
...
@@ -50,7 +51,7 @@ namespace dlib
void
set_timeout
(
unsigned
int
milliseconds
=
DEFAULT_TIMEOUT
)
{
timeout
=
milliseconds
;
}
void
set_timeout
(
unsigned
int
milliseconds
=
DEFAULT_TIMEOUT
)
{
timeout
=
milliseconds
;
}
void
set_connectiontimeout
(
unsigned
int
milliseconds
=
DEFAULT_CONNECTION_TIMEOUT
)
{
connection_timeout
=
milliseconds
;
}
string_to_stringvector
get_returned_headers
()
const
{
return
returned_headers
;
}
string_to_stringvector
get_returned_headers
()
const
{
return
returned_headers
;
}
short
get_http_return
()
const
{
return
http_return
;
}
short
get_http_return
()
const
{
return
http_return
;
}
...
@@ -86,6 +87,7 @@ namespace dlib
...
@@ -86,6 +87,7 @@ namespace dlib
std
::
string
returned_body
,
error_field
;
std
::
string
returned_body
,
error_field
;
unsigned
int
timeout
;
unsigned
int
timeout
;
unsigned
int
connection_timeout
;
fnOnDownload
OnDownload
;
fnOnDownload
OnDownload
;
void
*
user_info
;
void
*
user_info
;
...
...
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