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
dc28a9c0
Commit
dc28a9c0
authored
20 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
make sure the ipv6 http server gets its pid stored in a separate file
parent
1faef62d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/httpserver.pl
+6
-1
6 additions, 1 deletion
tests/httpserver.pl
tests/runtests.pl
+1
-2
1 addition, 2 deletions
tests/runtests.pl
tests/server/sws.c
+12
-7
12 additions, 7 deletions
tests/server/sws.c
with
19 additions
and
10 deletions
tests/httpserver.pl
+
6
−
1
View file @
dc28a9c0
...
...
@@ -7,6 +7,7 @@ my $verbose=0; # set to 1 for debugging
my
$dir
=
"
.
";
my
$port
=
8999
;
# just a default
my
$ipv6
;
my
$pid
=
"
.http.pid
";
# name of the pidfile
do
{
if
(
$ARGV
[
0
]
eq
"
-v
")
{
$verbose
=
1
;
...
...
@@ -15,6 +16,10 @@ do {
$dir
=
$ARGV
[
1
];
shift
@ARGV
;
}
elsif
(
$ARGV
[
0
]
eq
"
-p
")
{
$pid
=
$ARGV
[
1
];
shift
@ARGV
;
}
elsif
(
$ARGV
[
0
]
=~
/^(\d+)$/
)
{
$port
=
$
1
;
}
...
...
@@ -23,4 +28,4 @@ do {
}
}
while
(
shift
@ARGV
);
exec
("
server/sws
$ipv6$port
$dir
");
exec
("
server/sws
--pidfile
$pid
$ipv6$port
$dir
");
This diff is collapsed.
Click to expand it.
tests/runtests.pl
+
1
−
2
View file @
dc28a9c0
...
...
@@ -346,7 +346,6 @@ sub runhttpserver {
$nameext
=
"
-ipv6
";
}
$pid
=
checkserver
(
$pidfile
);
# verify if our/any server is running on this port
...
...
@@ -391,7 +390,7 @@ sub runhttpserver {
if
(
$dir
)
{
$flag
.=
"
-d
\"
$dir
\"
";
}
$cmd
=
"
$perl
$srcdir
/httpserver.pl
$flag
$port
$ipv6
&
";
$cmd
=
"
$perl
$srcdir
/httpserver.pl
-p
$pidfile
$flag
$port
$ipv6
&
";
system
(
$cmd
);
if
(
$verbose
)
{
print
"
CMD:
$cmd
\n
";
...
...
This diff is collapsed.
Click to expand it.
tests/server/sws.c
+
12
−
7
View file @
dc28a9c0
...
...
@@ -728,11 +728,12 @@ int main(int argc, char *argv[])
int
sock
,
msgsock
,
flag
;
unsigned
short
port
=
DEFAULT_PORT
;
FILE
*
pidfile
;
char
*
pidname
=
(
char
*
)
".http.pid"
;
struct
httprequest
req
;
int
rc
;
int
arg
=
1
;
if
(
argc
>
1
)
{
int
arg
=
1
;
while
(
argc
>
arg
)
{
if
(
!
strcmp
(
"--version"
,
argv
[
arg
]))
{
printf
(
"sws IPv4%s
\n
"
,
#ifdef ENABLE_IPV6
...
...
@@ -743,20 +744,24 @@ int main(int argc, char *argv[])
);
return
0
;
}
if
(
!
strcmp
(
"--ipv6"
,
argv
[
arg
]))
{
else
if
(
!
strcmp
(
"--pidfile"
,
argv
[
arg
]))
{
arg
++
;
if
(
argc
>
arg
)
pidname
=
argv
[
arg
++
];
}
else
if
(
!
strcmp
(
"--ipv6"
,
argv
[
arg
]))
{
#ifdef ENABLE_IPV6
use_ipv6
=
TRUE
;
#endif
arg
++
;
}
if
(
argc
>
arg
)
{
else
if
(
argc
>
arg
)
{
if
(
atoi
(
argv
[
arg
]))
port
=
(
unsigned
short
)
atoi
(
argv
[
arg
++
]);
if
(
argc
>
arg
)
path
=
argv
[
arg
];
path
=
argv
[
arg
++
];
}
}
...
...
@@ -820,7 +825,7 @@ int main(int argc, char *argv[])
exit
(
1
);
}
pidfile
=
fopen
(
".http.pid"
,
"w"
);
pidfile
=
fopen
(
pidname
,
"w"
);
if
(
pidfile
)
{
fprintf
(
pidfile
,
"%d
\n
"
,
(
int
)
getpid
());
fclose
(
pidfile
);
...
...
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