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
989ec98e
Commit
989ec98e
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
modified and corrected test 506
parent
d262d0a6
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
tests/data/test506
+56
-50
56 additions, 50 deletions
tests/data/test506
tests/libtest/lib506.c
+21
-7
21 additions, 7 deletions
tests/libtest/lib506.c
with
77 additions
and
57 deletions
tests/data/test506
+
56
−
50
View file @
989ec98e
...
...
@@ -63,73 +63,79 @@ CURL_LOCK_DATA_COOKIE
CURL_LOCK_DATA_DNS
*** run 1
CURLOPT_SHARE
lock: share
<Pigs in space>
unlock: share
<Pigs in space>
lock: share <Pigs in space>
: 0
unlock: share <Pigs in space>
: 1
PERFORM
lock: dns
<Pigs in space>
unlock: dns
<Pigs in space>
lock: dns
<Pigs in space>
unlock: dns
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: dns <Pigs in space>
: 2
unlock: dns <Pigs in space>
: 3
lock: dns <Pigs in space>
: 4
unlock: dns <Pigs in space>
: 5
lock: cookie <Pigs in space>
: 6
unlock: cookie <Pigs in space>
: 7
lock: cookie <Pigs in space>
: 8
unlock: cookie <Pigs in space>
: 9
lock: cookie <Pigs in space>
: 10
unlock: cookie <Pigs in space>
: 11
lock: cookie <Pigs in space>
: 12
unlock: cookie <Pigs in space>
: 13
run 1: set cookie 1, 2 and 3
lock: dns <Pigs in space>
unlock: dns <Pigs in space>
lock: dns <Pigs in space>: 14
unlock: dns <Pigs in space>: 15
lock: dns <Pigs in space>: 16
unlock: dns <Pigs in space>: 17
CLEANUP
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie <Pigs in space>
: 18
unlock: cookie <Pigs in space>
: 19
*** run 2
CURLOPT_SHARE
lock: share
<Pigs in space>
unlock: share
<Pigs in space>
lock: share <Pigs in space>
: 20
unlock: share <Pigs in space>
: 21
PERFORM
lock: dns
<Pigs in space>
unlock: dns
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: dns <Pigs in space>
: 22
unlock: dns <Pigs in space>
: 23
lock: cookie <Pigs in space>
: 24
unlock: cookie <Pigs in space>
: 25
lock: cookie <Pigs in space>
: 26
unlock: cookie <Pigs in space>
: 27
lock: cookie <Pigs in space>
: 28
unlock: cookie <Pigs in space>
: 29
run 2: set cookie 4 and 5
lock: dns <Pigs in space>
unlock: dns <Pigs in space>
lock: dns <Pigs in space>: 30
unlock: dns <Pigs in space>: 31
lock: dns <Pigs in space>: 32
unlock: dns <Pigs in space>: 33
CLEANUP
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie <Pigs in space>
: 34
unlock: cookie <Pigs in space>
: 35
*** run 3
CURLOPT_SHARE
lock: share
<Pigs in space>
unlock: share
<Pigs in space>
lock: share <Pigs in space>
: 36
unlock: share <Pigs in space>
: 37
CURLOPT_COOKIEJAR
PERFORM
lock: dns
<Pigs in space>
unlock: dns
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: dns <Pigs in space>
: 38
unlock: dns <Pigs in space>
: 39
lock: cookie <Pigs in space>
: 40
unlock: cookie <Pigs in space>
: 41
lock: cookie <Pigs in space>
: 42
unlock: cookie <Pigs in space>
: 43
lock: cookie <Pigs in space>
: 44
unlock: cookie <Pigs in space>
: 45
run 3: overwrite cookie 1 and 4
lock: dns <Pigs in space>
unlock: dns <Pigs in space>
lock: dns <Pigs in space>: 46
unlock: dns <Pigs in space>: 47
lock: dns <Pigs in space>: 48
unlock: dns <Pigs in space>: 49
try SHARE_CLEANUP...
lock: share
<Pigs in space>
unlock: share
<Pigs in space>
lock: share <Pigs in space>
: 50
unlock: share <Pigs in space>
: 51
SHARE_CLEANUP failed, correct
CLEANUP
lock: cookie
<Pigs in space>
unlock: cookie
<Pigs in space>
lock: cookie <Pigs in space>
: 52
unlock: cookie <Pigs in space>
: 53
SHARE_CLEANUP
lock: share
<Pigs in space>
unlock: share
<Pigs in space>
lock: share <Pigs in space>
: 54
unlock: share <Pigs in space>
: 55
GLOBAL_CLEANUP
</stdout>
<stderr>
...
...
This diff is collapsed.
Click to expand it.
tests/libtest/lib506.c
+
21
−
7
View file @
989ec98e
...
...
@@ -14,20 +14,27 @@ struct Tdata {
char
*
url
;
};
struct
userdata
{
char
*
text
;
int
counter
;
};
/* lock callback */
void
lock
(
CURL
*
handle
,
curl_lock_data
data
,
curl_lock_access
access
,
void
*
useptr
)
{
const
char
*
what
;
struct
userdata
*
user
=
(
struct
userdata
*
)
useptr
;
(
void
)
handle
;
(
void
)
access
;
switch
(
data
)
{
case
CURL_LOCK_DATA_SHARE
:
what
=
"share
"
;
what
=
"share"
;
break
;
case
CURL_LOCK_DATA_DNS
:
what
=
"dns
"
;
what
=
"dns"
;
break
;
case
CURL_LOCK_DATA_COOKIE
:
what
=
"cookie"
;
...
...
@@ -36,20 +43,22 @@ void lock(CURL *handle, curl_lock_data data, curl_lock_access access,
fprintf
(
stderr
,
"lock: no such data: %d
\n
"
,
data
);
return
;
}
printf
(
"lock: %s <%s>
\n
"
,
what
,
(
char
*
)
useptr
);
printf
(
"lock: %-6s <%s>: %d
\n
"
,
what
,
user
->
text
,
user
->
counter
);
user
->
counter
++
;
}
/* unlock callback */
void
unlock
(
CURL
*
handle
,
curl_lock_data
data
,
void
*
useptr
)
{
const
char
*
what
;
struct
userdata
*
user
=
(
struct
userdata
*
)
useptr
;
(
void
)
handle
;
switch
(
data
)
{
case
CURL_LOCK_DATA_SHARE
:
what
=
"share
"
;
what
=
"share"
;
break
;
case
CURL_LOCK_DATA_DNS
:
what
=
"dns
"
;
what
=
"dns"
;
break
;
case
CURL_LOCK_DATA_COOKIE
:
what
=
"cookie"
;
...
...
@@ -58,7 +67,8 @@ void unlock(CURL *handle, curl_lock_data data, void *useptr )
fprintf
(
stderr
,
"unlock: no such data: %d
\n
"
,
data
);
return
;
}
printf
(
"unlock: %s <%s>
\n
"
,
what
,
(
char
*
)
useptr
);
printf
(
"unlock: %-6s <%s>: %d
\n
"
,
what
,
user
->
text
,
user
->
counter
);
user
->
counter
++
;
}
...
...
@@ -127,6 +137,10 @@ CURLcode test(char *URL)
CURLSH
*
share
;
struct
curl_slist
*
headers
;
int
i
;
struct
userdata
user
;
user
.
text
=
(
char
*
)
"Pigs in space"
;
user
.
counter
=
0
;
printf
(
"GLOBAL_INIT
\n
"
);
curl_global_init
(
CURL_GLOBAL_ALL
);
...
...
@@ -136,7 +150,7 @@ CURLcode test(char *URL)
share
=
curl_share_init
();
curl_share_setopt
(
share
,
CURLSHOPT_LOCKFUNC
,
lock
);
curl_share_setopt
(
share
,
CURLSHOPT_UNLOCKFUNC
,
unlock
);
curl_share_setopt
(
share
,
CURLSHOPT_USERDATA
,
"Pigs in space"
);
curl_share_setopt
(
share
,
CURLSHOPT_USERDATA
,
&
user
);
printf
(
"CURL_LOCK_DATA_COOKIE
\n
"
);
curl_share_setopt
(
share
,
CURLSHOPT_SHARE
,
CURL_LOCK_DATA_COOKIE
);
printf
(
"CURL_LOCK_DATA_DNS
\n
"
);
...
...
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