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
fecb67b2
Commit
fecb67b2
authored
17 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
Use a long int data type to handle getpid() result
parent
2c095620
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/server/sockfilt.c
+4
-4
4 additions, 4 deletions
tests/server/sockfilt.c
tests/server/sws.c
+4
-2
4 additions, 2 deletions
tests/server/sws.c
tests/server/tftpd.c
+7
-2
7 additions, 2 deletions
tests/server/tftpd.c
with
15 additions
and
8 deletions
tests/server/sockfilt.c
+
4
−
4
View file @
fecb67b2
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 200
7
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 200
8
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
...
...
@@ -671,10 +671,10 @@ int main(int argc, char *argv[])
pidfile
=
fopen
(
pidname
,
"w"
);
if
(
pidfile
)
{
int
pid
=
(
int
)
getpid
();
fprintf
(
pidfile
,
"%d
\n
"
,
pid
);
long
pid
=
(
long
)
getpid
();
fprintf
(
pidfile
,
"%
l
d
\n
"
,
pid
);
fclose
(
pidfile
);
logmsg
(
"Wrote pid %d to %s"
,
pid
,
pidname
);
logmsg
(
"Wrote pid %
l
d to %s"
,
pid
,
pidname
);
}
else
{
error
=
ERRNO
;
...
...
This diff is collapsed.
Click to expand it.
tests/server/sws.c
+
4
−
2
View file @
fecb67b2
...
...
@@ -670,7 +670,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
case
DOCNUMBER_WERULEZ
:
/* we got a "friends?" question, reply back that we sure are */
logmsg
(
"Identifying ourselves as friends"
);
sprintf
(
msgbuf
,
"WE ROOLZ: %d
\r\n
"
,
(
int
)
getpid
());
sprintf
(
msgbuf
,
"WE ROOLZ: %
l
d
\r\n
"
,
(
long
)
getpid
());
msglen
=
strlen
(
msgbuf
);
sprintf
(
weare
,
"HTTP/1.1 200 OK
\r\n
Content-Length: %d
\r\n\r\n
%s"
,
msglen
,
msgbuf
);
...
...
@@ -948,8 +948,10 @@ int main(int argc, char *argv[])
pidfile
=
fopen
(
pidname
,
"w"
);
if
(
pidfile
)
{
fprintf
(
pidfile
,
"%d
\n
"
,
(
int
)
getpid
());
long
pid
=
(
long
)
getpid
();
fprintf
(
pidfile
,
"%ld
\n
"
,
pid
);
fclose
(
pidfile
);
logmsg
(
"Wrote pid %ld to %s"
,
pid
,
pidname
);
}
else
{
error
=
ERRNO
;
...
...
This diff is collapsed.
Click to expand it.
tests/server/tftpd.c
+
7
−
2
View file @
fecb67b2
...
...
@@ -505,19 +505,24 @@ int main(int argc, char **argv)
if
(
rc
<
0
)
{
perror
(
"binding stream socket"
);
logmsg
(
"Error binding socket"
);
sclose
(
sock
);
return
1
;
}
pidfile
=
fopen
(
pidname
,
"w"
);
if
(
pidfile
)
{
fprintf
(
pidfile
,
"%d
\n
"
,
(
int
)
getpid
());
long
pid
=
(
long
)
getpid
();
fprintf
(
pidfile
,
"%ld
\n
"
,
pid
);
fclose
(
pidfile
);
logmsg
(
"Wrote pid %ld to %s"
,
pid
,
pidname
);
}
else
{
error
=
ERRNO
;
logmsg
(
"fopen() failed with error: %d %s"
,
error
,
strerror
(
error
));
logmsg
(
"Error opening file: %s"
,
pidname
);
logmsg
(
"Couldn't write pid file"
);
sclose
(
sock
);
return
1
;
}
logmsg
(
"Running IPv%d version on port UDP/%d"
,
...
...
@@ -662,7 +667,7 @@ static int validate_access(struct testcase *test,
if
(
!
strncmp
(
"verifiedserver"
,
filename
,
15
))
{
char
weare
[
128
];
size_t
count
=
sprintf
(
weare
,
"WE ROOLZ: %d
\r\n
"
,
(
int
)
getpid
());
size_t
count
=
sprintf
(
weare
,
"WE ROOLZ: %
l
d
\r\n
"
,
(
long
)
getpid
());
logmsg
(
"Are-we-friendly question received"
);
test
->
buffer
=
strdup
(
weare
);
...
...
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