Import civetweb ans jsoncpp
This commit is contained in:
119
3P/civetweb/testutils/Browser/Browser.cpp
Normal file
119
3P/civetweb/testutils/Browser/Browser.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
// To build the source, set your drive letter Q: to the Qt SDK root,
|
||||
// e.g., use "subst q: C:\QtSDK\Desktop\Qt\4.8.0\msvc2010" on the cmd line.
|
||||
// This minimal source is derived from http://trac.webkit.org/wiki/QtWebKitTiling,
|
||||
// for an example with more features see http://doc.qt.nokia.com/qt-maemo/maemo5-graphicswebview.html
|
||||
|
||||
|
||||
#include <QApplication.h>
|
||||
#include <QGraphicsScene>
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsWebView>
|
||||
#include <QWebSettings>
|
||||
#include <QNetworkProxy>
|
||||
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
const char * DEFAULT_URL = "http://localhost/";
|
||||
const char * DEFAULT_SIZE = "550x720";
|
||||
const char * DEFAULT_PROXY = 0;
|
||||
|
||||
|
||||
static void ShowUsage(const char * exeName) {
|
||||
|
||||
const char * name = "";
|
||||
if (exeName) {
|
||||
name = strrchr(exeName, '\\');
|
||||
if (name) {
|
||||
name++;
|
||||
} else {
|
||||
name = exeName;
|
||||
}
|
||||
}
|
||||
|
||||
std::string msg = "Usage:\n";
|
||||
msg += " " + std::string(name) + " [-w###x###] [url]\n";
|
||||
msg += " " + std::string(name) + " -h\n\n";
|
||||
msg += "Use -w###x### to specify the window size\n";
|
||||
MessageBoxA(NULL, msg.c_str(), name, MB_ICONINFORMATION);
|
||||
}
|
||||
|
||||
|
||||
class BGraphicsWebView : public QGraphicsWebView {
|
||||
public:
|
||||
bool loadFinished(bool);
|
||||
};
|
||||
|
||||
|
||||
bool BGraphicsWebView::loadFinished(bool) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
const char * url = DEFAULT_URL;
|
||||
const char * size = DEFAULT_SIZE;
|
||||
const char * proxy = DEFAULT_PROXY;
|
||||
|
||||
for (int i = 1; i<argc; i++) {
|
||||
if (argv[i][0]=='/' || argv[i][0]=='-') {
|
||||
if (argv[i][1]=='h' || argv[i][1]=='H' || argv[i][1]=='?') {
|
||||
ShowUsage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
else if ((argv[i][1]=='w') || (argv[i][1]=='W')) {
|
||||
if ((argv[i][2]!=0) && (strchr(argv[1],'x')!=0) && (size==DEFAULT_SIZE)) {
|
||||
size = argv[i]+2;
|
||||
}
|
||||
}
|
||||
else if ((argv[i][1]=='p') || (argv[i][1]=='P')) {
|
||||
proxy = argv[i]+2;
|
||||
}
|
||||
else {
|
||||
ShowUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (url==DEFAULT_URL) {
|
||||
url = argv[i];
|
||||
} else {
|
||||
ShowUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QApplication app(argc, argv);
|
||||
if (proxy) {
|
||||
QUrl proxyUrl = proxy;
|
||||
QNetworkProxy netProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyUrl.port());
|
||||
QNetworkProxy::setApplicationProxy(netProxy);
|
||||
}
|
||||
|
||||
QGraphicsScene scene;
|
||||
|
||||
QGraphicsView view(&scene);
|
||||
view.setFrameShape(QFrame::NoFrame);
|
||||
view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
BGraphicsWebView webview;
|
||||
int width=0, height=0;
|
||||
if (2!=sscanf(size,"%ux%u", &width, &height)) {
|
||||
ShowUsage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
webview.resize(width, height);
|
||||
webview.load(QUrl(url));
|
||||
|
||||
scene.addItem(&webview);
|
||||
view.setFixedSize(width, height);
|
||||
view.show();
|
||||
|
||||
int ret = app.exec();
|
||||
|
||||
return ret;
|
||||
}
|
||||
90
3P/civetweb/testutils/Browser/Browser.vcxproj
Normal file
90
3P/civetweb/testutils/Browser/Browser.vcxproj
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{277772B0-D4B3-451E-86B6-261FBC645793}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>Browser</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>Q:\include\QtGui\;Q:\include\;Q:\include\QtWebKit\;Q:\include\QtNetwork\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmaind.lib;QtGuid4.lib;QtCored4.lib;QtWebKitd4.lib;QtNetworkd4.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Q:\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>Q:\include\QtGui\;Q:\include\;Q:\include\QtWebKit\;Q:\include\QtNetwork\</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>qtmain.lib;QtGui4.lib;QtCore4.lib;QtWebKit4.lib;QtNetwork4.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>Q:\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Browser.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
5
3P/civetweb/testutils/readme.txt
Normal file
5
3P/civetweb/testutils/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Old test utils from 2012:
|
||||
https://code.google.com/r/bel2125-mongoose/source/browse/#hg%2Ftestclient
|
||||
https://code.google.com/r/bel2125-mongoose/source/browse/#hg%2FBrowser
|
||||
|
||||
TODO: check if they still work, fix them, add to standard tests
|
||||
372
3P/civetweb/testutils/testclient/testclient.c
Normal file
372
3P/civetweb/testutils/testclient/testclient.c
Normal file
@@ -0,0 +1,372 @@
|
||||
#include <WinSock2.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
|
||||
char * HOST = "127.0.0.1";
|
||||
unsigned short PORT = 8080;
|
||||
static const char * RESOURCELIST[] = {
|
||||
"/hello.txt",
|
||||
"/imagetest/00.png",
|
||||
"/resource_script_demo.lua/r1.txt",
|
||||
"/"
|
||||
};
|
||||
static const char * METHODLIST[] = {
|
||||
"GET",
|
||||
"POST",
|
||||
"PUT"
|
||||
};
|
||||
|
||||
|
||||
static int CLIENTCOUNT = 0; // 20;
|
||||
static int TESTCYCLES = 1;
|
||||
static int RESOURCEINDEX = 1;
|
||||
static int METHODINDEX = 0;
|
||||
|
||||
|
||||
int sockvprintf(SOCKET soc, const char * fmt, va_list vl) {
|
||||
|
||||
char buf[1024*8];
|
||||
int len = vsprintf_s(buf, sizeof(buf), fmt, vl);
|
||||
int ret = send(soc, buf, len, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int sockprintf(SOCKET soc, const char * fmt, ...) {
|
||||
|
||||
int ret = -1;
|
||||
va_list vl;
|
||||
va_start(vl, fmt);
|
||||
ret = sockvprintf(soc, fmt, vl);
|
||||
va_end(vl);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct sockaddr_in target = {0};
|
||||
static CRITICAL_SECTION cs = {0};
|
||||
static size_t expectedData = 0;
|
||||
static DWORD_PTR availableCPUs = 1;
|
||||
static DWORD_PTR totalCPUs = 1;
|
||||
|
||||
static unsigned good = 0;
|
||||
static unsigned bad = 0;
|
||||
unsigned long postSize = 0;
|
||||
unsigned long extraHeadSize = 0;
|
||||
unsigned long queryStringSize = 0;
|
||||
unsigned long keep_alive = 0;
|
||||
int chunked = 1;
|
||||
|
||||
|
||||
int WINAPI ClientMain(void * clientNo) {
|
||||
|
||||
SOCKET soc;
|
||||
time_t lastData;
|
||||
size_t totalData = 0;
|
||||
size_t bodyData = 0;
|
||||
int isBody = 0;
|
||||
int isTest = (clientNo == 0);
|
||||
int cpu = ((int)clientNo) % 100;
|
||||
int timeOut = 10;
|
||||
const char * resource = 0;
|
||||
const char * method = 0;
|
||||
unsigned long i, j;
|
||||
|
||||
// Method: PUT or GET
|
||||
if (METHODINDEX < sizeof(METHODLIST)/sizeof(METHODLIST[0])) {
|
||||
method = METHODLIST[METHODINDEX];
|
||||
}
|
||||
if (method == 0) {
|
||||
EnterCriticalSection(&cs);
|
||||
printf("\r\nClient %u: bad method\a\r\n", (int)clientNo);
|
||||
LeaveCriticalSection(&cs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Resource
|
||||
if (RESOURCEINDEX < sizeof(RESOURCELIST)/sizeof(RESOURCELIST[0])) {
|
||||
resource = RESOURCELIST[RESOURCEINDEX];
|
||||
}
|
||||
if (resource == 0) {
|
||||
EnterCriticalSection(&cs);
|
||||
printf("\r\nClient %u: bad resource\a\r\n", (int)clientNo);
|
||||
LeaveCriticalSection(&cs);
|
||||
return 2;
|
||||
}
|
||||
|
||||
// CPU
|
||||
if ((!isTest) && (((1ULL<<cpu) & availableCPUs)!=0)) {
|
||||
SetThreadAffinityMask(GetCurrentThread(), 1ULL<<cpu);
|
||||
}
|
||||
|
||||
// TCP
|
||||
soc = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (soc==INVALID_SOCKET) {
|
||||
EnterCriticalSection(&cs);
|
||||
printf("\r\nClient %u: cannot create socket\a\r\n", (int)clientNo);
|
||||
LeaveCriticalSection(&cs);
|
||||
return 3;
|
||||
}
|
||||
|
||||
// comment in to disable Nagle:
|
||||
{int disable_Nagle = 1; setsockopt(soc, IPPROTO_TCP, TCP_NODELAY, (char *) &disable_Nagle, sizeof(disable_Nagle));}
|
||||
|
||||
if (connect(soc, (SOCKADDR*)&target, sizeof(target))) {
|
||||
EnterCriticalSection(&cs);
|
||||
printf("\r\nClient %u: cannot connect to server %s:%u\a\r\n", (int)clientNo, HOST, PORT);
|
||||
LeaveCriticalSection(&cs);
|
||||
return 4;
|
||||
}
|
||||
|
||||
for (j=0; j<((keep_alive>0)?keep_alive:1); j++) {
|
||||
|
||||
// HTTP request
|
||||
if (queryStringSize>0) {
|
||||
sockprintf(soc, "%s %s?", method, resource);
|
||||
|
||||
for (i=0;i<(queryStringSize/10);i++) {sockprintf(soc, "1234567890");}
|
||||
for (i=0;i<(queryStringSize%10);i++) {sockprintf(soc, "_");}
|
||||
|
||||
sockprintf(soc, " HTTP/1.1\r\nHost: %s\r\n", HOST);
|
||||
} else {
|
||||
sockprintf(soc, "%s %s HTTP/1.1\r\nHost: %s\r\n", method, resource, HOST);
|
||||
}
|
||||
if (keep_alive) {
|
||||
sockprintf(soc, "Connection: Keep-Alive\r\n");
|
||||
} else {
|
||||
sockprintf(soc, "Connection: Close\r\n");
|
||||
}
|
||||
|
||||
for (i=0;i<(extraHeadSize/25);i++) {sockprintf(soc, "Comment%04u: 1234567890\r\n", i % 10000);} /* omit (extraHeadSize%25) */
|
||||
|
||||
if (!strcmp(method,"GET")) {
|
||||
sockprintf(soc, "\r\n");
|
||||
} else if (chunked) {
|
||||
|
||||
sockprintf(soc, "Transfer-Encoding: chunked\r\n\r\n", postSize);
|
||||
|
||||
for (i=0;i<(postSize/10);i++) {sockprintf(soc, "A\r\n1234567890\r\n");}
|
||||
if ((postSize%10)>0) {
|
||||
sockprintf(soc, "%x\r\n", postSize%10);
|
||||
for (i=0;i<(postSize%10);i++) {sockprintf(soc, "_");}
|
||||
sockprintf(soc, "\r\n");
|
||||
}
|
||||
|
||||
} else {
|
||||
// not GET
|
||||
sockprintf(soc, "Content-Length: %u\r\n\r\n", postSize);
|
||||
|
||||
for (i=0;i<postSize/10;i++) {sockprintf(soc, "1234567890");}
|
||||
for (i=0;i<postSize%10;i++) {sockprintf(soc, ".");}
|
||||
|
||||
timeOut += postSize/10000;
|
||||
}
|
||||
|
||||
if (!keep_alive) {
|
||||
shutdown(soc, SD_SEND);
|
||||
} else {
|
||||
timeOut = 2;
|
||||
}
|
||||
|
||||
// wait for response from the server
|
||||
bodyData = totalData = 0;
|
||||
isBody = 0;
|
||||
lastData = time(0);
|
||||
for (;;) {
|
||||
char buf[20480];
|
||||
int chunkSize = 0;
|
||||
unsigned long dataReady = 0;
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if (ioctlsocket(soc, FIONREAD, &dataReady) < 0) break;
|
||||
if (dataReady) {
|
||||
chunkSize = recv(soc, buf+totalData, sizeof(buf)-totalData, 0);
|
||||
if (chunkSize<0) {
|
||||
printf("Error: recv failed for client %i\r\n", (int)clientNo);
|
||||
break;
|
||||
} else if (!isBody) {
|
||||
char * headEnd = strstr(buf,"\xD\xA\xD\xA");
|
||||
if (headEnd) {
|
||||
headEnd+=4;
|
||||
chunkSize -= ((int)headEnd - (int)buf);
|
||||
if (chunkSize>0) {
|
||||
//fwrite(headEnd,1,got,STORE);
|
||||
bodyData += chunkSize;
|
||||
}
|
||||
isBody=1;
|
||||
}
|
||||
} else {
|
||||
//fwrite(buf,1,got,STORE);
|
||||
bodyData += chunkSize;
|
||||
}
|
||||
lastData = time(0);
|
||||
totalData += chunkSize;
|
||||
} else {
|
||||
time_t current = time(0);
|
||||
if (difftime(current, lastData) > timeOut) {
|
||||
break;
|
||||
}
|
||||
Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EnterCriticalSection(&cs);
|
||||
if (isTest) {
|
||||
expectedData = totalData;
|
||||
} else if (totalData != expectedData) {
|
||||
printf("Error: Client %u got %u bytes instead of %u\r\n", (int)clientNo, totalData, expectedData);
|
||||
bad++;
|
||||
} else {
|
||||
good++;
|
||||
}
|
||||
LeaveCriticalSection(&cs);
|
||||
|
||||
if (keep_alive) {
|
||||
Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
shutdown(soc, SD_BOTH);
|
||||
closesocket(soc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void RunMultiClientTest(int loop) {
|
||||
|
||||
HANDLE *hThread = calloc(CLIENTCOUNT, sizeof(hThread[0]));
|
||||
int i;
|
||||
DWORD res;
|
||||
|
||||
for (i=0;i<CLIENTCOUNT;i++) {
|
||||
DWORD dummy;
|
||||
hThread[i] = CreateThread(NULL, 1024*32, (LPTHREAD_START_ROUTINE)ClientMain, (void*)(1000*loop+i), 0, &dummy);
|
||||
}
|
||||
|
||||
WaitForMultipleObjects(CLIENTCOUNT, hThread, TRUE, 15000);
|
||||
for (i=0;i<CLIENTCOUNT;i++) {
|
||||
res = WaitForSingleObject(hThread[i], 0);
|
||||
if (res == WAIT_OBJECT_0) {
|
||||
CloseHandle(hThread[i]);
|
||||
hThread[i]=0;
|
||||
}
|
||||
}
|
||||
for (i=0;i<CLIENTCOUNT;i++) {
|
||||
if (hThread[i]) {
|
||||
EnterCriticalSection(&cs);
|
||||
SuspendThread(hThread[i]); // -> check this thread in the debugger
|
||||
printf("Thread %i did not finish!\r\n", (int)(1000*loop+i));
|
||||
LeaveCriticalSection(&cs);
|
||||
}
|
||||
}
|
||||
EnterCriticalSection(&cs);
|
||||
printf("Test cylce %u completed\r\n\r\n", loop);
|
||||
LeaveCriticalSection(&cs);
|
||||
|
||||
free(hThread);
|
||||
}
|
||||
|
||||
|
||||
int MultiClientTestAutomatic(unsigned long initialPostSize) {
|
||||
|
||||
FILE * log;
|
||||
int cycle;
|
||||
|
||||
postSize = initialPostSize;
|
||||
|
||||
do {
|
||||
printf("Preparing test with %u bytes of data ...", postSize);
|
||||
ClientMain(0);
|
||||
if (expectedData==0) {
|
||||
printf(" Error: Could not read any data\a\r\n");
|
||||
return 1;
|
||||
}
|
||||
printf(" OK: %u bytes of data\r\n", expectedData);
|
||||
printf("Starting multi client test: %i cycles, %i clients each\r\n\r\n", (int)TESTCYCLES, (int)CLIENTCOUNT);
|
||||
good=bad=0;
|
||||
|
||||
for (cycle=1;cycle<=TESTCYCLES;cycle++) {
|
||||
RunMultiClientTest(cycle);
|
||||
}
|
||||
|
||||
printf("\r\n--------\r\n%u errors\r\n%u OK\r\n--------\r\n\r\n", bad, good);
|
||||
log = fopen("testclient.log", "at");
|
||||
if (log) {
|
||||
fprintf(log, "%u\t%u\t%u\r\n", postSize, good, bad);
|
||||
fclose(log);
|
||||
}
|
||||
|
||||
postSize = (postSize!=0) ? (postSize<<1) : 1;
|
||||
|
||||
} while (postSize!=0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SingleClientTestAutomatic(unsigned long initialPostSize) {
|
||||
|
||||
FILE * log;
|
||||
int cycle;
|
||||
int i;
|
||||
|
||||
postSize = initialPostSize;
|
||||
for (cycle=1;cycle<=TESTCYCLES;cycle++) {
|
||||
good=bad=0;
|
||||
for (i=0;i<1 /* 000 */;i++) {
|
||||
expectedData=17;
|
||||
ClientMain((void*)1);
|
||||
}
|
||||
log = fopen("testclient.log", "at");
|
||||
if (log) {
|
||||
fprintf(log, "Cylce<%u>\t%u\t%u\r\n", cycle, good, bad);
|
||||
fclose(log);
|
||||
}
|
||||
printf("test cycle %u: %u good, %u bad\r\n", cycle, good, bad);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
WSADATA wsaData = {0};
|
||||
HOSTENT * lpHost = 0;
|
||||
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) {
|
||||
printf("\r\nCannot init WinSock\a\r\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
lpHost = gethostbyname(HOST);
|
||||
if (lpHost == NULL) {
|
||||
printf("\r\nCannot find host %s\a\r\n",HOST);
|
||||
return 2;
|
||||
}
|
||||
|
||||
target.sin_family = AF_INET;
|
||||
target.sin_addr.s_addr = *((u_long FAR *) (lpHost->h_addr));
|
||||
target.sin_port = htons(PORT);
|
||||
|
||||
GetProcessAffinityMask(GetCurrentProcess(), &availableCPUs, &totalCPUs);
|
||||
printf("CPUs (bit masks): process=%x, system=%x\r\n", availableCPUs, totalCPUs);
|
||||
|
||||
InitializeCriticalSectionAndSpinCount(&cs, 100);
|
||||
|
||||
/* Do the actual test here */
|
||||
if (CLIENTCOUNT>0) {
|
||||
MultiClientTestAutomatic(2000);
|
||||
} else {
|
||||
SingleClientTestAutomatic(2000);
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
DeleteCriticalSection(&cs);
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
91
3P/civetweb/testutils/testclient/testclient.vcxproj
Normal file
91
3P/civetweb/testutils/testclient/testclient.vcxproj
Normal file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{15D6AAA6-36CE-453B-ABBF-3C52BD247EBE}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>testclient</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>binmode.obj;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>binmode.obj;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="testclient.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
239
3P/civetweb/testutils/testclient_chunked_linux/testclient.c
Normal file
239
3P/civetweb/testutils/testclient_chunked_linux/testclient.c
Normal file
@@ -0,0 +1,239 @@
|
||||
/* quick and dirty test for chunked encoding */
|
||||
|
||||
#ifdef WIN32
|
||||
#include <WinSock2.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <termios.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/ip.h>
|
||||
typedef int SOCKET;
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
typedef struct hostent HOSTENT;
|
||||
const int INVALID_SOCKET = -1;
|
||||
const int SD_SEND = SHUT_WR;
|
||||
const int SD_BOTH = SHUT_RDWR;
|
||||
#define closesocket(x) close(x)
|
||||
#define Sleep(x) usleep((x)*1000)
|
||||
#define ioctlsocket(a,b,c) ioctl(a,b,c)
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
|
||||
char * HOST = "127.0.0.1";
|
||||
unsigned short PORT = 8080;
|
||||
const char * RESOURCE = "/resource_script_demo.lua/r1.txt";
|
||||
const char * METHOD = "PUT";
|
||||
|
||||
unsigned postSize = 9876;
|
||||
unsigned extraHeadSize = 0;
|
||||
unsigned queryStringSize = 0;
|
||||
int keep_alive = 0;
|
||||
int chunked = 1;
|
||||
|
||||
|
||||
int sockvprintf(SOCKET soc, const char * fmt, va_list vl) {
|
||||
|
||||
char buf[1024*8];
|
||||
#ifdef WIN32
|
||||
int len = vsprintf_s(buf, sizeof(buf), fmt, vl);
|
||||
#else
|
||||
int len = vsprintf(buf, fmt, vl);
|
||||
#endif
|
||||
int ret = send(soc, buf, len, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int sockprintf(SOCKET soc, const char * fmt, ...) {
|
||||
|
||||
int ret = -1;
|
||||
va_list vl;
|
||||
va_start(vl, fmt);
|
||||
ret = sockvprintf(soc, fmt, vl);
|
||||
va_end(vl);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct sockaddr_in target = {0};
|
||||
|
||||
|
||||
int TestClient(unsigned clientNo) {
|
||||
|
||||
SOCKET soc;
|
||||
time_t lastData;
|
||||
size_t totalData = 0;
|
||||
size_t bodyData = 0;
|
||||
int isBody = 0;
|
||||
int timeOut = 10;
|
||||
unsigned long i;
|
||||
|
||||
// TCP
|
||||
soc = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (soc==INVALID_SOCKET) {
|
||||
printf("\r\nClient %u: cannot create socket\a\r\n", (int)clientNo);
|
||||
return 3;
|
||||
}
|
||||
|
||||
// comment in to disable Nagle:
|
||||
{int disable_Nagle = 1; setsockopt(soc, IPPROTO_TCP, TCP_NODELAY, (char *) &disable_Nagle, sizeof(disable_Nagle));}
|
||||
|
||||
if (connect(soc, (SOCKADDR*)&target, sizeof(target))) {
|
||||
printf("\r\nClient %u: cannot connect to server %s:%u\a\r\n", (int)clientNo, HOST, PORT);
|
||||
return 4;
|
||||
}
|
||||
|
||||
sockprintf(soc, "%s %s", METHOD, RESOURCE);
|
||||
|
||||
if (queryStringSize>0) {
|
||||
sockprintf(soc, "?", METHOD, RESOURCE);
|
||||
for (i=0;i<(queryStringSize/10);i++) {sockprintf(soc, "1234567890");}
|
||||
for (i=0;i<(queryStringSize%10);i++) {sockprintf(soc, "_");}
|
||||
}
|
||||
|
||||
sockprintf(soc, " HTTP/1.1\r\nHost: %s\r\n", HOST);
|
||||
|
||||
if (keep_alive) {
|
||||
sockprintf(soc, "Connection: Keep-Alive\r\n");
|
||||
} else {
|
||||
sockprintf(soc, "Connection: Close\r\n");
|
||||
}
|
||||
|
||||
for (i=0;i<(extraHeadSize/25);i++) {
|
||||
sockprintf(soc, "Comment%04u: 1234567890\r\n", i % 10000);
|
||||
}
|
||||
|
||||
if (!strcmp(METHOD, "GET")) {
|
||||
sockprintf(soc, "\r\n");
|
||||
|
||||
} else if (chunked) {
|
||||
|
||||
unsigned remaining_postSize = postSize;
|
||||
sockprintf(soc, "Transfer-Encoding: chunked\r\n\r\n", postSize);
|
||||
|
||||
while (remaining_postSize > 0) {
|
||||
unsigned chunk = rand()%200 + 1;
|
||||
if (chunk>remaining_postSize) chunk = remaining_postSize;
|
||||
|
||||
sockprintf(soc, "%x\r\n", chunk);
|
||||
for (i=0;i<chunk;i++) {sockprintf(soc, "_");}
|
||||
sockprintf(soc, "\r\n");
|
||||
|
||||
remaining_postSize -= chunk;
|
||||
}
|
||||
sockprintf(soc, "0\r\n\r\n", postSize%10);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
sockprintf(soc, "Content-Length: %u\r\n\r\n", postSize);
|
||||
|
||||
for (i=0;i<postSize/10;i++) {sockprintf(soc, "1234567890");}
|
||||
for (i=0;i<postSize%10;i++) {sockprintf(soc, ".");}
|
||||
|
||||
timeOut += postSize/10000;
|
||||
}
|
||||
|
||||
if (!keep_alive) {
|
||||
shutdown(soc, SD_SEND);
|
||||
} else {
|
||||
timeOut = 2;
|
||||
}
|
||||
|
||||
// wait for response from the server
|
||||
bodyData = totalData = 0;
|
||||
isBody = 0;
|
||||
lastData = time(0);
|
||||
for (;;) {
|
||||
char buf[20480];
|
||||
int chunkSize = 0;
|
||||
unsigned long dataReady = 0;
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if (ioctlsocket(soc, FIONREAD, &dataReady) < 0) break;
|
||||
if (dataReady) {
|
||||
chunkSize = recv(soc, buf+totalData, sizeof(buf)-totalData, 0);
|
||||
if (chunkSize<0) {
|
||||
printf("Error: recv failed for client %i\r\n", (int)clientNo);
|
||||
break;
|
||||
} else if (!isBody) {
|
||||
char * headEnd = strstr(buf,"\xD\xA\xD\xA");
|
||||
if (headEnd) {
|
||||
headEnd+=4;
|
||||
chunkSize -= ((int)headEnd - (int)buf);
|
||||
if (chunkSize>0) {
|
||||
//fwrite(headEnd,1,got,STORE);
|
||||
bodyData += chunkSize;
|
||||
}
|
||||
isBody=1;
|
||||
}
|
||||
} else {
|
||||
//fwrite(buf,1,got,STORE);
|
||||
bodyData += chunkSize;
|
||||
}
|
||||
lastData = time(0);
|
||||
totalData += chunkSize;
|
||||
} else {
|
||||
time_t current = time(0);
|
||||
if (difftime(current, lastData) > timeOut) {
|
||||
break;
|
||||
}
|
||||
Sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
shutdown(soc, SD_BOTH);
|
||||
closesocket(soc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
HOSTENT * lpHost = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsaData = {0};
|
||||
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) {
|
||||
printf("\r\nCannot init WinSock\a\r\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
srand((unsigned int)time(NULL));
|
||||
|
||||
lpHost = gethostbyname(HOST);
|
||||
if (lpHost == NULL) {
|
||||
printf("\r\nCannot find host %s\a\r\n",HOST);
|
||||
return 2;
|
||||
}
|
||||
|
||||
target.sin_family = AF_INET;
|
||||
#ifdef WIN32
|
||||
target.sin_addr.s_addr = *((u_long FAR *) (lpHost->h_addr));
|
||||
#else
|
||||
target.sin_addr.s_addr = htonl(0x7F000001);
|
||||
#endif
|
||||
target.sin_port = htons(PORT);
|
||||
printf("\r\nConnect to %s\r\n", inet_ntoa(target.sin_addr));
|
||||
|
||||
TestClient(1);
|
||||
|
||||
#ifdef WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{150140C5-2989-4D0D-8714-5A47B78EAD4D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>testclient2</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v100</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>binmode.obj;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>binmode.obj;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="testclient.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user