mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
moved test2file() to util.c
This commit is contained in:
parent
97a6d7b1a8
commit
9542dfdcdc
@ -105,8 +105,6 @@ const char *serverlogfile = DEFAULT_LOGFILE;
|
|||||||
#define REQUEST_DUMP "log/server.input"
|
#define REQUEST_DUMP "log/server.input"
|
||||||
#define RESPONSE_DUMP "log/server.response"
|
#define RESPONSE_DUMP "log/server.response"
|
||||||
|
|
||||||
#define TEST_DATA_PATH "%s/data/test%ld"
|
|
||||||
|
|
||||||
/* very-big-path support */
|
/* very-big-path support */
|
||||||
#define MAXDOCNAMELEN 140000
|
#define MAXDOCNAMELEN 140000
|
||||||
#define MAXDOCNAMELEN_TXT "139999"
|
#define MAXDOCNAMELEN_TXT "139999"
|
||||||
@ -117,9 +115,6 @@ const char *serverlogfile = DEFAULT_LOGFILE;
|
|||||||
|
|
||||||
#define END_OF_HEADERS "\r\n\r\n"
|
#define END_OF_HEADERS "\r\n\r\n"
|
||||||
|
|
||||||
/* global variable, where to find the 'data' dir */
|
|
||||||
const char *path=".";
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DOCNUMBER_NOTHING = -7,
|
DOCNUMBER_NOTHING = -7,
|
||||||
DOCNUMBER_QUIT = -6,
|
DOCNUMBER_QUIT = -6,
|
||||||
@ -169,14 +164,6 @@ static void sigpipe_handler(int sig)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *test2file(long testno)
|
|
||||||
{
|
|
||||||
static char filename[256];
|
|
||||||
sprintf(filename, TEST_DATA_PATH, path, testno);
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int ProcessRequest(struct httprequest *req)
|
int ProcessRequest(struct httprequest *req)
|
||||||
{
|
{
|
||||||
char *line=req->reqbuf;
|
char *line=req->reqbuf;
|
||||||
@ -642,7 +629,8 @@ int main(int argc, char *argv[])
|
|||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct sockaddr_in6 me6;
|
struct sockaddr_in6 me6;
|
||||||
#endif /* ENABLE_IPV6 */
|
#endif /* ENABLE_IPV6 */
|
||||||
int sock, msgsock, flag;
|
curl_socket_t sock, msgsock;
|
||||||
|
int flag;
|
||||||
unsigned short port = DEFAULT_PORT;
|
unsigned short port = DEFAULT_PORT;
|
||||||
FILE *pidfile;
|
FILE *pidfile;
|
||||||
char *pidname= (char *)".http.pid";
|
char *pidname= (char *)".http.pid";
|
||||||
|
@ -144,3 +144,13 @@ void win32_cleanup(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* set by the main code to point to where the test dir is */
|
||||||
|
const char *path=".";
|
||||||
|
|
||||||
|
char *test2file(long testno)
|
||||||
|
{
|
||||||
|
static char filename[256];
|
||||||
|
snprintf(filename, sizeof(filename), TEST_DATA_PATH, path, testno);
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,11 @@ void logmsg(const char *msg, ...);
|
|||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TEST_DATA_PATH "%s/data/test%ld"
|
||||||
|
|
||||||
|
/* global variable, where to find the 'data' dir */
|
||||||
|
extern const char *path;
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
@ -60,3 +65,6 @@ const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
|
|||||||
|
|
||||||
void win32_init(void);
|
void win32_init(void);
|
||||||
void win32_cleanup(void);
|
void win32_cleanup(void);
|
||||||
|
|
||||||
|
/* returns the path name to the test case file */
|
||||||
|
char *test2file(long testno);
|
||||||
|
Loading…
Reference in New Issue
Block a user