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
d6b9f054
Commit
d6b9f054
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
tool_main: Moved initial OperateConfig creation into main_init()
parent
2249f7fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tool_main.c
+36
-36
36 additions, 36 deletions
src/tool_main.c
with
36 additions
and
36 deletions
src/tool_main.c
+
36
−
36
View file @
d6b9f054
...
...
@@ -121,7 +121,7 @@ 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
(
struct
Operation
Config
*
config
)
static
CURLcode
main_init
(
struct
Global
Config
*
config
)
{
CURLcode
result
=
CURLE_OK
;
...
...
@@ -130,17 +130,29 @@ static CURLcode main_init(struct OperationConfig *config)
_djstat_flags
|=
_STAT_INODE
|
_STAT_EXEC_MAGIC
|
_STAT_DIRSIZE
;
#endif
/* 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
"
);
/* Allocate the initial operate config */
config
->
first
=
malloc
(
sizeof
(
struct
OperationConfig
));
if
(
config
->
first
)
{
/* Perform the libcurl initialization */
result
=
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
if
(
!
result
)
{
/* Get information about libcurl */
result
=
get_libcurl_info
();
if
(
!
result
)
{
/* Initialise the config */
config_init
(
config
->
first
);
}
else
helpf
(
stderr
,
"error retrieving curl library information
\n
"
);
}
else
helpf
(
stderr
,
"error initializing curl library
\n
"
);
}
else
{
helpf
(
stderr
,
"error initializing curl
\n
"
);
result
=
CURLE_FAILED_INIT
;
}
else
helpf
(
config
->
errors
,
"error initializing curl library
\n
"
);
return
result
;
}
...
...
@@ -163,8 +175,6 @@ int main(int argc, char *argv[])
{
CURLcode
result
=
CURLE_OK
;
struct
GlobalConfig
global
;
struct
OperationConfig
*
config
;
memset
(
&
global
,
0
,
sizeof
(
global
));
main_checkfds
();
...
...
@@ -176,36 +186,26 @@ int main(int argc, char *argv[])
/* Initialize memory tracking */
memory_tracking_init
();
/* Allocate the initial operate config */
config
=
malloc
(
sizeof
(
struct
OperationConfig
));
if
(
config
)
{
/* Initialise the config */
config_init
(
config
);
/* Initialize the curl library - do not call any libcurl functions before
this point */
result
=
main_init
(
config
);
if
(
!
result
)
{
/* Start our curl operation */
result
=
operate
(
config
,
argc
,
argv
);
/* Initialize the curl library - do not call any libcurl functions before
this point */
result
=
main_init
(
&
global
);
if
(
!
result
)
{
/* Start our curl operation */
result
=
operate
(
global
.
first
,
argc
,
argv
);
/* Perform the main cleanup */
main_free
();
}
/* Perform the main cleanup */
main_free
();
}
if
(
global
.
first
)
{
#ifdef __SYMBIAN32__
if
(
config
->
showerror
)
if
(
global
->
first
->
showerror
)
tool_pressanykey
();
#endif
/* Free the config structures */
config_free
(
config
);
config
=
NULL
;
}
else
{
helpf
(
stderr
,
"error initializing curl
\n
"
);
result
=
CURLE_FAILED_INIT
;
config_free
(
global
.
first
);
global
.
first
=
NULL
;
}
#ifdef __NOVELL_LIBC__
...
...
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