delete trailing whitespace
This commit is contained in:
parent
dcf7310b2d
commit
da6eea9b38
@ -1,8 +1,8 @@
|
|||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* _ _ ____ _
|
* _ _ ____ _
|
||||||
* Project ___| | | | _ \| |
|
* Project ___| | | | _ \| |
|
||||||
* / __| | | | |_) | |
|
* / __| | | | |_) | |
|
||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||||
*
|
*
|
||||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
* copies of the Software, and permit persons to whom the Software is
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
* furnished to do so, under the terms of the COPYING file.
|
* furnished to do so, under the terms of the COPYING file.
|
||||||
@ -49,7 +49,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||||
/* This define is "almost" required to build on HPUX 11 */
|
/* This define is "almost" required to build on HPUX 11 */
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETDB_H
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
@ -183,7 +183,7 @@ static void logmsg(const char *msg, ...)
|
|||||||
struct tm *curr_time = localtime(&t);
|
struct tm *curr_time = localtime(&t);
|
||||||
char buffer[256]; /* possible overflow if you pass in a huge string */
|
char buffer[256]; /* possible overflow if you pass in a huge string */
|
||||||
FILE *logfp;
|
FILE *logfp;
|
||||||
|
|
||||||
va_start(ap, msg);
|
va_start(ap, msg);
|
||||||
vsprintf(buffer, msg, ap);
|
vsprintf(buffer, msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
@ -270,7 +270,7 @@ int ProcessRequest(struct httprequest *req)
|
|||||||
sprintf(logbuf, "Got a *HUGE* request HTTP/%d.%d",
|
sprintf(logbuf, "Got a *HUGE* request HTTP/%d.%d",
|
||||||
prot_major, prot_minor);
|
prot_major, prot_minor);
|
||||||
logmsg(logbuf);
|
logmsg(logbuf);
|
||||||
|
|
||||||
if(!strncmp("/verifiedserver", ptr, 15)) {
|
if(!strncmp("/verifiedserver", ptr, 15)) {
|
||||||
logmsg("Are-we-friendly question received");
|
logmsg("Are-we-friendly question received");
|
||||||
req->testno = DOCNUMBER_WERULEZ;
|
req->testno = DOCNUMBER_WERULEZ;
|
||||||
@ -306,7 +306,7 @@ int ProcessRequest(struct httprequest *req)
|
|||||||
logmsg("Couldn't open test file %d", req->testno);
|
logmsg("Couldn't open test file %d", req->testno);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *cmd = NULL;
|
char *cmd = NULL;
|
||||||
size_t cmdsize = 0;
|
size_t cmdsize = 0;
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ int ProcessRequest(struct httprequest *req)
|
|||||||
else {
|
else {
|
||||||
if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
|
if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d",
|
||||||
doc, &prot_major, &prot_minor) == 3) {
|
doc, &prot_major, &prot_minor) == 3) {
|
||||||
sprintf(logbuf, "Receiced a CONNECT %s HTTP/%d.%d request",
|
sprintf(logbuf, "Receiced a CONNECT %s HTTP/%d.%d request",
|
||||||
doc, prot_major, prot_minor);
|
doc, prot_major, prot_minor);
|
||||||
logmsg(logbuf);
|
logmsg(logbuf);
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ static int get_request(int sock, struct httprequest *req)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
reqbuf[req->offset]=0;
|
reqbuf[req->offset]=0;
|
||||||
|
|
||||||
/* dump the request to an external file */
|
/* dump the request to an external file */
|
||||||
storerequest(reqbuf);
|
storerequest(reqbuf);
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ static int send_doc(int sock, struct httprequest *req)
|
|||||||
logmsg("Couldn't open test file");
|
logmsg("Couldn't open test file");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* get the custom server control "commands" */
|
/* get the custom server control "commands" */
|
||||||
cmd = (char *)spitout(stream, "reply", "postcmd", &cmdsize);
|
cmd = (char *)spitout(stream, "reply", "postcmd", &cmdsize);
|
||||||
fclose(stream);
|
fclose(stream);
|
||||||
@ -670,23 +670,23 @@ static int send_doc(int sock, struct httprequest *req)
|
|||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||||
static void win32_init(void)
|
static void win32_init(void)
|
||||||
{
|
{
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
int err;
|
int err;
|
||||||
wVersionRequested = MAKEWORD(2, 0);
|
wVersionRequested = MAKEWORD(2, 0);
|
||||||
|
|
||||||
err = WSAStartup(wVersionRequested, &wsaData);
|
err = WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
perror("Winsock init failed");
|
perror("Winsock init failed");
|
||||||
logmsg("Error initialising winsock -- aborting\n");
|
logmsg("Error initialising winsock -- aborting\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( LOBYTE( wsaData.wVersion ) != 2 ||
|
if ( LOBYTE( wsaData.wVersion ) != 2 ||
|
||||||
HIBYTE( wsaData.wVersion ) != 0 ) {
|
HIBYTE( wsaData.wVersion ) != 0 ) {
|
||||||
|
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
perror("Winsock init failed");
|
perror("Winsock init failed");
|
||||||
logmsg("No suitable winsock.dll found -- aborting\n");
|
logmsg("No suitable winsock.dll found -- aborting\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -705,7 +705,7 @@ int main(int argc, char *argv[])
|
|||||||
unsigned short port = DEFAULT_PORT;
|
unsigned short port = DEFAULT_PORT;
|
||||||
FILE *pidfile;
|
FILE *pidfile;
|
||||||
struct httprequest req;
|
struct httprequest req;
|
||||||
|
|
||||||
if(argc>1) {
|
if(argc>1) {
|
||||||
port = (unsigned short)atoi(argv[1]);
|
port = (unsigned short)atoi(argv[1]);
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ int main(int argc, char *argv[])
|
|||||||
path = argv[2];
|
path = argv[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
win32_init();
|
win32_init();
|
||||||
atexit(win32_cleanup);
|
atexit(win32_cleanup);
|
||||||
@ -765,10 +765,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
msgsock = accept(sock, NULL, NULL);
|
msgsock = accept(sock, NULL, NULL);
|
||||||
|
|
||||||
if (msgsock == -1)
|
if (msgsock == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
logmsg("** New client connected");
|
logmsg("** New client connected");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -807,9 +807,9 @@ int main(int argc, char *argv[])
|
|||||||
if (req.testno == DOCNUMBER_QUIT)
|
if (req.testno == DOCNUMBER_QUIT)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sclose(sock);
|
sclose(sock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user