CppCMS - High Performance C++ Web Framework

Overview

CppCMS - High Performance C++ Web Framework

What is CppCMS? CppCMS is a Free High Performance Web Development Framework (not a CMS) aimed at Rapid Web Application Development. It differs from most other web development frameworks like: Python Django, Java Servlets in the following ways:

  1. It is designed and tuned to handle extremely high loads.
  2. It uses modern C++ as the primary development language in order to achieve the first goal.
  3. It is designed for developing both Web Sites and Web Services.

Starting from version 1.2 it is available under MIT license.

Useful Links

Status

Build Status

Issues
  • Program produces 100% CPU load on one core

    Program produces 100% CPU load on one core

    Hi. I started working on a new web project and decided to check out this framework. I have to say: It's is really nice. I like it a lot.

    But here's the thing: When I start the application on my laptop everything works fine. My process explorer says that the application is sleeping and using less than 1 MiB of RAM. Then I load the first page => Process wakes up allocates RAM, does its thing and goes back to sleep. So far so good. But then it randomly decides, that now is the time to do some work. The CPU usage climbs to 12% (which is 1 core on full power on an octacore system) and stays there. I have no idea what the program is doing.

    Where do I start to debug?

    Thanks in advance. Martin

    (P.S. I'm on Debian 9.2)

    bug 
    opened by idkCpp 22
  • upstream sent unsupported FastCGI protocol version: 6 while reading upstream

    upstream sent unsupported FastCGI protocol version: 6 while reading upstream

    Unable to send big response (~223kb) from cppcms via fastcgi to nginx cppcms: cppcms, warning: Failed to write response:system: Connection reset by peer (http_response.cpp:305) NGINX (1.8.1): upstream sent unsupported FastCGI protocol version: 6 while reading upstream

    Changing nginx buffers does not help.

    the code flow is about this:

    cln_job->http_context->response().out() << body;
    cln_job->http_context->async_flush_output(
                            bind(&dispatcher_app::flush_output_handler,
                                 booster::intrusive_ptr<dispatcher_app>(this),
                                 std::placeholders::_1,
                                 cln_job));
    

    Inside flush_output_handler() i do

        job->http_context->async_complete_response();
        job->http_context.reset();
    

    immediately. It looks like the problem is here, but i can't find info on how to process big response.

    bug 
    opened by parihaaraka 16
  • submit post text is null when header contain content-type

    submit post text is null when header contain content-type

    issue found in http_request.cpp, method int request::on_content_progress(size_t n), at line 357

    if (!f->has_mime()) is error, right way is Judgment file type, please author affirm

    opened by edwinbest 7
  • Failing unittest

    Failing unittest

    ./test_locale_formatting

    Testing char, UTF-8 ----[1.31E1]!= ----[1.310E1] in 273 Error in line:273 (ss.str())==(to_correct_string("1.310E1",loc)) ----[3:33:13 PM Greenwich Mean Time]!= ----[3:33:13 PM GMT] in 325 Error in line:325 (ss.str())==(to_correct_string("3:33:13 PM GMT",loc)) ----[Thursday, February 5, 1970 at 3:33:13 PM Greenwich Mean Time]!= ----[Thursday, February 5, 1970 at 3:33:13 PM GMT] in 366 Error in line:366 (ss.str())==(to_correct_string("Thursday, February 5, 1970" " at" " 3:33:13 PM GMT",loc)) ----[Thursday, February 5, 1970 at 3:33:13 PM Greenwich Mean Time]!= ----[Thursday, February 5, 1970 at 3:33:13 PM GMT] in 414 Error in line:414 (ss.str())==(to_correct_string(result[i],loc)) ----[Greenwich Mean Time]!= ----[GMT] in 414 Error in line:414 (ss.str())==(to_correct_string(result[i],loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 ((booster::locale::basic_format(fmt) % 13.1).str(loc))==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 ((booster::locale::basic_format(fmt) % 13.1).str(loc))==(to_correct_string("1.310E1",loc)) Testing char, ISO8859-1 ----[1.31E1]!= ----[1.310E1] in 273 Error in line:273 (ss.str())==(to_correct_string("1.310E1",loc)) ----[3:33:13 PM Greenwich Mean Time]!= ----[3:33:13 PM GMT] in 325 Error in line:325 (ss.str())==(to_correct_string("3:33:13 PM GMT",loc)) ----[Thursday, February 5, 1970 at 3:33:13 PM Greenwich Mean Time]!= ----[Thursday, February 5, 1970 at 3:33:13 PM GMT] in 366 Error in line:366 (ss.str())==(to_correct_string("Thursday, February 5, 1970" " at" " 3:33:13 PM GMT",loc)) ----[Thursday, February 5, 1970 at 3:33:13 PM Greenwich Mean Time]!= ----[Thursday, February 5, 1970 at 3:33:13 PM GMT] in 414 Error in line:414 (ss.str())==(to_correct_string(result[i],loc)) ----[Greenwich Mean Time]!= ----[GMT] in 414 Error in line:414 (ss.str())==(to_correct_string(result[i],loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 448 Error in line:448 ((booster::locale::basic_format(fmt) % 13.1).str(loc))==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 (ss.str())==(to_correct_string("1.310E1",loc)) ----[1.31E1]!= ----[1.310E1] in 449 Error in line:449 ((booster::locale::basic_format(fmt) % 13.1).str(loc))==(to_correct_string("1.310E1",loc)) Failed Error limits reached, stopping unit test

    bug 
    opened by hellow554 6
  • filter_test fails in Debian 8 BeagleBone

    filter_test fails in Debian 8 BeagleBone

    However it works in Debian 8 x64 (both updated the same day). It's the only test that fails.

    From log: 19/104 Test: filter_test Command: "/mnt/cppcms_git/build/filter_test" "-c" "/mnt/cppcms_git/tests/filter_test.js" "--test-exec=/usr/bin/python2 /mnt /cppcms_git/tests/filter_test.py" Directory: /mnt/cppcms_git/build "filter_test" start time: Jul 03 16:08 UTC Output:

    FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 GET /upload/no_content Got {'status': 200, 'no_content': 1, 'is_html': False} POST /upload?l_1=10&f_1=a&l_2=20&f_2=t Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 0, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=10&f_1=a&l_2=20&f_2=t&chunks=5 Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 9, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=10000&f_1=a&l_2=20000&f_2=t Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 3, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=0&setbuf=10&at=1 Got {'status': 501, 'content': '\r\n\r\n

    501 Not Implemented

    \r\n\r\n\r\n', 'is_html': True} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=1&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=2&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=3&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=0&setbuf=10&at=1 Got {'status': 502, 'content': '\r\n\r\n

    502 Bad Gateway

    \r\n\r\n\r\n', 'is_html': True} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=1&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=2&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=3&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_upload_progress&how=0&setbuf=10&at=1 Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 5, 'on_new_file': 1, 'on_data_ready': 1, 'post': 0, 'total': 1, 'files': 1} Traceback (most recent call last): File "/mnt/cppcms_git/tests/filter_test.py", line 262, in test_upload() File "/mnt/cppcms_git/tests/filter_test.py", line 180, in test_upload test(r['status']==code) File "/mnt/cppcms_git/tests/filter_test.py", line 16, in test raise RuntimeError("Failed") RuntimeError: Failed FAILED Test time = 3.48 sec

    From manual run:

    /mnt/cppcms_git/build/filter_test -c /mnt/cppcms_git/tests/filter_test.js --test-exec="/usr/bin/python2 /mnt/cppcms_git/tests/filter_test.py"

    GET /upload/no_content Got {'status': 200, 'no_content': 1, 'is_html': False} POST /upload?l_1=10&f_1=a&l_2=20&f_2=t Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 0, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=10&f_1=a&l_2=20&f_2=t&chunks=5 Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 9, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=10000&f_1=a&l_2=20000&f_2=t FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 3, 'on_new_file': 2, 'on_data_ready': 2, 'post': 0, 'total': 2, 'files': 2} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=0&setbuf=10&at=1 Got {'status': 501, 'content': '\r\n\r\n

    501 Not Implemented

    \r\n\r\n\r\n', 'is_html': True} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=1&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=2&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_headers_ready&how=3&setbuf=10&at=1 Got {'status': 501, 'at': 'on_headers_ready', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=0&setbuf=10&at=1 Got {'status': 502, 'content': '\r\n\r\n

    502 Bad Gateway

    \r\n\r\n\r\n', 'is_html': True} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=1&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=2&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_new_file&how=3&setbuf=10&at=1 Got {'status': 502, 'at': 'on_new_file', 'is_html': False} POST /upload?l_1=50&f_1=a&abort=on_upload_progress&how=0&setbuf=10&at=1 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 FAIL: size_t(input_file.size()) << ref.size() in line: 115 Got {'status': 200, 'on_end_of_content': 1, 'is_html': False, 'on_upload_progress': 5, 'on_new_file': 1, 'on_data_ready': 1, 'post': 0, 'total': 1, 'files': 1} Traceback (most recent call last): File "/mnt/cppcms_git/tests/filter_test.py", line 262, in test_upload() File "/mnt/cppcms_git/tests/filter_test.py", line 180, in test_upload test(r['status']==code) File "/mnt/cppcms_git/tests/filter_test.py", line 16, in test raise RuntimeError("Failed") RuntimeError: Failed FAILED

    Environment:

    cat /etc/issue

    Debian GNU/Linux 8 \n \l

    BeagleBoard.org Debian Image 2016-12-09

    Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

    default username:password is [debian:temppwd]

    The IP Address for eth0 is: 192.168.3.104 The IP Address for usb0 is: 192.168.7.2

    uname -a

    Linux bbb-0 4.4.36-ti-r72 #1 SMP Wed Dec 7 22:29:53 UTC 2016 armv7l GNU/Linux

    gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.9.2 (Debian 4.9.2-10)

    bug 
    opened by fquindos 6
  • Error build view.cpp in Mac

    Error build view.cpp in Mac

    In Ubuntu 16.04, it built correctly, but in Mac it show error like this:

    Undefined symbols for architecture x86_64:
      "cppcms::url_mapper::map(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*)", referenced from:
          bootstrap_skin::layouts_app_dashboard::wrapper_content() in view.cpp.o
      .........
    typeinfo for app::core::View in view.cpp.o
      "typeinfo for cppcms::base_view", referenced from:
          typeinfo for bootstrap_skin::layouts_app in view.cpp.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    My view code:

    <% c++ #include "app/views/layouts/app/dashboard.h" %>                              
    <% skin bootstrap_skin %>                                                           
    <% view layouts_app_dashboard uses views::layouts::app::Dashboard extends layouts_app %>
    <% template dashboard_js() %><% end %>                                              
    <% template dashboard_css() %><% end %>                                             
    <% template css() %>                                                                
      <link rel="stylesheet" href="<%= asset("bootstrap/css/bootstrap.min.css") %>" />
      <% include dashboard_css() %>                                                     
    <% end %>                                                                           
    <% template js() %>                                                                 
      <script type="text/javascript" src="<%= asset("js/jquery-3.2.1.min.js") %>"></script>
      <script type="text/javascript" src="<%= asset("tether/js/tether.min.js") %>"></script>
      <script type="text/javascript" src="<%= asset("bootstrap/js/bootstrap.min.js") %>"></script>
      <% include dashboard_js() %>                                                      
    <% end %>                                                                           
    <% template layouts_dashboard_content() %><% end %>                                 
    <% template wrapper_content() %>                                                    
      <nav class="navbar navbar-inverse bg-inverse">                                    
        <div class="container text-right">                                              
        ¦ <a class="btn btn-sm align-middle btn-primary" href="<% url "login" %>">Đăng nhập</a>
        ¦ <a class="btn btn-sm align-middle btn-success" href="<% url "register" %>">Đăng kí</a>
        </div>                                                                          
      </nav>                                                                            
      <% include layouts_dashboard_content() %>                                         
                                                                                        
    <% end template %>                                                                  
    <% end view %>                                                                      
    <% end skin %>  
    
    opened by HadesD 5
  • cppcms::json crashes

    cppcms::json crashes

    file t.cpp which is compilable and executable:

    #include <cppcms/json.h>
    #include <iostream>
    
    typedef std::map<std::string,std::string> bts;
    
    int main(int argc,char **argv)
    {
    	std::map<int,std::pair<cppcms::json::array,bts> > ss;
    	for(int i=1;i <= 5;++i){
    		auto ret=ss.emplace(std::make_pair(5,std::make_pair(cppcms::json::array(),bts())));
    		auto &ps=ret.first->second.first;
    		if(ret.second){ //Insert succeeded.
    			ps.resize(2);
    			ps[0]=cppcms::json::array();
    			auto &sp=ps[0].array();
    			sp.resize(6);
    			sp[0]=std::string("a");
    			sp[1]="b";
    			sp[2]=true;
    			sp[3]=0;
    			sp[4]=12;
    			//sp[5]=false; //TODO:Why does not crash here?
    			ps[1]=cppcms::json::array();
    			cppcms::json::array ts;
    			ts.push_back(std::string("a"));
    			ts.push_back(14);
    			cppcms::json::array params;
    			for(int j=1;j <= 2;++j){
    				cppcms::json::array pi;
    				pi.push_back(std::string("c"));
    				pi.push_back(1);
    				params.push_back(pi);
    			}
    			if(!params.empty())
    				ts.push_back(params);
    			ps.push_back(ts);
    			sp[5]=false; //TODO:Why crashes here?
    		}
    		ps[1].array().push_back(cppcms::json::array());
    		auto &tb=ps[1].array().back().array();
    		tb.resize(8);
    		tb[0]=std::string("a");
    		tb[1]="a";
    		tb[2]=30;
    		tb[3]=cppcms::json::null();
    		tb[4]="b";
    		tb[5]="c";
    		tb[6]=cppcms::json::null();
    		tb[7]=cppcms::json::null();
    	}
    	std::cerr << "done" << std::endl;
    	return 0;
    }
    

    gdb output:

    Starting program: /home/u2/tmp/cppcms_json/a.out 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    
    Program received signal SIGABRT, Aborted.
    __GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
    
    ===backtrack===
    
    #0  __GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    #1  0x00007ffff6e1242a in __GI_abort () at abort.c:89
    #2  0x00007ffff6e4ec00 in __libc_message ([email protected]=2, 
        [email protected]=0x7ffff6f43d98 "*** Error in `%s': %s: 0x%s ***\n")
        at ../sysdeps/posix/libc_fatal.c:175
    #3  0x00007ffff6e54fc6 in malloc_printerr (action=3, 
        str=0x7ffff6f441a0 "malloc(): memory corruption (fast)", ptr=<optimized out>, 
        ar_ptr=<optimized out>) at malloc.c:5049
    #4  0x00007ffff6e57491 in _int_malloc ([email protected]=0x7ffff7177b00 <main_arena>, 
        [email protected]=56) at malloc.c:3424
    #5  0x00007ffff6e58f64 in __GI___libc_malloc (bytes=56) at malloc.c:2928
    #6  0x00007ffff77277a8 in operator new(unsigned long) ()
       from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    #7  0x00007ffff7b01b76 in booster::copy_ptr<cppcms::json::value::_data>::copy_ptr (
        other=..., this=0x5555557724b8)
        at /home/u2/www/resource/src/cppcms/booster/booster/copy_ptr.h:28
    #8  cppcms::json::value::copyable::copyable (this=0x5555557724b8, r=...)
        at /home/u2/www/resource/src/cppcms/src/json.cpp:311
    #9  0x00007ffff7b01c88 in cppcms::json::value::value (other=..., 
        this=<optimized out>) at /home/u2/www/resource/src/cppcms/cppcms/json.h:515
    #10 std::_Construct<cppcms::json::value, cppcms::json::value const&> (
        __p=<optimized out>) at /usr/include/c++/6/bits/stl_construct.h:75
    #11 std::__uninitialized_copy<false>::__uninit_copy<__gnu_cxx::__normal_iterator<cppcms::json::value const*, std::vector<cppcms::json::value, std::allocator<cppcms::json::value> > >, cppcms::json::value*> (__result=0x5555557724b0, __last=..., 
        __first=...) at /usr/include/c++/6/bits/stl_uninitialized.h:75
    #12 std::uninitialized_copy<__gnu_cxx::__normal_iterator<cppcms::json::value const*, std::vector<cppcms::json::value, std::allocator<cppcms::json::value> > >, cppcms::json::value*> (__result=<optimized out>, __last=..., __first=...)
        at /usr/include/c++/6/bits/stl_uninitialized.h:126
    #13 std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<cppcms::json::value const*, std::vector<cppcms::json::value, std::allocator<cppcms::json::value> > >, cppcms::json::value*, cppcms::json::value> (__result=<optimized out>, __last=..., 
        __first=...) at /usr/include/c++/6/bits/stl_uninitialized.h:281
    #14 std::vector<cppcms::json::value, std::allocator<cppcms::json::value> >::vector (
        __x=..., this=0x555555771560) at /usr/include/c++/6/bits/stl_vector.h:324
    #15 cppcms::json::variant::create (other=..., t=<optimized out>, 
        this=0x555555771560) at /home/u2/www/resource/src/cppcms/src/json.cpp:257
    #16 cppcms::json::variant::variant (other=..., this=0x555555771560)
        at /home/u2/www/resource/src/cppcms/src/json.cpp:140
    #17 cppcms::json::value::_data::_data (this=0x555555771560)
        at /home/u2/www/resource/src/cppcms/src/json.cpp:286
    #18 booster::copy_ptr<cppcms::json::value::_data>::copy_ptr (other=..., 
        this=0x555555771b28)
        at /home/u2/www/resource/src/cppcms/booster/booster/copy_ptr.h:28
    #19 cppcms::json::value::copyable::copyable (this=0x555555771b28, r=...)
        at /home/u2/www/resource/src/cppcms/src/json.cpp:311
    #20 0x000055555555653d in cppcms::json::value::value (this=0x555555771b28, 
        other=...) at /usr/local/include/cppcms/json.h:515
    #21 0x0000555555558bd3 in std::_Construct<cppcms::json::value, cppcms::json::value const&> (__p=0x555555771b28, __args#0=...)
        at /usr/include/c++/6/bits/stl_construct.h:75
    #22 0x0000555555559189 in std::__uninitialized_copy<false>::__uninit_copy<cppcms::json::value const*, cppcms::json::value*> (__first=0x555555771c78, 
        __last=0x555555771c80, __result=0x555555771b20)
        at /usr/include/c++/6/bits/stl_uninitialized.h:75
    #23 0x0000555555558ec3 in std::uninitialized_copy<cppcms::json::value const*, cppcms::json::value*> (__first=0x555555771c70, __last=0x555555771c80, 
        __result=0x555555771b20) at /usr/include/c++/6/bits/stl_uninitialized.h:126
    #24 0x0000555555558aaf in std::__uninitialized_copy_a<cppcms::json::value const*, cppcms::json::value*, cppcms::json::value> (__first=0x555555771c70, 
        __last=0x555555771c80, __result=0x555555771b20)
        at /usr/include/c++/6/bits/stl_uninitialized.h:281
    #25 0x0000555555558212 in std::__uninitialized_move_if_noexcept_a<cppcms::json::value*, cppcms::json::value*, std::allocator<cppcms::json::value> > (
        __first=0x555555771c70, __last=0x555555771c80, __result=0x555555771b20, 
        __alloc=...) at /usr/include/c++/6/bits/stl_uninitialized.h:304
    #26 0x00005555555583a1 in std::vector<cppcms::json::value, std::allocator<cppcms::json::value> >::_M_emplace_back_aux<cppcms::json::value>(cppcms::json::value&&) (
        this=0x555555772300, 
        __args#0=<unknown type in /home/u2/tmp/cppcms_json/a.out, CU 0x0, DIE 0xee5e>) at /usr/include/c++/6/bits/vector.tcc:420
    #27 0x0000555555557723 in std::vector<cppcms::json::value, std::allocator<cppcms::json::value> >::emplace_back<cppcms::json::value>(cppcms::json::value&&) (
        this=0x555555772300, 
        __args#0=<unknown type in /home/u2/tmp/cppcms_json/a.out, CU 0x0, DIE 0xee5e>) at /usr/include/c++/6/bits/vector.tcc:101
    #28 0x0000555555556d54 in std::vector<cppcms::json::value, std::allocator<cppcms::json::value> >::push_back(cppcms::json::value&&) (this=0x555555772300, 
        __x=<unknown type in /home/u2/tmp/cppcms_json/a.out, CU 0x0, DIE 0xe953>)
        at /usr/include/c++/6/bits/stl_vector.h:933
    #29 0x0000555555555e0a in main (argc=1, argv=0x7fffffffe398) at t.cpp:39
    
    opened by terarows 4
  • What is the recommanded way of testing a cppcms::application?

    What is the recommanded way of testing a cppcms::application?

    Hello,

    I have a REST server implemented as a cppcms::application. I would like to add some tests for it. I don't really want to do a network request, but only set the application context, call the main method and check the response. Is it possible? What would you recommand?

    What I have tried so far:

    1. Create a new cppcms::service.
    2. Create a new cppcms::application <-- my REST server
    3. Call application.main("url_path")
    4. Check application.response()

    Between 2) and 3) I probably need to call cppcms::application::assign_context(). But there is no way to create one as its constructor depends on impl::cgi::connection.

    opened by ArthurSonzogni 4
  • Replace std::auto_ptr in the public part of API with std::unique_ptr.

    Replace std::auto_ptr in the public part of API with std::unique_ptr.

    As we know, std::auto_ptr was deprecated in C++11 and fully removed in C++17. While it is still possible to build CppCMS without using C++17, std::auto_ptr uses in the public part of API causing compilation errors if C++17 is a must. That's why, in the current form, there is no way to use CppCMS alongside C++17 header-only libraries.

    In order to fix this problem, we can replace std::auto_ptr with std::unique_ptr in all public header files (i.e., the files which are installed into include/ dir). Then, we can proceed with replacement until the codebase can be compiled without any compilation errors.

    In this patch, following steps are followed:

    • Prune std::auto_ptr from public header files.
    • Modify private header files and declaration in source files to match public part.
    • Modify function/template implementation and preprocessor macros until all compilation errors eliminated.
    • After modifications, run tests again to ensure there is no illegal pointer dereferencing.
    opened by ncnxc 3
  • cppdb: show tables like query arguments not bound

    cppdb: show tables like query arguments not bound

    The following:

    #include <iostream>
    #include <cppdb/frontend.h>
    
    int main() {
            std::string dbcs ="mysql:database=mydb;user=myuser;password=mypassword;@pool_size=10;set_charset_name=utf8";
            auto sql = cppdb::session(dbcs);
            cppdb::result res;
            std::string table("my_table");
            res = sql << "SHOW TABLES LIKE ?" << table;
            res.next();
    }
    

    produces:

    terminate called after throwing an instance of 'cppdb::mysql_backend::cppdb_myerror' what(): cppdb::mysql::You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1 Aborted

    The same code but with a different query (e.g. a SELECT query) can properly bind the arguments, but for some reason, the 'show tables' query above does not work with bound arguments.

    Also, could cppdb_myerror output the full query? I checked the cppdb source code and I couldn't see any obvious way to have a more detailed error message being thrown. However, when developing an application, it is sometimes hard to debug code and queries because the exact query which causes to throw is not displayed. Above is a good example of that: the error thrown tell about "the right syntax to use near '?' ", but it does not show the actually query "SHOW TABLES LIKE ?".
    How hard would it be for the full query to be thrown together with the error?

    opened by dreaming-augustin 3
  • Tests fail on Lubuntu 16.04

    Tests fail on Lubuntu 16.04

    Following is the excerpt from test:

    The following tests FAILED:
    	  5 - storage_test (Failed)
    	 22 - status_test (Failed)
    	 23 - pool_test (Failed)
    	 24 - filter_test (Failed)
    	 25 - async_status_test (Failed)
    	 26 - form_test (Failed)
    	 27 - cookie_test (Failed)
    	 28 - internal_forwarder_test (Failed)
    	 29 - forwarder_test (Failed)
    	 30 - jsonrpc_test (Failed)
    	 31 - http_timeouts_test_read (Failed)
    	 32 - http_timeouts_test_write (Failed)
    	 33 - file_server_test (Failed)
    	 34 - file_server_test_no_links (Failed)
    	 35 - file_server_with_listing_test (Failed)
    	 36 - file_server_test_async (Failed)
    	 37 - file_server_test_no_links_async (Failed)
    	 38 - file_server_with_listing_test_async (Failed)
    	 39 - disco_test_http (Failed)
    	 40 - disco_test_fastcgi_tcp (Failed)
    	 41 - disco_test_scgi_tcp (Failed)
    	 42 - secure_post_test (Failed)
    	 45 - gzip_test (Failed)
    	 47 - cppcms_service_test (Failed)
    	 49 - session_interface_test_client_renew (Failed)
    	 50 - session_interface_test_client_browser (Failed)
    	 51 - session_interface_test_client_fixed (Failed)
    	 52 - session_interface_test_server_renew (Failed)
    	 53 - session_interface_test_server_browser (Failed)
    	 54 - session_interface_test_server_fixed (Failed)
    	 55 - session_interface_test_both_renew (Failed)
    	 56 - session_interface_test_both_browser (Failed)
    	 57 - session_interface_test_both_fixed (Failed)
    	 58 - proto_test_async_http (Failed)
    	 59 - proto_test_async_scgi (Failed)
    	 60 - proto_test_async_fastcgi (Failed)
    	 63 - proto_test_sync_http (Failed)
    	 64 - proto_test_sync_scgi (Failed)
    	 65 - proto_test_sync_fastcgi (Failed)
    	 68 - proto_test_nonblocking_http (Failed)
    	 69 - proto_test_nonblocking_scgi (Failed)
    	 70 - proto_test_nonblocking_fastcgi (Failed)
    	 73 - loadable_storage_pass (Failed)
    	 90 - test_aio_socket (Failed)
    	 91 - test_aio_endpoint (Failed)
    	 93 - test_aio_prefork (Failed)
    Errors while running CTest
    

    GCC is 5.4.0 the stock compiler and libraries are all default libraries.

    opened by shivshankardayal 3
  • request().files() in Input content filtering

    request().files() in Input content filtering

    client:

    let fd=new FormData();
    fd.append('name','myname');
    fd.append('image',e.target.files[0]);
    fetch('/upload',{method:'POST',body:fd});
    

    server:

    !request().files().empty() used to return true within the block if(!request().is_ready()). Recently it started to return true within the block if(request().is_ready()).

    Exactly where should the check if(!request().files().empty()) be done?

    Thank you in advance!

    class my_upload: public cppcms::application {
    public:
    void main(std::string path) {
    	if(!request().is_ready()) {
    		session().load();
    		if(!request().files().empty()){ //Used to be true
    			request().files()[0]->set_temporary_directory("/tmp/uploads");
    			request().files()[0]->set_memory_limit(512);
    		}
    	}
    	else {
    		if(!request().files().empty()){ //Is true now.
    			request().files()[0]->set_temporary_directory("/tmp/uploads");
    			request().files()[0]->set_memory_limit(512);
    		}
    		release_context()->submit_to_pool();
    	}
    };
    
    opened by masaoliou 0
  • Using object in html to get SVG file

    Using object in html to get SVG file

    I am trying to render geo map by using next command:

    <object type="image/svg+xml" data="/media/svg/map.svg" width="500" height="500" ></object>
    

    But map is not rendered... At the same time, if I use this command in HTML file locally, is works fine.

    opened by poteryaevks 0
  •  Have a lot of errors C2440: static_cast: невозможно преобразовать

    Have a lot of errors C2440: static_cast: невозможно преобразовать "const CharType *" в "const char *"

    1>------ Сборка начата: проект: boost_locale, Конфигурация: Debug x64 ------ 1>message.cpp 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(439,1): error C2440: static_cast: невозможно преобразовать "const CharType *" в "const char *" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(439,37): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(431): message : во время компиляции функции-члена класс шаблон "size_t boost::locale::gnu_gettext::hash_function::operator ()(const boost::locale::gnu_gettext::message_key &) const" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\boost\boost_1_68_0\boost/unordered/detail/implementation.hpp(2623): message : выполняется компиляция ссылки на экземпляр шаблон функции "size_t boost::locale::gnu_gettext::hash_function::operator ()(const boost::locale::gnu_gettext::message_key &) const" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\boost\boost_1_68_0\boost/type_traits/is_nothrow_move_assignable.hpp(29): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::locale::gnu_gettext::hash_function" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\boost\boost_1_68_0\boost/unordered/detail/implementation.hpp(2739): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::is_nothrow_move_assignable" 1> with 1> [ 1> H=boost::locale::gnu_gettext::hash_function<wchar_t> 1> ] 1>D:\boost\boost_1_68_0\boost/unordered/detail/implementation.hpp(2902): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::unordered::detail::functions<boost::locale::gnu_gettext::hash_function,std::equal_to>" 1> with 1> [ 1> CharType=wchar_t, 1> K=boost::locale::gnu_gettext::message_key<wchar_t> 1> ] 1>D:\boost\boost_1_68_0\boost/unordered/unordered_map.hpp(60): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::unordered::detail::table<boost::unordered::detail::map<A,K,T,H,P>>" 1> with 1> [ 1> A=std::allocator<std::pair<const boost::locale::gnu_gettext::message_key<wchar_t>,std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>>>, 1> K=boost::locale::gnu_gettext::message_key<wchar_t>, 1> T=std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>, 1> H=boost::locale::gnu_gettext::hash_function<wchar_t>, 1> P=std::equal_to<boost::locale::gnu_gettext::message_key<wchar_t>> 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(733): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::unordered::unordered_map<boost::locale::gnu_gettext::message_key,std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::locale::gnu_gettext::hash_function,std::equal_to,std::allocator<std::pair<const K,T>>>" 1> with 1> [ 1> CharType=wchar_t, 1> K=boost::locale::gnu_gettext::message_key<wchar_t>, 1> T=std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(723): message : во время компиляции функции-члена класс шаблон "std::pair<const CharType *,const CharType *> boost::locale::gnu_gettext::mo_message::get_string(int,const wchar_t *,const wchar_t *) const" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(512): message : выполняется компиляция ссылки на экземпляр шаблон функции "std::pair<const CharType *,const CharType *> boost::locale::gnu_gettext::mo_message::get_string(int,const wchar_t *,const wchar_t *) const" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(760): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "boost::locale::gnu_gettext::mo_message<wchar_t>" 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(440,1): error C2440: static_cast: невозможно преобразовать "const CharType *" в "const char *" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(440,37): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(438,52): error C2661: boost::locale::gnu_gettext::pj_winberger_hash::update_state: нет перегруженной функции, принимающей 1 аргументов 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(448,1): error C2440: static_cast: невозможно преобразовать "const CharType *" в "const char *" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(448,33): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(449,1): error C2440: static_cast: невозможно преобразовать "const CharType *" в "const char *" 1> with 1> [ 1> CharType=wchar_t 1> ] 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(449,33): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции 1>D:\cppcms\boost_locale_4.0.0\libs\locale\src\shared\message.cpp(447,48): error C2661: boost::locale::gnu_gettext::pj_winberger_hash::update_state: нет перегруженной функции, принимающей 1 аргументов 1>Сборка проекта "boost_locale.vcxproj" завершена с ошибкой. ========== Сборка: успешно: 0, с ошибками: 1, без изменений: 1, пропущено: 0 ==========

    opened by officefish 0
  • [Docker] Tests fails at aio_socket IPV6 and locale_format/boundary

    [Docker] Tests fails at aio_socket IPV6 and locale_format/boundary

    Hi I'm trying to create a Dockerfile that runs a CppCMS application in a NGINX web server. However, the command make tests always returns that the tests fail at test_locale_format , test_locale_boundary and test_aio_socket . The two first are solved by applying the option -DDISABLE_ICU_LOCALE=ON. I checked if the image has some services using the port 8080, but it's not the case.

    cppcms_test_fail

    Specifications:

    • OS: nginx:1.19.7 : Docker image with nginx in Debian OS
    • Docker-Compose file
    version: "3.9"
    services: 
      app:    
        build:
          context: "./app"
          dockerfile: ".docker/Dockerfile"
        volumes:
          - ./app:/etc/nginx/sites-available/
        ports: 
          - "8090:8080"
    
    • Dockerfile:
    FROM nginx:1.19.7
    
    
    RUN apt-get update && \
       apt-get install -y --no-install-recommends \
       build-essential git cmake libpcre3-dev zlib1g-dev libgcrypt20-dev libicu-dev python 
    
    ENV CTEST_OUTPUT_ON_FAILURE=1
    
    WORKDIR /etc/nginx/sites-available/app/
    
    COPY /cppcms ./lib/cppcms
    
    RUN cd ./lib/cppcms/build && \
       cmake -DDISABLE_ICU_LOCALE=ON .. && \
       make && \
       make test && \
       make install
    
    
    RUN c++ hello.cpp -lcppcms -o hello
    
    CMD ["./hello" "-c" "config/config.js"]
    
    • CMAKE output

    -- The C compiler identification is GNU 8.3.0 -- The CXX compiler identification is GNU 8.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for newlocale -- Looking for newlocale - found -- Performing Test LIBC_ICONV -- Performing Test LIBC_ICONV - Success -- Performing Test GCC_IS_GCC4 -- Performing Test GCC_IS_GCC4 - Success -- Looking for dlopen -- Looking for dlopen - not found -- Looking for socket -- Looking for socket - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Performing Test BOOSTER_HAS_GCC_SYNC -- Performing Test BOOSTER_HAS_GCC_SYNC - Success -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD - Failed -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD - Success -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_EXECINFO -- Performing Test BOOSTER_HAVE_EXECINFO - Success -- Performing Test BOOSTER_HAVE_UNWIND_BACKTRACE -- Performing Test BOOSTER_HAVE_UNWIND_BACKTRACE - Success -- Performing Test BOOSTER_HAVE_UNWIND_BACKTRACE_BUILTIN -- Performing Test BOOSTER_HAVE_UNWIND_BACKTRACE_BUILTIN - Failed -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_STDINT_H -- Performing Test BOOSTER_HAVE_STDINT_H - Success -- Performing Test BOOSTER_HAVE_INTTYPES_H -- Performing Test BOOSTER_HAVE_INTTYPES_H - Success -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 - Success -- Performing Test HAVE_WINDOWS6_API -- Performing Test HAVE_WINDOWS6_API - Failed -- Performing Test CPPCMS_HAVE_STDINT_H -- Performing Test CPPCMS_HAVE_STDINT_H - Success -- Performing Test CPPCMS_HAVE_INTTYPES_H -- Performing Test CPPCMS_HAVE_INTTYPES_H - Success -- Looking for atoll -- Looking for atoll - found -- Looking for _atoi64 -- Looking for _atoi64 - not found -- Looking for snprintf -- Looking for snprintf - found -- Looking for stat -- Looking for stat - found -- Looking for _stat -- Looking for _stat - not found -- Performing Test CPPCMS_HAVE_STD_WSTRING -- Performing Test CPPCMS_HAVE_STD_WSTRING - Success -- Performing Test CPPCMS_HAVE_BSD_TM -- Performing Test CPPCMS_HAVE_BSD_TM - Success -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING - Success -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO - Success -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE - Success -- Performing Test CPPCMS_HAVE_GCC_TYPEOF -- Performing Test CPPCMS_HAVE_GCC_TYPEOF - Success -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF - Success -- Performing Test CPPCMS_HAVE_FSEEKO -- Performing Test CPPCMS_HAVE_FSEEKO - Success -- Performing Test CPPCMS_HAVE_FSEEKI64 -- Performing Test CPPCMS_HAVE_FSEEKI64 - Failed -- Looking for dlopen -- Looking for dlopen - not found -- Looking for dlopen in dl -- Looking for dlopen in dl - found -- Looking for socket -- Looking for socket - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for canonicalize_file_name -- Looking for canonicalize_file_name - found -- Looking for pthread_mutexattr_setpshared -- Looking for pthread_mutexattr_setpshared - not found -- Looking for pthread_mutexattr_setpshared in /usr/lib/x86_64-linux-gnu/libpthread.so -- Looking for pthread_mutexattr_setpshared in /usr/lib/x86_64-linux-gnu/libpthread.so - found

    opened by theGitpster45 1
  • Making a file upload optional in a form

    Making a file upload optional in a form

    I currently have a form in my application, but if I don't upload a file in the form the form will fail to validate. Here are the relevant parts of my content.h

    struct submit_op_form : public cppcms::form {
      cppcms::widgets::file image;
      submit_op_form() {
        image.limits(0,500*1024);
        image.mime(booster::regex("(image/(png|jpeg))|$")); //Allow mimetypes of either image/png or image/jpeg
    
        image.filename(booster::regex("([_a-zA-Z0-9]+\\.(png|jpg|jpeg))")); //Allow filenames of the form [text consisting of alphanumeric characters].png/jpg/jpeg
        image.mime(booster::regex("(image/(png|jpeg))")); //Allow mimetypes of either image/png or image/jpeg
        image.add_valid_magic("\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"); //magic numbers for png files
        image.add_valid_magic("\xff\xd8"); //magic numbers for jpeg files
        image.add_valid_magic("");
        add(image);
      }
      virtual bool validate() {
        if (!form::validate()) {
    	return false;
        }
        return true;
      }
    };
    

    More specifically, I never called image.non_empty() and I added an empty string as a valid magic number but the form still fails to validate.

    bug 
    opened by jkalyanapu 2
Owner
Artyom Beilis
Artyom Beilis
A high performance, middleware oriented C++14 http web framework please use matt-42/lithium instead

A high performance, middleware oriented C++14 http web framework please use matt-42/lithium instead

Matthieu Garrigues 1.7k Jul 22, 2022
TreeFrog Framework : High-speed C++ MVC Framework for Web Application

Small but Powerful and Efficient TreeFrog Framework is a high-speed and full-stack web application framework based on C++ and Qt, which supports HTTP

TreeFrog Framework 1.1k Aug 7, 2022
🌱Light and powerful C++ web framework for highly scalable and resource-efficient web application. It's zero-dependency and easy-portable.

Oat++ News Hey, meet the new oatpp version 1.2.5! See the changelog for details. Check out the new oatpp ORM - read more here. Oat++ is a modern Web F

Oat++ 5.6k Jul 31, 2022
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.

Cutelyst - The Qt Web Framework A Web Framework built on top of Qt, using the simple and elegant approach of Catalyst (Perl) framework. Qt's meta obje

Cutelyst 779 Jul 30, 2022
Tntnet is a web application server for web applications written in C++.

Tntnet is a web application server for web applications written in C++.

Tommi Mäkitalo 71 Jul 28, 2022
Experimental, scalable, high performance HTTP server

Lwan Web Server Lwan is a high-performance & scalable web server. The project web site contains more details. Build status OS Arch Release Debug Stati

Leandro A. F. Pereira 5.6k Aug 3, 2022
A high-performance REST Toolkit written in C++

Pistache Pistache is a modern and elegant HTTP and REST framework for C++. It is entirely written in pure-C++14 and provides a clear and pleasant API.

null 2.7k Aug 3, 2022
Cetus is a high performance, stable, protocol aware proxy for MySQL Group Replication.

Introduction Cetus is a high performance, stable, protocol aware proxy for MySQL Group Replication. Getting started 1. Prerequisites cmake gcc glib2-d

null 36 Jun 12, 2022
Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)

Crow is C++ microframework for web. (inspired by Python Flask) #include "crow.h" int main() { crow::SimpleApp app; CROW_ROUTE(app, "/")([]()

Jaeseung Ha 6.9k Aug 2, 2022
Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows

English | 简体中文 | 繁體中文 Overview Drogon is a C++14/17-based HTTP application framework. Drogon can be used to easily build various types of web applicat

An Tao 7.7k Aug 4, 2022
QDjango, a Qt-based C++ web framework

QDjango - a Qt-based C++ web framework Copyright (c) 2010-2015 Jeremy Lainé About QDjango is a web framework written in C++ and built on top of the Qt

Jeremy Lainé 245 Aug 5, 2022
This is a proof-of-concept of a modern C web-framework that compiles to WASM and is used for building user interfaces.

DanCing Web ?? ?? (DCW) Getting Started Dancing Web is now distributed with the Tarantella Package Manager — a tool I've made to simplify setup of pro

Danilo Chiarlone 3 Sep 11, 2021
Embedded C/C++ web server

CivetWeb The official home of CivetWeb is https://github.com/civetweb/civetweb Continuous integration for Linux and macOS (Travis CI): Continuous inte

null 2.1k Jul 30, 2022
C library to create simple HTTP servers and Web Applications.

Onion http server library Travis status Coverity status Onion is a C library to create simple HTTP servers and Web Applications. master the developmen

David Moreno Montero 1.9k Jul 28, 2022
A C++11 RESTful web server library

Served Overview Served is a C++ library for building high performance RESTful web servers. Served builds upon Boost.ASIO to provide a simple API for d

Meltwater 692 Jul 24, 2022
cserv is an event-driven and non-blocking web server

cserv is an event-driven and non-blocking web server. It ideally has one worker process per cpu or processor core, and each one is capable of handling thousands of incoming network connections per worker. There is no need to create new threads or processes for each connection.

null 41 Jul 2, 2022
Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.

Restbed Restbed is a comprehensive and consistent programming model for building applications that require seamless and secure communication over HTTP

Corvusoft 1.7k Aug 6, 2022
C++ application development framework, to help developers create and deploy applications quickly and simply

ULib - C++ library Travis CI: Coverity Scan: ULib is a highly optimized class framework for writing C++ applications. I wrote this framework as my too

stefano casazza 950 Jul 27, 2022