summaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-09-09 23:09:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-09-11 09:29:50 +0200
commit6b84438d9a9220fb75cbaae9d6fe6c3edb6d425e (patch)
tree109c29611f5bd2dbedab015b45524e8ffe6e1057 /tests/server
parente155f38d1eaa89cc8ce2a6536b74be2954506bb0 (diff)
downloadcurl-6b84438d9a9220fb75cbaae9d6fe6c3edb6d425e.tar.gz
code style: use spaces around equals signs
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/fake_ntlm.c10
-rw-r--r--tests/server/resolve.c6
-rw-r--r--tests/server/rtspd.c36
-rw-r--r--tests/server/sockfilt.c16
-rw-r--r--tests/server/sws.c44
-rw-r--r--tests/server/tftpd.c12
-rw-r--r--tests/server/util.c8
7 files changed, 66 insertions, 66 deletions
diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c
index 0d1b3e1b6..2d547ffae 100644
--- a/tests/server/fake_ntlm.c
+++ b/tests/server/fake_ntlm.c
@@ -78,7 +78,7 @@ static char *printable(char *inbuf, size_t inlength)
return outbuf;
}
- for(i=0; i<inlength; i++) {
+ for(i = 0; i<inlength; i++) {
if(o > outsize - (HEX_STR_LEN + 1)) {
newsize = outsize + outincr;
@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
}
filename = test2file(testnum);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
}
}
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
while(fgets(buf, sizeof(buf), stdin)) {
if(strcmp(buf, type1_input) == 0) {
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
fflush(stdout);
}
else if(strncmp(buf, type3_input, strlen(type3_input)) == 0) {
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
diff --git a/tests/server/resolve.c b/tests/server/resolve.c
index 34f14e066..4cbdba6ec 100644
--- a/tests/server/resolve.c
+++ b/tests/server/resolve.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, 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
@@ -57,11 +57,11 @@
static bool use_ipv6 = FALSE;
static const char *ipv_inuse = "IPv4";
-const char *serverlogfile=""; /* for a util.c function we don't use */
+const char *serverlogfile = ""; /* for a util.c function we don't use */
int main(int argc, char *argv[])
{
- int arg=1;
+ int arg = 1;
const char *host = NULL;
int rc = 0;
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
index 120d65d52..8f004e120 100644
--- a/tests/server/rtspd.c
+++ b/tests/server/rtspd.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, 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
@@ -70,11 +70,11 @@ static int serverlogslocked = 0;
#define REQBUFSIZ 150000
#define REQBUFSIZ_TXT "149999"
-static long prevtestno=-1; /* previous test number we served */
-static long prevpartno=-1; /* previous part number we served */
-static bool prevbounce=FALSE; /* instructs the server to increase the part
- number for a test in case the identical
- testno+partno request shows up again */
+static long prevtestno = -1; /* previous test number we served */
+static long prevpartno = -1; /* previous part number we served */
+static bool prevbounce = FALSE; /* instructs the server to increase the part
+ number for a test in case the identical
+ testno+partno request shows up again */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
@@ -156,7 +156,7 @@ enum {
DOCNUMBER_NOTHING = -7,
DOCNUMBER_QUIT = -6,
DOCNUMBER_BADCONNECT = -5,
- DOCNUMBER_INTERNAL= -4,
+ DOCNUMBER_INTERNAL = -4,
DOCNUMBER_CONNECT = -3,
DOCNUMBER_WERULEZ = -2,
DOCNUMBER_404 = -1
@@ -332,7 +332,7 @@ static void restore_signal_handlers(void)
static int ProcessRequest(struct httprequest *req)
{
- char *line=&req->reqbuf[req->checkindex];
+ char *line = &req->reqbuf[req->checkindex];
bool chunked = FALSE;
static char request[REQUEST_KEYWORD_SIZE];
static char doc[MAXDOCNAMELEN];
@@ -421,7 +421,7 @@ static int ProcessRequest(struct httprequest *req)
filename = test2file(req->testno);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -433,7 +433,7 @@ static int ProcessRequest(struct httprequest *req)
else {
char *cmd = NULL;
size_t cmdsize = 0;
- int num=0;
+ int num = 0;
int rtp_channel = 0;
int rtp_size = 0;
@@ -596,7 +596,7 @@ static int ProcessRequest(struct httprequest *req)
if(got_exit_signal)
return 1; /* done */
- if((req->cl==0) && strncasecompare("Content-Length:", line, 15)) {
+ if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) {
/* If we don't ignore content-length, we read it and we read the whole
request including the body before we return. If we've been told to
ignore the content-length, we will return as soon as all headers
@@ -896,10 +896,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
ssize_t written;
size_t count;
const char *buffer;
- char *ptr=NULL;
+ char *ptr = NULL;
FILE *stream;
- char *cmd=NULL;
- size_t cmdsize=0;
+ char *cmd = NULL;
+ size_t cmdsize = 0;
FILE *dump;
bool persistant = TRUE;
bool sendfailure = FALSE;
@@ -988,7 +988,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
if(0 != req->partno)
snprintf(partbuf, sizeof(partbuf), "data%ld", req->partno);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -1012,7 +1012,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
}
/* re-open the same file again */
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -1140,7 +1140,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
char command[32];
int quarters;
int num;
- ptr=cmd;
+ ptr = cmd;
do {
if(2 == sscanf(ptr, "%31s %d", command, &num)) {
if(!strcmp("wait", command)) {
@@ -1194,7 +1194,7 @@ int main(int argc, char *argv[])
struct httprequest req;
int rc;
int error;
- int arg=1;
+ int arg = 1;
long pid;
memset(&req, 0, sizeof(req));
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 6695d8486..f13ef208d 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2017, 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
@@ -478,26 +478,26 @@ static void lograw(unsigned char *buffer, ssize_t len)
ssize_t i;
unsigned char *ptr = buffer;
char *optr = data;
- ssize_t width=0;
+ ssize_t width = 0;
int left = sizeof(data);
- for(i=0; i<len; i++) {
+ for(i = 0; i<len; i++) {
switch(ptr[i]) {
case '\n':
snprintf(optr, left, "\\n");
width += 2;
optr += 2;
- left-=2;
+ left -= 2;
break;
case '\r':
snprintf(optr, left, "\\r");
width += 2;
optr += 2;
- left-=2;
+ left -= 2;
break;
default:
snprintf(optr, left, "%c", (ISGRAPH(ptr[i]) ||
- ptr[i]==0x20) ?ptr[i]:'.');
+ ptr[i] == 0x20) ?ptr[i]:'.');
width++;
optr++;
left--;
@@ -1200,7 +1200,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
int rc;
int totdelay = 0;
int maxretr = 10;
- int delay= 20;
+ int delay = 20;
int attempt = 0;
int error = 0;
@@ -1343,7 +1343,7 @@ int main(int argc, char *argv[])
bool juggle_again;
int rc;
int error;
- int arg=1;
+ int arg = 1;
enum sockmode mode = PASSIVE_LISTEN; /* default */
const char *addr = NULL;
diff --git a/tests/server/sws.c b/tests/server/sws.c
index bff30f212..5fcd6732b 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -81,11 +81,11 @@ static bool is_proxy = FALSE;
#define REQBUFSIZ 150000
#define REQBUFSIZ_TXT "149999"
-static long prevtestno=-1; /* previous test number we served */
-static long prevpartno=-1; /* previous part number we served */
-static bool prevbounce=FALSE; /* instructs the server to increase the part
- number for a test in case the identical
- testno+partno request shows up again */
+static long prevtestno = -1; /* previous test number we served */
+static long prevpartno = -1; /* previous part number we served */
+static bool prevbounce = FALSE; /* instructs the server to increase the part
+ number for a test in case the identical
+ testno+partno request shows up again */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
@@ -359,7 +359,7 @@ static int parse_servercmd(struct httprequest *req)
filename = test2file(req->testno);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -372,7 +372,7 @@ static int parse_servercmd(struct httprequest *req)
char *orgcmd = NULL;
char *cmd = NULL;
size_t cmdsize = 0;
- int num=0;
+ int num = 0;
/* get the custom server control "commands" */
error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream);
@@ -456,7 +456,7 @@ static int parse_servercmd(struct httprequest *req)
static int ProcessRequest(struct httprequest *req)
{
- char *line=&req->reqbuf[req->checkindex];
+ char *line = &req->reqbuf[req->checkindex];
bool chunked = FALSE;
static char request[REQUEST_KEYWORD_SIZE];
static char doc[MAXDOCNAMELEN];
@@ -552,7 +552,7 @@ static int ProcessRequest(struct httprequest *req)
if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
doc, &prot_major, &prot_minor) == 3) {
char *portp = NULL;
- unsigned long part=0;
+ unsigned long part = 0;
snprintf(logbuf, sizeof(logbuf),
"Received a CONNECT %s HTTP/%d.%d request",
@@ -711,7 +711,7 @@ static int ProcessRequest(struct httprequest *req)
if(got_exit_signal)
return 1; /* done */
- if((req->cl==0) && strncasecompare("Content-Length:", line, 15)) {
+ if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) {
/* If we don't ignore content-length, we read it and we read the whole
request including the body before we return. If we've been told to
ignore the content-length, we will return as soon as all headers
@@ -858,7 +858,7 @@ static void storerequest(const char *reqbuf, size_t totalsize)
size_t written;
size_t writeleft;
FILE *dump;
- const char *dumpfile=is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP;
+ const char *dumpfile = is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP;
if(reqbuf == NULL)
return;
@@ -1044,10 +1044,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
ssize_t written;
size_t count;
const char *buffer;
- char *ptr=NULL;
+ char *ptr = NULL;
FILE *stream;
- char *cmd=NULL;
- size_t cmdsize=0;
+ char *cmd = NULL;
+ size_t cmdsize = 0;
FILE *dump;
bool persistant = TRUE;
bool sendfailure = FALSE;
@@ -1118,7 +1118,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
/* select the <data> tag for "normal" requests and the <connect> one
for CONNECT requests (within the <reply> section) */
- const char *section= req->connect_request?"connect":"data";
+ const char *section = req->connect_request?"connect":"data";
if(req->partno)
snprintf(partbuf, sizeof(partbuf), "%s%ld", section, req->partno);
@@ -1127,7 +1127,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
logmsg("Send response test%ld section <%s>", req->testno, partbuf);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -1150,7 +1150,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
}
/* re-open the same file again */
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -1266,7 +1266,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
char command[32];
int quarters;
int num;
- ptr=cmd;
+ ptr = cmd;
do {
if(2 == sscanf(ptr, "%31s %d", command, &num)) {
if(!strcmp("wait", command)) {
@@ -1436,7 +1436,7 @@ static void http_connect(curl_socket_t *infdp,
int max_tunnel_idx; /* CTRL or DATA */
int loop;
int i;
- int timeout_count=0;
+ int timeout_count = 0;
/* primary tunnel client endpoint already connected */
clientfd[CTRL] = *infdp;
@@ -1526,7 +1526,7 @@ static void http_connect(curl_socket_t *infdp,
if(rc > 0) {
/* socket action */
bool tcp_fin_wr;
- timeout_count=0;
+ timeout_count = 0;
if(got_exit_signal)
break;
@@ -1974,7 +1974,7 @@ int main(int argc, char *argv[])
struct httprequest req;
int rc = 0;
int error;
- int arg=1;
+ int arg = 1;
long pid;
const char *connecthost = "127.0.0.1";
const char *socket_type = "IPv4";
@@ -2319,7 +2319,7 @@ int main(int argc, char *argv[])
logmsg("====> Client disconnect %d", req.connmon);
if(req.connmon) {
- const char *keepopen="[DISCONNECT]\n";
+ const char *keepopen = "[DISCONNECT]\n";
storerequest(keepopen, strlen(keepopen));
}
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index df01eb782..1932ea411 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -515,7 +515,7 @@ static void read_ahead(struct testcase *test,
}
else {
if(test->rcount) {
- c=test->rptr[0];
+ c = test->rptr[0];
test->rptr++;
test->rcount--;
}
@@ -571,9 +571,9 @@ static ssize_t write_behind(struct testcase *test, int convert)
char outfile[256];
snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno);
#ifdef WIN32
- test->ofile=open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777);
+ test->ofile = open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777);
#else
- test->ofile=open(outfile, O_CREAT|O_RDWR, 0777);
+ test->ofile = open(outfile, O_CREAT|O_RDWR, 0777);
#endif
if(test->ofile == -1) {
logmsg("Couldn't create and/or open file %s for upload!", outfile);
@@ -1074,7 +1074,7 @@ static int parse_servercmd(struct testcase *req)
filename = test2file(req->testno);
- stream=fopen(filename, "rb");
+ stream = fopen(filename, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
@@ -1086,7 +1086,7 @@ static int parse_servercmd(struct testcase *req)
char *orgcmd = NULL;
char *cmd = NULL;
size_t cmdsize = 0;
- int num=0;
+ int num = 0;
/* get the custom server control "commands" */
error = getpart(&orgcmd, &cmdsize, "reply", "servercmd", stream);
@@ -1192,7 +1192,7 @@ static int validate_access(struct testcase *test,
snprintf(partbuf, sizeof(partbuf), "data%ld", partno);
if(file) {
- FILE *stream=fopen(file, "rb");
+ FILE *stream = fopen(file, "rb");
if(!stream) {
error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
diff --git a/tests/server/util.c b/tests/server/util.c
index 42e585349..1bbd89a3c 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -81,15 +81,15 @@ char *data_to_hex(char *data, size_t len)
if(len > 255)
len = 255;
- for(i=0; i < len; i++) {
+ for(i = 0; i < len; i++) {
if((data[i] >= 0x20) && (data[i] < 0x7f))
*optr++ = *iptr++;
else {
snprintf(optr, 4, "%%%02x", *iptr++);
- optr+=3;
+ optr += 3;
}
}
- *optr=0; /* in case no sprintf was used */
+ *optr = 0; /* in case no sprintf was used */
return buf;
}
@@ -189,7 +189,7 @@ void win32_cleanup(void)
#endif /* USE_WINSOCK */
/* set by the main code to point to where the test dir is */
-const char *path=".";
+const char *path = ".";
char *test2file(long testno)
{