Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
David Youssefi
otb
Commits
887adbb2
Commit
887adbb2
authored
14 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
BUG: fix compilation adding missing include
parent
db5eed6a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/IO/otbCurlHelper.cxx
+13
-1
13 additions, 1 deletion
Code/IO/otbCurlHelper.cxx
Code/IO/otbCurlHelper.h
+10
-15
10 additions, 15 deletions
Code/IO/otbCurlHelper.h
with
23 additions
and
16 deletions
Code/IO/otbCurlHelper.cxx
+
13
−
1
View file @
887adbb2
...
...
@@ -24,6 +24,8 @@
#include
<cstring>
#endif
#include
<cstdio>
namespace
otb
{
...
...
@@ -107,7 +109,6 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs,
#ifdef OTB_USE_CURL
#ifdef OTB_CURL_MULTI_AVAILABLE
otbMsgDevMacro
(
<<
"Using curl multi"
);
//std::string m_Browser = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11";
CURLM
*
multiHandle
;
std
::
vector
<
CURL
*>
listCurlHandles
;
...
...
@@ -278,4 +279,15 @@ int CurlHelper::RetrieveFileMulti(const std::vector<std::string>& listURLs,
#endif
}
size_t
CurlHelper
::
write_data
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
void
*
data
)
{
size_t
written
;
FILE
*
fDescriptor
=
(
FILE
*
)(
data
);
written
=
fwrite
(
ptr
,
size
,
nmemb
,
fDescriptor
);
return
written
;
}
}
This diff is collapsed.
Click to expand it.
Code/IO/otbCurlHelper.h
+
10
−
15
View file @
887adbb2
...
...
@@ -28,6 +28,10 @@ namespace otb
* \class CurlHelper
* \brief Class to use the curl capabilities from OTB
*
* This class is responsible for behaving properly when curl is
* not available, i.e. the compilation should pass, the runtime should
* not segfault but of course, the behaviour will be different.
*
*/
class
ITK_EXPORT
CurlHelper
:
public
itk
::
Object
{
...
...
@@ -49,10 +53,10 @@ public:
const
std
::
vector
<
std
::
string
>&
listFiles
,
int
maxConnect
)
const
;
protected:
CurlHelper
()
{
m_Browser
=
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11)
Gecko/20071127 Firefox/2.0.0.11"
;
}
CurlHelper
()
:
m_Browser
(
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) "
"
Gecko/20071127 Firefox/2.0.0.11"
)
{
}
~
CurlHelper
()
{}
...
...
@@ -66,18 +70,9 @@ private:
}
// Need to use our writing function to handle windows segfaults
// Need to be static cause the CURL_OPT is ex
c
pecting a pure C
// Need to be static cause the CURL_OPT is expecting a pure C
// function or a static c++ method.
static
size_t
write_data
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
void
*
data
)
{
size_t
written
;
FILE
*
fDescriptor
=
(
FILE
*
)(
data
);
written
=
fwrite
(
ptr
,
size
,
nmemb
,
fDescriptor
);
return
written
;
}
static
size_t
write_data
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
void
*
data
);
// Browser Agent used
std
::
string
m_Browser
;
...
...
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