summaryrefslogtreecommitdiff
path: root/tests/server/rtspd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/server/rtspd.c')
-rw-r--r--tests/server/rtspd.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
index 8e61a43f3..4519eab60 100644
--- a/tests/server/rtspd.c
+++ b/tests/server/rtspd.c
@@ -340,11 +340,8 @@ static int ProcessRequest(struct httprequest *req)
static char request[REQUEST_KEYWORD_SIZE];
static char doc[MAXDOCNAMELEN];
static char prot_str[5];
- char logbuf[256];
int prot_major, prot_minor;
- char *end;
- int error;
- end = strstr(line, END_OF_HEADERS);
+ char *end = strstr(line, END_OF_HEADERS);
logmsg("ProcessRequest() called with testno %ld and line [%s]",
req->testno, line);
@@ -360,6 +357,7 @@ static int ProcessRequest(struct httprequest *req)
&prot_major,
&prot_minor) == 5) {
char *ptr;
+ char logbuf[256];
if(!strcmp(prot_str, "HTTP")) {
req->protocol = RPROT_HTTP;
@@ -426,7 +424,7 @@ static int ProcessRequest(struct httprequest *req)
stream = fopen(filename, "rb");
if(!stream) {
- error = errno;
+ int error = errno;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
logmsg("Error opening file: %s", filename);
logmsg("Couldn't open test file %ld", req->testno);
@@ -441,11 +439,10 @@ static int ProcessRequest(struct httprequest *req)
int rtp_channel = 0;
int rtp_size = 0;
int rtp_partno = -1;
- int i = 0;
char *rtp_scratch = NULL;
/* get the custom server control "commands" */
- error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream);
+ int error = getpart(&cmd, &cmdsize, "reply", "servercmd", stream);
fclose(stream);
if(error) {
logmsg("getpart() failed with error: %d", error);
@@ -486,6 +483,7 @@ static int ProcessRequest(struct httprequest *req)
&rtp_partno, &rtp_channel, &rtp_size)) {
if(rtp_partno == req->partno) {
+ int i = 0;
logmsg("RTP: part %d channel %d size %d",
rtp_partno, rtp_channel, rtp_size);
@@ -900,11 +898,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
size_t count;
const char *buffer;
char *ptr = NULL;
- FILE *stream;
char *cmd = NULL;
size_t cmdsize = 0;
FILE *dump;
- bool persistant = TRUE;
+ bool persistent = TRUE;
bool sendfailure = FALSE;
size_t responsesize;
int error = 0;
@@ -912,8 +909,6 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
static char weare[256];
- char partbuf[80]="data";
-
logmsg("Send response number %ld part %ld", req->testno, req->partno);
switch(req->rcmd) {
@@ -987,7 +982,8 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
}
else {
char *filename = test2file(req->testno);
-
+ char partbuf[80]="data";
+ FILE *stream;
if(0 != req->partno)
snprintf(partbuf, sizeof(partbuf), "data%ld", req->partno);
@@ -1046,7 +1042,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
connection will be closed after the data has been sent to the requesting
client... */
if(strstr(buffer, "swsclose") || !count) {
- persistant = FALSE;
+ persistent = FALSE;
logmsg("connection close instruction \"swsclose\" found in response");
}
if(strstr(buffer, "swsbounce")) {
@@ -1176,7 +1172,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
} while(ptr && *ptr);
}
free(cmd);
- req->open = persistant;
+ req->open = persistent;
prevtestno = req->testno;
prevpartno = req->partno;
@@ -1430,7 +1426,7 @@ int main(int argc, char *argv[])
}
if(req.open)
- logmsg("=> persistant connection request ended, awaits new request");
+ logmsg("=> persistent connection request ended, awaits new request");
/* if we got a CONNECT, loop and get another request as well! */
} while(req.open || (req.testno == DOCNUMBER_CONNECT));