Skip to content

Commit 345c872

Browse files
committed
Bugfixs for Windows
Removed unused files
1 parent 5037222 commit 345c872

29 files changed

+186
-314
lines changed

httpserver.userprefs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Properties>
22
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
3-
<MonoDevelop.Ide.Workbench ActiveDocument="httpserver/Utils.cpp">
3+
<MonoDevelop.Ide.Workbench ActiveDocument="httpserver/Server.cpp">
44
<Files>
5-
<File FileName="httpserver/Server.cpp" Line="1" Column="1" />
5+
<File FileName="httpserver/Server.cpp" Line="107" Column="4" />
66
<File FileName="httpserver/Server.h" Line="1" Column="1" />
77
<File FileName="httpserver/Main.cpp" Line="1" Column="1" />
88
<File FileName="httpserver/Main.h" Line="1" Column="1" />
@@ -23,20 +23,21 @@
2323
<File FileName="httpserver/ServerApplicationsTree.cpp" Line="1" Column="1" />
2424
<File FileName="httpserver/Module.h" Line="1" Column="1" />
2525
<File FileName="httpserver/Event.h" Line="1" Column="1" />
26-
<File FileName="httpserver/System.h" Line="13" Column="2" />
26+
<File FileName="httpserver/System.h" Line="1" Column="1" />
2727
<File FileName="httpserver/DataVariantTextPlain.h" Line="1" Column="1" />
2828
<File FileName="httpserver/DataVariantTextPlain.cpp" Line="1" Column="1" />
2929
<File FileName="httpserver/SignalsHandles.cpp" Line="1" Column="1" />
3030
<File FileName="httpserver/SignalsHandles.h" Line="1" Column="1" />
31-
<File FileName="httpserver/System.cpp" Line="58" Column="4" />
32-
<File FileName="httpserver/Socket.cpp" Line="1" Column="1" />
31+
<File FileName="httpserver/System.cpp" Line="1" Column="1" />
32+
<File FileName="httpserver/Socket.cpp" Line="86" Column="2" />
3333
<File FileName="httpserver/Utils.h" Line="1" Column="1" />
34-
<File FileName="httpserver/Utils.cpp" Line="232" Column="4" />
34+
<File FileName="httpserver/Utils.cpp" Line="1" Column="1" />
3535
<File FileName="httpserver/Socket.h" Line="1" Column="1" />
3636
<File FileName="httpserver/FileIncoming.h" Line="1" Column="1" />
3737
<File FileName="httpserver/RawData.h" Line="1" Column="1" />
3838
<File FileName="httpserver/FileIncoming.cpp" Line="1" Column="1" />
3939
<File FileName="httpserver/ResourceAbstract.cpp" Line="1" Column="1" />
40+
<File FileName="httpserver/ResourceAbstract.h" Line="1" Column="1" />
4041
</Files>
4142
</MonoDevelop.Ide.Workbench>
4243
<MonoDevelop.Ide.DebuggingService.Breakpoints>

httpserver/DataVariantAbstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace HttpServer
2222
/**
2323
* virtual destructor
2424
*/
25-
// virtual ~DataVariantAbstract() = 0;
25+
virtual ~DataVariantAbstract() {};
2626

2727
/**
2828
* @param const Socket & - сокет, откуда можно достать остальные данные

httpserver/DataVariantFormUrlencoded.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ namespace HttpServer
2121
std::unordered_multimap<std::string, FileIncoming> &
2222
) override;
2323
};
24-
};
24+
};

httpserver/DataVariantMultipartFormData.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ namespace HttpServer
296296
// Добавить последнюю часть данных к значению
297297
file.write(str_buf.data(), delimiter);
298298

299-
// TODO: структра (класс) данных о файле
300-
301299
// Добавить данные в список
302300
files.emplace(name->second, FileIncoming(tmp_name, filetype->second, file.tellp() ) );
303301

httpserver/DataVariantMultipartFormData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ namespace HttpServer
3333
std::unordered_multimap<std::string, FileIncoming> &
3434
) override;
3535
};
36-
};
36+
};

httpserver/DataVariantTextPlain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ namespace HttpServer
2121
std::unordered_multimap<std::string, FileIncoming> &
2222
) override;
2323
};
24-
};
24+
};

httpserver/FileIncoming.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ namespace HttpServer
2222

2323
return is_exists;
2424
}
25-
};
25+
};

httpserver/FileIncoming.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ namespace HttpServer
3535

3636
bool isExists() const;
3737
};
38-
};
38+
};

httpserver/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ int main(const int argc, const char *argv[])
5050
}
5151

5252
return exitcode;
53-
}
53+
}

httpserver/Module.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace HttpServer
1616
{
1717
protected:
1818
#ifdef WIN32
19-
HMODULE lib_handle;
19+
::HMODULE lib_handle;
2020
#elif POSIX
2121
void *lib_handle;
2222
#else
@@ -44,9 +44,9 @@ namespace HttpServer
4444
inline bool open(const std::string &libPath)
4545
{
4646
#ifdef WIN32
47-
lib_handle = LoadLibrary(libPath.c_str() );
47+
lib_handle = ::LoadLibrary(libPath.c_str() );
4848
#elif POSIX
49-
lib_handle = dlopen(libPath.c_str(), RTLD_NOW);
49+
lib_handle = ::dlopen(libPath.c_str(), RTLD_NOW);
5050
#else
5151
#error "Undefine platform"
5252
#endif
@@ -59,9 +59,9 @@ namespace HttpServer
5959
if (lib_handle)
6060
{
6161
#ifdef WIN32
62-
FreeLibrary(lib_handle);
62+
::FreeLibrary(lib_handle);
6363
#elif POSIX
64-
dlclose(lib_handle);
64+
::dlclose(lib_handle);
6565
#else
6666
#error "Undefine platform"
6767
#endif
@@ -75,15 +75,15 @@ namespace HttpServer
7575
if (lib_handle)
7676
{
7777
#ifdef WIN32
78-
*addr = GetProcAddress(lib_handle, symbolName.c_str() );
78+
*addr = ::GetProcAddress(lib_handle, symbolName.c_str() );
7979

8080
return nullptr != *addr;
8181
#elif POSIX
82-
dlerror();
82+
::dlerror();
8383

84-
*addr = dlsym(lib_handle, symbolName.c_str() );
84+
*addr = ::dlsym(lib_handle, symbolName.c_str() );
8585

86-
char *error = dlerror();
86+
char *error = ::dlerror();
8787

8888
return nullptr == error;
8989
#else
@@ -99,13 +99,13 @@ namespace HttpServer
9999
if (lib_handle)
100100
{
101101
#ifdef WIN32
102-
*addr = GetProcAddress(lib_handle, symbolName);
102+
*addr = ::GetProcAddress(lib_handle, symbolName);
103103

104104
return nullptr != *addr;
105105
#elif POSIX
106-
*addr = dlsym(lib_handle, symbolName);
106+
*addr = ::dlsym(lib_handle, symbolName);
107107

108-
char *error = dlerror();
108+
char *error = ::dlerror();
109109

110110
return nullptr == error;
111111
#else

0 commit comments

Comments
 (0)