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
dde30810
Commit
dde30810
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
tool_operate: Introduced operate_init() function
parent
2dc7ad23
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_operate.c
+20
-9
20 additions, 9 deletions
src/tool_operate.c
with
20 additions
and
9 deletions
src/tool_operate.c
+
20
−
9
View file @
dde30810
...
...
@@ -184,6 +184,17 @@ static curl_off_t VmsSpecialSize(const char * name,
}
#endif
/* __VMS */
static
CURLcode
operate_init
(
struct
Configurable
*
config
)
{
/* Get a curl handle to use for all forthcoming curl transfers */
config
->
easy
=
curl_easy_init
();
if
(
!
config
->
easy
)
{
helpf
(
config
->
errors
,
"error initializing curl easy handle
\n
"
);
return
CURLE_FAILED_INIT
;
}
return
CURLE_OK
;
}
static
int
operate_do
(
struct
Configurable
*
config
,
int
argc
,
argv_item_t
argv
[])
{
...
...
@@ -196,7 +207,7 @@ static int operate_do(struct Configurable *config, int argc, argv_item_t argv[])
metalinkfile
*
mlfile_last
=
NULL
;
CURL
*
curl
=
NULL
;
CURL
*
curl
=
config
->
easy
;
char
*
httpgetfields
=
NULL
;
int
res
=
0
;
...
...
@@ -212,14 +223,6 @@ static int operate_do(struct Configurable *config, int argc, argv_item_t argv[])
heads
.
stream
=
stdout
;
heads
.
config
=
config
;
/* Get a curl handle to use for all forthcoming curl transfers */
curl
=
curl_easy_init
();
if
(
!
curl
)
{
helpf
(
config
->
errors
,
"error initializing curl easy handle
\n
"
);
return
CURLE_FAILED_INIT
;
}
config
->
easy
=
curl
;
/*
** Beyond this point no return'ing from this function allowed.
** Jump to label 'quit_curl' in order to abandon this function
...
...
@@ -1842,5 +1845,13 @@ static int operate_do(struct Configurable *config, int argc, argv_item_t argv[])
int
operate
(
struct
Configurable
*
config
,
int
argc
,
argv_item_t
argv
[])
{
int
result
=
0
;
/* Initialize the easy interface */
result
=
operate_init
(
config
);
if
(
result
)
return
result
;
/* Perform the main operation */
return
operate_do
(
config
,
argc
,
argv
);
}
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