POCO C++ Libraries are powerful cross-platform C++ libraries for building network

Overview

alt text

poco-ci CII Best Practices

POCO (Portable Components) C++ Libraries are:

  • A collection of C++ class libraries, conceptually similar to the Java Class Library or the .NET Framework.
  • Focused on solutions to frequently-encountered practical problems.
  • Focused on "internet-age" network-centric applications.
  • Written in efficient, modern, 100% ANSI/ISO Standard C++.
  • Based on and complementing the C++ Standard Library/STL.
  • Highly portable and available on many different platforms, from embedded to server.
  • Open Source, licensed under the Boost Software License.

alt text

To start using POCO, see the Guided Tour and Getting Started documents.

Quick Start (with CMake)

Prerequisites

  • CMake 3.5 or newer
  • A C++14 compiler (Visual C++ 2015, GCC 5.0, Clang 3.4, or newer)
  • OpenSSL headers and libraries (optional, but recommended)
  • MySQL, PostgreSQL and ODBC client libraries (optional)

Most Unix/Linux systems already have OpenSSL preinstalled. If your system does not have OpenSSL, please get it from http://www.openssl.org or another source. You do not have to build OpenSSL yourself - a binary distribution is fine. For example, via Debian APT:

$ apt-get install openssl libssl-dev

On macOS, the easiest way to install OpenSSL is via Homebrew:

$ brew install openssl

The easiest way to install OpenSSL on Windows is to use a binary (prebuild) release, for example the one from Shining Light Productions that comes with a Windows installer.

On Windows, POCO can also use the native Windows TLS APIs (SChannel).

Installing All Dependencies (Linux and macOS)

All dependencies can be installed with the following commands:

Debian Linux (including Ubuntu and Raspbian)

$ sudo apt-get -y update && sudo apt-get -y install git g++ make cmake libssl-dev

RedHat Linux

$ sudo yum install -y git gcc-c++ make cmake3 openssl-devel

macOS (with Homebrew)

$ brew install cmake openssl

Building with CMake (Linux, macOS, Windows)

CMake (version 3.5 or newer) is the recommended build system for building the POCO C++ Libraries.

$ git clone -b master https://github.com/pocoproject/poco.git
$ cd poco
$ mkdir cmake-build
$ cd cmake-build
$ cmake ..
$ cmake --build . --config Release

On macOS, it's necessary to tell CMake where to find the OpenSSL headers and libraries by setting the OPENSSL_ROOT_DIR CMake variable. For example, if OpenSSL has been installed with Homebrew, the cmake invocation becomes:

$ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl

Other common ways of building with CMake (e.g., cmake-gui) will also work.

There are also a number of project-specific CMake variables that can be changed.

Cross-Compiling

With a proper CMake toolchain file (specified via the CMAKE_TOOLCHAIN_FILE CMake variable), the POCO C++ Libraries can be cross-compiled for embedded Linux systems:

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mytoolchain.cmake -DCMAKE_INSTALL_PREFIX=/path/to/target

Installing

The POCO C++ Libraries headers and libraries can be optionally be installed by building the install target.

$ sudo cmake --build . --target install

The default install location is /usr/local/ on Linux and macOS and C:\Program Files (x64)\ on Windows and can be overridden by setting the CMAKE_INSTALL_PREFIX CMake variable.

Building Without CMake

If you do not want to or cannot use CMake, POCO can also be built with Visual Studio (project and solution files included) or GNU Make (Linux, macOS and other supported Unix platforms).

Please refer to the documentation for more information.

Getting POCO via a Package Manager

POCO can also be obtained via different package managers.

Community and Contributing

POCO has an active user and contributing community, please visit our website and blog. Answers to POCO-related questions can also be found on Stack Overflow.

Please see CONTRIBUTING for submitting contributions, bugs reports, feature requests or security issues.

POCO vs. Boost

In regards to Boost, in spite of some functional overlapping, POCO is best thought of as a Boost complement (rather than replacement). Side-by-side use of Boost and POCO is a very common occurrence.

Issues
  • Poco C++ Static Library (Crypto and SSL) Linker Error on OS-X

    Poco C++ Static Library (Crypto and SSL) Linker Error on OS-X

    I have compiled Poco as static library to be used in an XCode6.1.1 Project for a mac application. However I see linking error for libraries: libPocoCrypto.a and libPocoNetSSL.a:

    I have already verified that these libraries are built for x86_64 architecture.

    Linker Error:

    Undefined symbols for architecture x86_64: "_ASN1_STRING_data", referenced from: Poco::Crypto::X509Certificate::extractNames(std::__1::basic_string, std::__1::allocator >&, std::__1::set, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >&) const in libPocoCryptod.a(X509Certificate.o) "_ASN1_STRING_length", referenced from: Poco::Crypto::X509Certificate::extractNames(std::__1::basic_string, std::__1::allocator >&, std::__1::set, std::__1::allocator >, std::__1::less, std::__1::allocator > >, std::__1::allocator, std::__1::allocator > > >&) const in libPocoCryptod.a(X509Certificate.o) "_BIO_ctrl", referenced from: Poco::Crypto::X509Certificate::load(std::__1::basic_string, std::__1::allocator > const&) in libPocoCryptod.a(X509Certificate.o) ....

    question 
    opened by AbhinavBansal 86
  • when will the 2.0 release be ready?

    when will the 2.0 release be ready?

    According to the roadmap 2.0 should have been released about two month ago. Is there any Information about this? My project depends on integrating poco as a cmake subproject, so I'm really waiting for 2.0 because I dont want to release something depending on the develop branch.

    Kind regards,

    Tino

    question fixed 
    opened by trusch 45
  • Unable to send email with Poco

    Unable to send email with Poco

    I am trying to use Poco to send an email. I have linked the following dynamic libraries -

    CppUnit.1.dylib, PocoCrypto.30.dylib, PocoData.30.dylib, PocoDataSQLite.30.dylib, PocoFoundation.30.dylib, PocoJSON.30.dylib, PocoMongoDB.30.dylib, PocoNet.30.dylib, PocoNetSSL.30.dylib, PocoUtil.30.dylib, PocoXML.30.dylib, PocoZip.30.dylib.

    I need to use 32 bit version of it, so I ran

    ./configure --omit=Data/ODBC,Data/MySQL --config=Darwin32
    

    This is my code:

    #include "MailSender.hpp"
    
    #include "Poco/Net/MailMessage.h"
    #include "Poco/Net/MailRecipient.h"
    #include "Poco/Net/SMTPClientSession.h"
    #include "Poco/Net/NetException.h"
    #include "Poco/Net/SecureSMTPClientSession.h"
    #include "Poco/Net/InvalidCertificateHandler.h"
    #include "Poco/Net/AcceptCertificateHandler.h"
    #include "Poco/Net/SSLManager.h"
    #include "Poco/Net/SecureStreamSocket.h"
    #include "Poco/Net/MailRecipient.h"
    
    using Poco::Net::InvalidCertificateHandler;
    using Poco::Net::AcceptCertificateHandler;
    using Poco::Net::Context;
    using Poco::Net::SSLManager;
    using Poco::Net::SecureStreamSocket;
    using Poco::Net::SocketAddress;
    using Poco::Net::SecureSMTPClientSession;
    using Poco::Net::SMTPClientSession;
    using Poco::SharedPtr;
    using Poco::Net::MailMessage;
    using Poco::Net::MailRecipient;
    using namespace std;
    
    MailSender::MailSender()
    {
    SharedPtr<InvalidCertificateHandler> pCert = new AcceptCertificateHandler(false);
    
    string host = "smtp.gmail.com";
    int port = 25;
    
    Context::Ptr pContext = new Poco::Net::Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
    SSLManager::instance().initializeClient(0, pCert, pContext);
    
    Poco::Net::SecureSMTPClientSession* pSecure = new Poco::Net::SecureSMTPClientSession(host, port);
    Poco::Net::SecureSMTPClientSession* pSession_ = new Poco::Net::SecureSMTPClientSession(host, port);
    
    SecureStreamSocket* pSSLSocket = new SecureStreamSocket(pContext);
    pSSLSocket->connect(SocketAddress(host, port));
    pSecure = new SecureSMTPClientSession(*pSSLSocket);
    pSession_ = pSecure;
    pSecure->login();
    if (!pSecure->startTLS(pContext))
       throw std::string("Failed to start TLS connection.");
    
    std::string sUserName = "my_email_id";
    std::string sPassword = "my_password";
    
    pSession_->login(SMTPClientSession::AUTH_LOGIN, sUserName, sPassword);
    
    
    string to = "my_email_id";
    string from = "my_email_id";
    string subject = "Your first e-mail message sent using Poco Libraries";
    subject = MailMessage::encodeWord(subject, "UTF-8");
    string content = "Well done! You've successfully sent your first message using Poco SMTPClientSession";
    MailMessage message;
    message.setSender(from);
    message.addRecipient(MailRecipient(MailRecipient::PRIMARY_RECIPIENT, to));
    message.setSubject(subject);
    message.setContentType("text/plain; charset=UTF-8");
    message.setContent(content, MailMessage::ENCODING_8BIT);
    
    
    
    try {
        pSession_->sendMessage(message);
        pSession_->close();
    } catch (Poco::Net::SMTPException &e) {
        qDebug() << e.displayText().c_str() << endl;
    }
    catch (Poco::Net::NetException &e) {
        qDebug() << e.displayText().c_str() << endl;
    }
    
    }
    

    When I run this, my app crashes at runtime, with the following error message on Qt console:

    libc++abi.dylib: terminating with uncaught exception of type Poco::Net::SSLException: SSL Exception
    
    

    The system generated Apple crash report shows something like this:

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib          0x9b7f369a __pthread_kill + 10
    1   libsystem_pthread.dylib         0x90a04f19 pthread_kill + 101
    2   libsystem_c.dylib               0x96861eee abort + 156
    3   libc++abi.dylib                 0x965782f9 abort_message + 169
    4   libc++abi.dylib                 0x9659b483 default_terminate_handler() + 272
    5   libc++abi.dylib                 0x96598ac0 std::__terminate(void (*)()) + 14
    6   libc++abi.dylib                 0x965986ee __cxa_rethrow + 103
    7   libPocoNetSSL.30.dylib          0x02c253ff Poco::Net::SecureSocketImpl::connectSSL(bool) + 943
    8   libPocoNetSSL.30.dylib          0x02c24fee Poco::Net::SecureSocketImpl::connect(Poco::Net::SocketAddress const&, bool) + 94
    9   libPocoNetSSL.30.dylib          0x02c28a61 Poco::Net::SecureStreamSocketImpl::connect(Poco::Net::SocketAddress const&) + 49
    10  libPocoNet.30.dylib             0x02b1368b Poco::Net::StreamSocket::connect(Poco::Net::SocketAddress const&) + 27
    

    The code fails at "pSSLSocket->connect(SocketAddress(host, port));" part.

    How do I fix this? Platform - OS X Yosemite 10.10.2, Qt 5.3.1 32 bit.

    question 
    opened by AttitudeMonger 32
  • Using Poco to send email without authentication

    Using Poco to send email without authentication

    A few days back, I raised a question- https://github.com/pocoproject/poco/issues/768 on how to send email with secure authentication via Poco. The final solution worked.

    Is it possible to send email without the auth part? That is, I will just mention the sender's email address (say {user-id}@amazon.com [my corporate Amazon Exchange mail account]), the receiver's address, the attachments and content? I want to skip the smtp server name, username, password (I can provide a port if necessary, but guess it is not needed in absence of host name).

    If so, can anyone guide me how? Almost all examples I have come across don't work, the one in the issue I raised worked after multiple iterations, that's why I am asking.

    question 
    opened by AttitudeMonger 25
  • Strange SocketAddress behavior in OSX

    Strange SocketAddress behavior in OSX

    I just downloaded the latest 1.5.2-release. Creating socket addresses in OSX is behaving very strangely. I have tested various ways of creating a socket address:

    SocketAddress addr1("0.0.0.0:9512");
    addr1.toString(); // returns: 0.2.37.40:0
    SocketAddress addr2("0.0.0.0:1234");
    addr2.toString(); // returns: 0.2.37.40:0
    SocketAddress addr3("192.168.1.1:1234");
    addr3.toString(); // returns: 0.2.4.210:0
    

    I have also tested other constructors:

    int port = 9512;
    IPAddress ip = IPAddress::wildcard(IPAddress:IPv4);
    ip.toString(); // returns 0.0.0.0 (ok!)
    SocketAddress addr(ip, port);
    addr.toString(); // returns 0.2.37.40:0
    

    Simple constructors for other classes cause strange outcomes as well:

    // throws Net Exception: 
    // Address family not supported
    ServerSocket socket(9512); 
    
    // throws Net Exception:
    // Cannot assign requested address: 0.2.37.39:0
    DatagramSocket(9512); 
    
    

    The same code worked as expected in 1.5.1.

    opened by pqvst 25
  • Complete Source IP address binding - combined

    Complete Source IP address binding - combined

    Fixes for:

    • HTTPClientSession to support dual IPv4/IPv6 family when setting source IP address #2271
    • HTTPClientSession not supporting binding source address for proxy connect #2270
    opened by roccocorsi 24
  • Add -DPOCO_HAVE_LIBRESOLV to Linux build configuration

    Add -DPOCO_HAVE_LIBRESOLV to Linux build configuration

    If I start my application with my wifi disabled I get "host not found" for anything like StreamSocket(SocketAddress("google.com:80")). If I let the application running in a loop trying to connect it keeps getting "host not found", that's OK, but when I enable my wifi back the application keeps returning "host not found".

    This doesn't happen if my application starts when my wifi is ON, then turned OFF and ON again. If the application starts with wifi OFF, it doesn't matter whether I turn wifi ON, it simply won't connect.

    enhancement fixed 
    opened by oblitum 24
  • Error when linking 32-bit on a 64-bit machine

    Error when linking 32-bit on a 64-bit machine

    When compiling 32-bit poco on a 64-bit machine (tested on Debian 7), link fails.

    1. The configure script is set with --cflags=-m32
    2. OSARCH_64BITS is set to 0
    3. POCO_TARGET_OSARCH is set to i386

    The compiler creates 32-bit object files, but the -m32 flag is missing from the g++ command when linking the libraries.

    FIX: It can be fixed by adding -m32 to SHLIBFLAGS in build/rules/global in case OSARCH_64BITS==0.

    opened by avishaib 24
  • Zip Decompress Parent Path Injection

    Zip Decompress Parent Path Injection

    By manipulation of the Zip input file header, the contents of the zip archive can be written to an arbitrary parent path of the user.

    Expected behavior

    Throw an exception if filename contains a parent directory reference. isValidPath() (ZipCommon.cpp) should check if the filename contains a tilde character.

    Actual behavior

    By inserting a tilde-slash (~/) in the filename area of the zip header, files can be written to the user's home directory.

    Steps to reproduce the problem

    Use the sample-unzip samle application as follows:

    $ ./sample-unzip -f vuln.zip SOME_OUT_DIR
    

    vuln.zip contains a file foo. foo includes the string bar

    vuln.zip hexdump:

    00000000  50 4b 03 04 0a 00 00 00  00 00 bb 91 5f 4b e9 b3  |PK.........._K..|
    00000010  a2 04 04 00 00 00 04 00  00 00 03 00 1c 00 7e 2f  |..............~/|
    00000020  6f 55 54 09 00 03 52 af  f8 59 4d af f8 59 75 78  |oUT...R..YM..Yux|
    00000030  0b 00 01 04 e8 03 00 00  04 e8 03 00 00 62 61 72  |.............bar|
    00000040  0a 50 4b 01 02 1e 03 0a  00 00 00 00 00 bb 91 5f  |.PK............_|
    00000050  4b e9 b3 a2 04 04 00 00  00 04 00 00 00 03 00 18  |K...............|
    00000060  00 00 00 00 00 01 00 00  00 b4 81 00 00 00 00 66  |...............f|
    00000070  6f 6f 55 54 05 00 03 52  af f8 59 75 78 0b 00 01  |ooUT...R..Yux...|
    00000080  04 e8 03 00 00 04 e8 03  00 00 50 4b 05 06 00 00  |..........PK....|
    00000090  00 00 01 00 01 00 49 00  00 00 41 00 00 00 00 00  |......I...A.....|
    000000a0
    

    After executing the program, a file o with the content bar is written in the home of the user.

    ~/o
    

    (o is just an example name)

    POCO version

    9288e89bfe13e9dbd8c77f558ceb623bf600ceb4

    Compiler and version

    clang version 4.0.1 (tags/RELEASE_401/final)

    Operating system and version

    4.13.9-300.fc27.x86_64 #1 SMP Mon Oct 23 13:41:58 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    Security implications

    Due to the current behavior of the Zip Decompress mechanism it is possible to write files in parent arbitrary user directories. For example, a manipulated .bashrc could be inserted into the user's home.

    Cheers -Stephan Zeisberg

    bug fixed security 
    opened by stze 22
  • Problems during compilation of Poco on Windows with MinGW and Cywgin

    Problems during compilation of Poco on Windows with MinGW and Cywgin

    Hi,

    I have a project in Qt that works perfectly with Poco libs on linux, I needed to test this project on Windows, so I install Poco on Windows (Virtual Machine).

    First I use Cygwin to compile it and the installation ended perfectly with no error what so ever, how ever when I try to run my project I got so errors that let me believe that something when wrong during the installation of Poco.

    Here are the errors I'm getting

    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:55: error: '_RC_DOWN' 
    was not declared in this scope
       FP_ROUND_DOWNWARD_IMPL   = _RC_DOWN
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:56: error: '_RC_UP' 
    was not declared in this scope
       FP_ROUND_UPWARD_IMPL     = _RC_UP
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:57: error: '_RC_NEAR' 
    was not declared in this scope
        FP_ROUND_TONEAREST_IMPL  = _RC_NEAR
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:58: error: '_RC_CHOP' 
    was not declared in this scope
       FP_ROUND_TOWARDZERO_IMPL = _RC_CHOP
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(float)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:97: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:103: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isInfiniteImpl(long double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:109: error: '_finite' 
    was not declared in this scope
      return _finite(value) == 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(float)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:115: error: '_isnan' 
    was not declared in this scope
      return _isnan(value) != 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:121: error: '_isnan' 
    was not declared in this scope
        return _isnan(value) != 0;
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:-1: In static member function 'static bool 
    Poco::FPEnvironmentImpl::isNaNImpl(long double)':
    
    C:\cygwin\usr\include\Poco\FPEnvironment_WIN32.h:127: error: '_isnan' 
    was not declared in this scope
      return _isnan(value) != 0;
    

    I also compiled with MinGW, same-thing happened the instalation ended perfectly but when I try to run my project I got the same error.

    Any ideas on what could be causing this error ??

    question 
    opened by Sujamm 21
  • Building without the bundled libraries

    Building without the bundled libraries

    SF442:

    On linux where I have installed pcre 8.30, when using POCO_UNBUNDLED, build fails, because Unicode.cpp uses bundled internal pcre files.

    when linking cpspc

    /home/abuild/rpmbuild/BUILD/poco-1.4.6p1-all/lib/Linux/x86_64/libPocoFoundation.so: undefined reference to `_pcre_ucd_stage1'
    /home/abuild/rpmbuild/BUILD/poco-1.4.6p1-all/lib/Linux/x86_64/libPocoFoundation.so: undefined reference to `_pcre_ucd_records'
    /home/abuild/rpmbuild/BUILD/poco-1.4.6p1-all/lib/Linux/x86_64/libPocoFoundation.so: undefined reference to `_pcre_ucp_gentype'
    /home/abuild/rpmbuild/BUILD/poco-1.4.6p1-all/lib/Linux/x86_64/libPocoFoundation.so: undefined reference to `_pcre_ucd_stage2'
    
    enhancement 
    opened by aleks-f 21
  • Getting error

    Getting error "ioctl and TIOCGWINSZ are not declared in the scope" in Solaris 10 during compilation

    On Solaris 10 x86 and sparc, below error is seen while building poco 1.11.3. ioctl function is not defined in sys/ioctl.h in Solaris 10. “TIOCGWINSZ” is also not declared in the header files included in https://github.com/pocoproject/poco/commit/4066c4d794704b43be40d758fc29c212f6c505fa.

    Error: src/Application.cpp: In static member function 'static Poco::Util::Application::WindowSize Poco::Util::Application::windowSize()': src/Application.cpp:338:17: error: aggregate 'Poco::Util::Application::windowSize()::winsize winsz' has incomplete type and cannot be defined struct winsize winsz; ^

    src/Application.cpp:339:18: error: 'TIOCGWINSZ' was not declared in this scope if (ioctl(0, TIOCGWINSZ , &winsz) != -1) ^ src/Application.cpp:339:37: error: 'ioctl' was not declared in this scope if (ioctl(0, TIOCGWINSZ , &winsz) != -1) ^ GCC version: 5.5.0 (using c++11)

    Config.txt

    Compiling using below options: ./configure --config=<< using attached config >> --prefix=<< install-dir >> --omit=Encodings,Net,NetSSL_OpenSSL,Data,Data/SQLite,Data/ODBC,Data/MySQL,Zip,PageCompiler,PageCompiler/File2Page,JWT,CppParser,PDF,MongoDB,Redis --include-path=<< openssl-include-path >> --library-path=<< openssl-lib-path >>

    Can you please help with this issue?

    opened by SowndharyaKs 0
  • EVPPKey does not fail if no password is set for a private key that requires a private key

    EVPPKey does not fail if no password is set for a private key that requires a private key

    EVPPKey does not fail if no password is set for a private key that requires a private key. Instead it goes to the default openssl callback routine which will prompt for the passphrase on the current terminal. The quote below is from the openssl man page for the PEM_read_bio_PrivateKey that is being used to read the private key.

    If both cb and u are NULL then the default callback routine is used which will typically prompt for the passphrase on the current terminal with echoing turned off.

    Is this the behavior that was intended? This breaks our application since the end user does not interact with a terminal.

    The "fix" would be to not set pPassword to a nullptr in the case where pass is an empty string. https://github.com/pocoproject/poco/blob/191cbdc97e1d9de023b8a65e0dc844911c06f6a8/Crypto/include/Poco/Crypto/EVPPKey.h#L252-L254

    enhancement 
    opened by zorane 1
  • JSON parser with

    JSON parser with "_allowComments" produces incorrect line numbers on error.

    Hi,

    The JSON parser when _allowComments is true, strips the comments from the JSON before parsing by erasing each character of the comment. It does not however preserve newlines so any errors will be assigned an incorrect line number.

    The following change to ParserImpl::stripComments fixes the issue by retaining newline characters:

    void ParserImpl::stripComments(std::string& json)
    {
    	if (_allowComments)
    	{
    		bool inString = false;
    		bool inComment = false;
    		char prevChar = 0;
    		std::string::iterator it = json.begin();
    		for (; it != json.end();)
    		{
    			if (*it == '"' && !inString) inString = true;
    			else inString = false;
    			if (!inString)
    			{
    				if (*it == '/' && it + 1 != json.end() && *(it + 1) == '*')
    					inComment = true;
    			}
    			if (inComment)
    			{
    				char c = *it;
    				//preserve line numbers by skipping the erasure of newline
    				if (c != '\n')
    				{
    					it = json.erase(it);
    
    					if (prevChar == '*' && c == '/')
    					{
    						inComment = false;
    						prevChar = 0;
    					}
    					else prevChar = c;
    				}
    				else
    				{
    					++it;
    					prevChar = 0;	//set prevChar to NULL so that it is not '*'
    				}
    			}
    			else ++it;
    		}
    	}
    }
    
    opened by Coder666 1
  • PollSet data race

    PollSet data race

    https://github.com/pocoproject/poco/blob/9d1c428c861f2e5ccf09149bbe8d2149720c5896/Net/src/PollSet.cpp#L172 _events is not protected by mutex, cause data race on PollSet destruction

    bug fixed pending 
    opened by aleks-f 2
Releases(poco-1.11.3-release)
  • poco-1.11.3-release(Jun 12, 2022)

  • poco-1.11.2-release(Apr 17, 2022)

  • poco-1.11.1-release(Nov 5, 2021)

    This is a maintenance release fixing a few issues in 1.11.0 and earlier releases, and upgrading bundled PCRE and SQLite to their latest versions. There are also some minor improvements to the GNU Make and CMake build systems. Upgrading is recommended.

    Issues closed: https://github.com/pocoproject/poco/milestone/39?closed=1

    Source code(tar.gz)
    Source code(zip)
  • poco-1.11.0-release(Jun 28, 2021)

    This release introduces ActiveRecord, a simple and lightweight object-relational mapping (ORM) framework based on the Active Record pattern and the Data library.

    Over 100 issues have been closed with this release. Updated bundled external libraries:

    • expat to 2.4.1
    • PCRE to 8.44
    • pdjson to latest master
    • SQLite to 3.35.5

    Issues closed: https://github.com/pocoproject/poco/milestone/38?closed=1

    Source code(tar.gz)
    Source code(zip)
  • poco-1.10.1-release(Feb 17, 2020)

    This is a maintenance release fixing issues that sneaked into the 1.10.0 release and also adding some minor features that did not make it into 1.10.0. Upgrading is recommended.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.10.0-release(Jan 27, 2020)

  • poco-1.9.4-release(Sep 18, 2019)

  • poco-1.9.3-release(Aug 20, 2019)

  • poco-1.9.2-release(Jul 2, 2019)

    This is a maintenance release that most importantly updates the bundled libexpat XML parser library to release 2.2.7, which fixes a potential vulnerability (CVE-2018-20843). The release also includes fixes to CMake when building on Windows with a Windows 10 SDK (mc.exe not found) and to the caching framework.

    Source code(tar.gz)
    Source code(zip)
  • poco-1.9.1-release(Jun 25, 2019)

  • poco-1.9.0-release(Apr 18, 2018)

A framework for building Mobile cross-platform UI

Weex A framework for building Mobile cross-platform UI. Distribution Support Android 4.1 (API 16), iOS 9.0+ and WebKit 534.30+. platform status Androi

Alibaba 17.9k Jun 26, 2022
SDK for building cross-platform desktop apps in ANSI-C

NAppGUI Cross-Platform C SDK. Build portable desktop applications for Windows, macOS and Linux, using just C. Quick start in Windows Prerequisites Vis

Francisco García Collado 194 Jun 23, 2022
Device Tree for Poco X3 Pro

Device Tree for Poco X3 Pro Poco X3 Pro (codename: "vayu") is a high-end smartphone from POCO. It was announced and released in March 2021. Device inf

null 2 Feb 11, 2022
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 112 May 19, 2022
Several single-file, cross-platform, public domain libraries for C/C++ that I use for learning / testing

HTC Several single-file, cross-platform, public domain libraries for C/C++ that I use for learning / testing (Not meant for production code). This is

Chris 8 Jun 28, 2022
The Leap Motion cross-format, cross-platform declarative serialization library

Introduction to LeapSerial LeapSerial is a cross-format, declarative, serialization and deserialization library written and maintained by Leap Motion.

Leap Motion (Ultraleap) 15 Jan 17, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 273 Jun 10, 2022
A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language.

Fastcode A perfect blend of C, Java, and Python tailored for those who desire a simple yet powerful programming language. FastCode is a procedural/str

null 27 May 31, 2022
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

Katy 1.9k Jun 24, 2022
seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (:

seg's WONDELFUL, INCREDIBLE and POWERFUL 16-bit CPU (: Not really ): This is just a tiny emulated ISA and CPU with an assembler, a simple debugg

null 18 Nov 8, 2021
Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library

lexpp Small Extremely Powerful Header Only C++ Lexical Analyzer/String Parser Library Lexpp is made with simplicity and size in mind. The entire libra

Jaysmito Mukherjee 49 Jun 21, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-value-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function comb

Netcan 32 May 15, 2022
Intuitive & Powerful C++20 consteval metaprogramming library(via value).

meta-list This library provides a bunch of consteval toolsets to do metaprogramming, and provides the pipeline syntactic sugar for function combinatio

Netcan 32 May 15, 2022
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.

Karabiner-Elements Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra or later. Download You can download Karabiner-E

null 14.8k Jul 1, 2022
A powerful duplicate file finder and an enhanced fork of 'fdupes'.

Introduction jdupes is a program for identifying and taking actions upon duplicate files. A WORD OF WARNING: jdupes IS NOT a drop-in compatible replac

Jody Bruchon 1.2k Jun 26, 2022
Read-Compile-Run-Loop: tiny and powerful interactive C++ compiler (REPL)

Read-Compile-Run-Loop: tiny and powerful interactive C++ compiler (REPL) RCRL is a tiny engine for interactive C++ compilation and execution (implemen

Viktor Kirilov 370 Jun 20, 2022
C++ For Creating Powerful Cheating Fortnite

Fortnite External If you want the full version of the source code you have to buy it, if you don't want to buy it you have to build it yourself. This

Achtzehn 28 Jun 25, 2022
C++ For Creating Powerful Cheating Fortnite

Fortnite External If you want the full version of the source code you have to buy it, if you don't want to buy it you have to build it yourself. This

Achtzehn 28 Jun 25, 2022
Quite powerful window manager for X

qpwm quite powerful window manager for X It's small floating window manager from not a programmer ?? Some features ?? Floating only. Fullscreen toggle

unxsh 71 Jun 27, 2022