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
c29740f0
Commit
c29740f0
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
portability fix by using setup.h from the lib directory
parent
1a4fddb9
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/server/Makefile.am
+2
-0
2 additions, 0 deletions
tests/server/Makefile.am
tests/server/sws.c
+8
-7
8 additions, 7 deletions
tests/server/sws.c
with
10 additions
and
7 deletions
tests/server/Makefile.am
+
2
−
0
View file @
c29740f0
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
AUTOMAKE_OPTIONS
=
foreign
AUTOMAKE_OPTIONS
=
foreign
INCLUDES
=
-I
$(
top_srcdir
)
/lib
noinst_PROGRAMS
=
sws
noinst_PROGRAMS
=
sws
sws_SOURCES
=
sws.c getpart.c
sws_SOURCES
=
sws.c getpart.c
...
...
This diff is collapsed.
Click to expand it.
tests/server/sws.c
+
8
−
7
View file @
c29740f0
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
Wilke. Thanks a bunch!
Wilke. Thanks a bunch!
*/
*/
#include
"setup.h"
/* portability help from the lib directory */
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdlib.h>
...
@@ -64,7 +65,7 @@ spitout(FILE *stream,
...
@@ -64,7 +65,7 @@ spitout(FILE *stream,
#define DEFAULT_LOGFILE "log/sws.log"
#define DEFAULT_LOGFILE "log/sws.log"
#endif
#endif
#define VERSION "cURL test suite HTTP server/0.1"
#define
SWS
VERSION "cURL test suite HTTP server/0.1"
#define REQUEST_DUMP "log/server.input"
#define REQUEST_DUMP "log/server.input"
#define RESPONSE_DUMP "log/server.response"
#define RESPONSE_DUMP "log/server.response"
...
@@ -98,7 +99,7 @@ static const char *docbadconnect =
...
@@ -98,7 +99,7 @@ static const char *docbadconnect =
/* send back this on 404 file not found */
/* send back this on 404 file not found */
static
const
char
*
doc404
=
"HTTP/1.1 404 Not Found
\n
"
static
const
char
*
doc404
=
"HTTP/1.1 404 Not Found
\n
"
"Server: "
VERSION
"
\n
"
"Server: "
SWS
VERSION
"
\n
"
"Connection: close
\n
"
"Connection: close
\n
"
"Content-Type: text/html
\n
"
"Content-Type: text/html
\n
"
"
\n
"
"
\n
"
...
@@ -108,7 +109,7 @@ static const char *doc404 = "HTTP/1.1 404 Not Found\n"
...
@@ -108,7 +109,7 @@ static const char *doc404 = "HTTP/1.1 404 Not Found\n"
"</HEAD><BODY>
\n
"
"</HEAD><BODY>
\n
"
"<H1>Not Found</H1>
\n
"
"<H1>Not Found</H1>
\n
"
"The requested URL was not found on this server.
\n
"
"The requested URL was not found on this server.
\n
"
"<P><HR><ADDRESS>"
VERSION
"</ADDRESS>
\n
"
"</BODY></HTML>
\n
"
;
"<P><HR><ADDRESS>"
SWS
VERSION
"</ADDRESS>
\n
"
"</BODY></HTML>
\n
"
;
#ifdef HAVE_SIGNAL
#ifdef HAVE_SIGNAL
static
volatile
int
sigpipe
;
static
volatile
int
sigpipe
;
...
@@ -241,7 +242,7 @@ static int get_request(int sock, int *part, int *open)
...
@@ -241,7 +242,7 @@ static int get_request(int sock, int *part, int *open)
*
open
=
TRUE
;
/* connection should remain open and wait for more commands */
*
open
=
TRUE
;
/* connection should remain open and wait for more commands */
while
(
offset
<
REQBUFSIZ
)
{
while
(
offset
<
REQBUFSIZ
)
{
int
got
=
re
cv
(
sock
,
reqbuf
+
offset
,
REQBUFSIZ
-
offset
,
0
);
int
got
=
s
re
ad
(
sock
,
reqbuf
+
offset
,
REQBUFSIZ
-
offset
);
if
(
got
<=
0
)
{
if
(
got
<=
0
)
{
if
(
got
<
0
)
{
if
(
got
<
0
)
{
perror
(
"recv"
);
perror
(
"recv"
);
...
@@ -471,7 +472,7 @@ static int send_doc(int sock,
...
@@ -471,7 +472,7 @@ static int send_doc(int sock,
}
}
do
{
do
{
written
=
s
end
(
sock
,
buffer
,
count
,
0
);
written
=
s
write
(
sock
,
buffer
,
count
);
if
(
written
<
0
)
{
if
(
written
<
0
)
{
logmsg
(
"Sending response failed and we bailed out!"
);
logmsg
(
"Sending response failed and we bailed out!"
);
return
-
1
;
return
-
1
;
...
@@ -609,13 +610,13 @@ int main(int argc, char *argv[])
...
@@ -609,13 +610,13 @@ int main(int argc, char *argv[])
}
while
(
open
||
(
doc
==
DOCNUMBER_CONNECT
));
}
while
(
open
||
(
doc
==
DOCNUMBER_CONNECT
));
logmsg
(
"Closing client connection"
);
logmsg
(
"Closing client connection"
);
close
(
msgsock
);
s
close
(
msgsock
);
if
(
doc
==
DOCNUMBER_QUIT
)
if
(
doc
==
DOCNUMBER_QUIT
)
break
;
break
;
}
}
close
(
sock
);
s
close
(
sock
);
fclose
(
logfp
);
fclose
(
logfp
);
return
0
;
return
0
;
...
...
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