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
d4127245
Commit
d4127245
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
test507 for multi with bad host name
parent
f95de767
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/libtest/Makefile.am
+4
-1
4 additions, 1 deletion
tests/libtest/Makefile.am
tests/libtest/lib507.c
+50
-0
50 additions, 0 deletions
tests/libtest/lib507.c
with
54 additions
and
1 deletion
tests/libtest/Makefile.am
+
4
−
1
View file @
d4127245
...
...
@@ -11,7 +11,7 @@ LIBDIR = ../../lib
SUPPORTFILES
=
first.c test.h
# here are all tools used for running libcurl tests
noinst_PROGRAMS
=
lib500 lib501 lib502 lib503 lib504 lib505 lib506
noinst_PROGRAMS
=
lib500 lib501 lib502 lib503 lib504 lib505 lib506
lib507
lib500_SOURCES
=
lib500.c
$(
SUPPORTFILES
)
lib500_LDADD
=
$(
LIBDIR
)
/libcurl.la
...
...
@@ -41,3 +41,6 @@ lib506_SOURCES = lib506.c $(SUPPORTFILES)
lib506_LDADD
=
$(
LIBDIR
)
/libcurl.la
lib506_DEPENDENCIES
=
$(
LIBDIR
)
/libcurl.la
lib507_SOURCES
=
lib507.c
$(
SUPPORTFILES
)
lib507_LDADD
=
$(
LIBDIR
)
/libcurl.la
lib507_DEPENDENCIES
=
$(
LIBDIR
)
/libcurl.la
This diff is collapsed.
Click to expand it.
tests/libtest/lib507.c
0 → 100644
+
50
−
0
View file @
d4127245
#include
"test.h"
CURLcode
test
(
char
*
URL
)
{
CURL
*
curls
;
CURLM
*
multi
;
int
still_running
;
int
i
;
CURLMsg
*
msg
;
multi
=
curl_multi_init
();
curls
=
curl_easy_init
();
curl_easy_setopt
(
curls
,
CURLOPT_URL
,
URL
);
curl_multi_add_handle
(
multi
,
curls
);
while
(
CURLM_CALL_MULTI_PERFORM
==
curl_multi_perform
(
multi
,
&
still_running
)
);
while
(
still_running
)
{
struct
timeval
timeout
;
int
rc
;
fd_set
fdread
;
fd_set
fdwrite
;
fd_set
fdexcep
;
int
maxfd
;
FD_ZERO
(
&
fdread
);
FD_ZERO
(
&
fdwrite
);
FD_ZERO
(
&
fdexcep
);
timeout
.
tv_sec
=
1
;
timeout
.
tv_usec
=
0
;
curl_multi_fdset
(
multi
,
&
fdread
,
&
fdwrite
,
&
fdexcep
,
&
maxfd
);
rc
=
select
(
maxfd
+
1
,
&
fdread
,
&
fdwrite
,
&
fdexcep
,
&
timeout
);
switch
(
rc
)
{
case
-
1
:
break
;
case
0
:
default:
while
(
CURLM_CALL_MULTI_PERFORM
==
curl_multi_perform
(
multi
,
&
still_running
));
break
;
}
}
msg
=
curl_multi_info_read
(
multi
,
&
still_running
);
/* this should now contain a result code from the easy handle,
get it */
i
=
msg
->
data
.
result
;
curl_multi_cleanup
(
multi
);
curl_easy_cleanup
(
curls
);
return
i
;
/* return the final return code */
}
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