Skip to content

Commit

Permalink
add sendfile method for streamsocket (#4007)
Browse files Browse the repository at this point in the history
* add sendfile method for streamsocket

* add mswsock.lib to the project files and templates

* remove /DPOCO_NO_AUTOMATIC_LIBS for cmake windows build

* merge from upstream

* merge from upstream

* fix code stile
add NotImplemented exception for unsupported platforms
exculude <sys/sendfile.h> for POCO_EMSCRIPTEN, because https://
github.com/emscripten-core/emscripten/pull/16234

* add iostream include for std::cout

* fix compilation for emscripten (wrap sendfile)
  • Loading branch information
bas524 authored Dec 11, 2023
1 parent 689a81c commit 24b7122
Show file tree
Hide file tree
Showing 107 changed files with 350 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ jobs:
class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy
steps:
- uses: actions/checkout@v3
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON
- run: cmake -S. -Bcmake-build -DENABLE_NETSSL_WIN=ON -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_JWT=OFF -DENABLE_DATA=ON -DENABLE_DATA_ODBC=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON -DCMAKE_CXX_FLAGS="/MP /EHsc" -DCMAKE_C_FLAGS="/MP"
- run: cmake --build cmake-build --config Release
- uses: ./.github/actions/retry-action
with:
Expand Down
2 changes: 1 addition & 1 deletion CppParser/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = TestSuite_vs90.vcproj
vc.project.compiler.include = ..\\..\\Foundation\\include
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Crypto/Crypto.progen
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vc.project.compiler.defines =
vc.project.compiler.defines.shared = ${vc.project.name}_EXPORTS
vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared}
vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared}
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib mswsock.lib
vc.project.linker.dependencies.debug_shared =
vc.project.linker.dependencies.release_shared =
vc.project.linker.dependencies.debug_static_md = Crypt32.lib
Expand Down
2 changes: 1 addition & 1 deletion Crypto/samples/genrsakey/genrsakey.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Crypto\\include
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
vc.project.linker.dependencies.debug_shared =
vc.project.linker.dependencies.release_shared =
vc.project.linker.dependencies.debug_static_md = Crypt32.lib
Expand Down
2 changes: 1 addition & 1 deletion Crypto/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = TestSuite_vs90.vcproj
vc.project.compiler.include = ${vc.project.pocobase}\\Foundation\\include
vc.project.compiler.defines = _CRT_SECURE_NO_WARNINGS
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib mswsock.lib
vc.project.linker.dependencies.debug_shared =
vc.project.linker.dependencies.release_shared =
vc.project.linker.dependencies.debug_static_md =
Expand Down
2 changes: 1 addition & 1 deletion Data/MySQL/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ vc.project.prototype = TestSuite_vs90.vcproj
mysql = ${vc.project.pocobase}\\mysql
vc.project.compiler.include = ${mysql}\\include;${vc.project.pocobase}\\Foundation\\include; \
${vc.project.pocobase}\\Data\\include;${vc.project.pocobase}\\Data\\src
vc.project.linker.dependencies.Win32 = iphlpapi.lib
vc.project.linker.dependencies.Win32 = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/ODBC/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = TestSuite_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\CppUnit\\include;..\\..\\..\\Foundation\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\testsuite\\DataTest\\include
vc.project.linker.dependencies = odbc32.lib odbccp32.lib iphlpapi.lib
vc.project.linker.dependencies = odbc32.lib odbccp32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/PostgreSQL/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ postgresql = ${vc.project.pocobase}\\postgresql
vc.project.compiler.include = ${postgresql}\\include;${vc.project.pocobase}\\Foundation\\include; \
${vc.project.pocobase}\\Data\\include;${vc.project.pocobase}\\Data\\src
vc.project.compiler.defines = _CRT_SECURE_NO_WARNINGS
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
vc.project.linker.dependencies.debug_shared =
vc.project.linker.dependencies.release_shared =
vc.project.linker.dependencies.debug_static_md =
Expand Down
2 changes: 1 addition & 1 deletion Data/SQLite/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = TestSuite_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/Binding/Binding.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/RecordSet/RecordSet.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/RowFormatter/RowFormatter.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/Tuple/Tuple.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include
vc.project.linker.dependencies = iphlpapi.lib
vc.project.linker.dependencies = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/TypeHandler/TypeHandler.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\XML\\include;..\\..\\..\\Util\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/samples/WebNotifier/WebNotifier.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\Data\\include;..\\..\\..\\Data\\src;..\\..\\..\\Data\\SQLite\\include;..\\..\\..\\Net\\include
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Data/testsuite/TestSuite.progen
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ vc.project.prototype = TestSuite_vs90.vcproj
#vc.project.compiler.std.c=stdc11
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.compiler.include = ..\\src;..\\..\\Foundation\\include
vc.project.linker.dependencies.Win32 = iphlpapi.lib
vc.project.linker.dependencies.Win32 = iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Encodings/Compiler/Compiler.progen
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ vc.project.compiler.defines =
vc.project.compiler.defines.shared =
vc.project.compiler.defines.debug_shared = ${vc.project.compiler.defines.shared}
vc.project.compiler.defines.release_shared = ${vc.project.compiler.defines.shared}
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies = ws2_32.lib iphlpapi.lib mswsock.lib
vc.solution.create = true
2 changes: 1 addition & 1 deletion Encodings/samples/TextConverter/TextConverter.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include;..\\..\\..\\Encodings\\include
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
9 changes: 9 additions & 0 deletions Foundation/include/Poco/FileStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class Foundation_API FileIOS: public virtual std::ios
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
{
public:

using NativeHandle = FileStreamBuf::NativeHandle;

FileIOS();
/// Creates the basic stream.

Expand All @@ -63,6 +66,12 @@ class Foundation_API FileIOS: public virtual std::ios
FileStreamBuf* rdbuf();
/// Returns a pointer to the underlying streambuf.

NativeHandle nativeHandle() const;
/// Returns native file descriptor handle

Poco::UInt64 size() const;
/// Returns file size

protected:
FileStreamBuf _buf;
};
Expand Down
10 changes: 9 additions & 1 deletion Foundation/include/Poco/FileStream_POSIX.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
/// This stream buffer handles Fileio
{
public:
using NativeHandle = int;

FileStreamBuf();
/// Creates a FileStreamBuf.

Expand All @@ -50,6 +52,12 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
/// Change to specified position, according to mode.

NativeHandle nativeHandle() const;
/// Returns native file descriptor handle

Poco::UInt64 size() const;
/// Returns file size

protected:
enum
{
Expand All @@ -61,7 +69,7 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf

private:
std::string _path;
int _fd;
NativeHandle _fd;
std::streamoff _pos;
};

Expand Down
10 changes: 9 additions & 1 deletion Foundation/include/Poco/FileStream_WIN32.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
/// This stream buffer handles Fileio
{
public:
using NativeHandle = HANDLE;

FileStreamBuf();
/// Creates a FileStreamBuf.

Expand All @@ -49,6 +51,12 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
/// change to specified position, according to mode

NativeHandle nativeHandle() const;
/// Returns native file descriptor handle

Poco::UInt64 size() const;
/// Returns file size

protected:
enum
{
Expand All @@ -60,7 +68,7 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf

private:
std::string _path;
HANDLE _handle;
NativeHandle _handle;
UInt64 _pos;
};

Expand Down
2 changes: 1 addition & 1 deletion Foundation/samples/ActiveMethod/ActiveMethod.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/Activity/Activity.progen
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ vc.project.platforms = Win32
vc.project.configurations = debug_shared, release_shared, debug_static_mt, release_static_mt, debug_static_md, release_static_md
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/DateTime/DateTime.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/LogRotation/LogRotation.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/Logger/Logger.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/StringTokenizer/StringTokenizer.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/Timer/Timer.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/URI/URI.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/base64decode/base64decode.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/base64encode/base64encode.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/deflate/deflate.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/dir/dir.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/grep/grep.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/hmacmd5/hmacmd5.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/inflate/inflate.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/md5/md5.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
2 changes: 1 addition & 1 deletion Foundation/samples/uuidgen/uuidgen.progen
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vc.project.configurations = debug_shared, release_shared, debug_static_mt, relea
vc.project.prototype = ${vc.project.name}_vs90.vcproj
vc.project.compiler.include = ..\\..\\..\\Foundation\\include
vc.project.compiler.additionalOptions = /Zc:__cplusplus /std:c++17
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib
vc.project.linker.dependencies.Win32 = ws2_32.lib iphlpapi.lib mswsock.lib
10 changes: 10 additions & 0 deletions Foundation/src/FileStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ FileStreamBuf* FileIOS::rdbuf()
}


FileIOS::NativeHandle FileIOS::nativeHandle() const
{
return _buf.nativeHandle();
}


Poco::UInt64 FileIOS::size() const {
return _buf.size();
}

FileInputStream::FileInputStream():
std::istream(&_buf)
{
Expand Down
Loading

0 comments on commit 24b7122

Please sign in to comment.