Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
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
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
6127e54f
Commit
6127e54f
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
tool_operate: Moved libcurl information gathering to tool_main
parent
8b665422
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
src/tool_main.c
+19
-7
19 additions, 7 deletions
src/tool_main.c
src/tool_operate.c
+0
-6
0 additions, 6 deletions
src/tool_operate.c
with
19 additions
and
13 deletions
src/tool_main.c
+
19
−
7
View file @
6127e54f
...
...
@@ -38,6 +38,7 @@
#include
"tool_panykey.h"
#include
"tool_vms.h"
#include
"tool_main.h"
#include
"tool_libinfo.h"
/*
* This is low-level hard-hacking memory leak tracking and similar. Using
...
...
@@ -120,14 +121,28 @@ static void memory_tracking_init(void)
* _any_ libcurl usage. If this fails, *NO* libcurl functions may be
* used, or havoc may be the result.
*/
static
CURLcode
main_init
(
void
)
static
CURLcode
main_init
(
struct
Configurable
*
config
)
{
CURLcode
result
=
CURLE_OK
;
#if defined(__DJGPP__) || defined(__GO32__)
/* stop stat() wasting time */
_djstat_flags
|=
_STAT_INODE
|
_STAT_EXEC_MAGIC
|
_STAT_DIRSIZE
;
#endif
return
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
/* Perform the libcurl initialization */
result
=
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
if
(
!
result
)
{
/* Get information about libcurl */
result
=
get_libcurl_info
();
if
(
result
)
helpf
(
config
->
errors
,
"error retrieving curl library information
\n
"
);
}
else
helpf
(
config
->
errors
,
"error initializing curl library
\n
"
);
return
result
;
}
/*
...
...
@@ -167,17 +182,14 @@ int main(int argc, char *argv[])
/* Initialize the curl library - do not call any libcurl functions before
this point */
if
(
!
main_init
())
{
res
=
main_init
(
config
);
if
(
!
res
)
{
/* Start our curl operation */
res
=
operate
(
config
,
argc
,
argv
);
/* Perform the main cleanup */
main_free
();
}
else
{
helpf
(
config
->
errors
,
"error initializing curl library
\n
"
);
res
=
CURLE_FAILED_INIT
;
}
#ifdef __SYMBIAN32__
if
(
config
->
showerror
)
...
...
This diff is collapsed.
Click to expand it.
src/tool_operate.c
+
0
−
6
View file @
6127e54f
...
...
@@ -212,12 +212,6 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
heads
.
stream
=
stdout
;
heads
.
config
=
config
;
/* Get libcurl info right away */
if
(
get_libcurl_info
()
!=
CURLE_OK
)
{
helpf
(
config
->
errors
,
"error retrieving curl library information
\n
"
);
return
CURLE_FAILED_INIT
;
}
/* Get a curl handle to use for all forthcoming curl transfers */
curl
=
curl_easy_init
();
if
(
!
curl
)
{
...
...
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