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
c7a4df16
Commit
c7a4df16
authored
14 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
sws: allow multiple commands in <servercmd>
parent
bcf50283
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/server/sws.c
+26
-7
26 additions, 7 deletions
tests/server/sws.c
with
26 additions
and
7 deletions
tests/server/sws.c
+
26
−
7
View file @
c7a4df16
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 201
0
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 201
1
, 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
...
...
@@ -397,12 +397,13 @@ static int ProcessRequest(struct httprequest *req)
return
1
;
/* done */
}
else
{
char
*
orgcmd
=
NULL
;
char
*
cmd
=
NULL
;
size_t
cmdsize
=
0
;
int
num
=
0
;
/* get the custom server control "commands" */
error
=
getpart
(
&
cmd
,
&
cmdsize
,
"reply"
,
"servercmd"
,
stream
);
error
=
getpart
(
&
org
cmd
,
&
cmdsize
,
"reply"
,
"servercmd"
,
stream
);
fclose
(
stream
);
if
(
error
)
{
logmsg
(
"getpart() failed with error: %d"
,
error
);
...
...
@@ -410,8 +411,9 @@ static int ProcessRequest(struct httprequest *req)
return
1
;
/* done */
}
if
(
cmdsize
)
{
logmsg
(
"Found a reply-servercmd section!"
);
cmd
=
orgcmd
;
while
(
cmd
&&
cmdsize
)
{
char
*
check
;
if
(
!
strncmp
(
CMD_AUTH_REQUIRED
,
cmd
,
strlen
(
CMD_AUTH_REQUIRED
)))
{
logmsg
(
"instructed to require authorization header"
);
...
...
@@ -445,9 +447,26 @@ static int ProcessRequest(struct httprequest *req)
else
{
logmsg
(
"funny instruction found: %s"
,
cmd
);
}
/* try to deal with CRLF or just LF */
check
=
strchr
(
cmd
,
'\r'
);
if
(
!
check
)
check
=
strchr
(
cmd
,
'\n'
);
if
(
check
)
{
/* get to the letter following the newline */
while
((
*
check
==
'\r'
)
||
(
*
check
==
'\n'
))
check
++
;
if
(
!*
check
)
/* if we reached a zero, get out */
break
;
cmd
=
check
;
}
if
(
cmd
)
free
(
cmd
);
else
break
;
}
if
(
orgcmd
)
free
(
orgcmd
);
}
}
else
{
...
...
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