Giter Club home page Giter Club logo

curlpp's People

Contributors

aidoboy avatar bbczeuz avatar brunotl avatar clpo13 avatar copokbl avatar d-fal avatar fceller avatar frankxie05 avatar fynnwilliam avatar fytch avatar guidow avatar jarrocha avatar joshkel avatar jpbarrette avatar kindkaktus avatar leoxiaofei avatar montdidier avatar neroburner avatar nicoolxu avatar rilysh avatar sgallou avatar sqeaky avatar themoriarty avatar undarkaido avatar vsronin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

curlpp's Issues

make failed after cmake ..

I am trying to build curlpp locally on machine, using cmake version 3.2 in following steps.

  1. git clone [email protected]:jpbarrette/curlpp.git
  2. cd curlpp && mkdir build && cd build && cmake ..
  3. make
    and it fails here, Please find the build log

And any possible solution to this.

Examples and guide say we should use Cleanup class but we shouldn't

Examples and guide use Cleanup class, but Cleanup class comments say it is deprecated and not to use it. This causes confusion on how to use this library.

/**
* \depreciated This is an obsolete class. DO NOT use it. 
*
* The only reason it's still here,
* is to be sure that it is backward compatible. This class was taking care of 
* initialization and cleaning up curlpp (also libcURL) (it was calling 
* curlpp:terminate() in his destructor). However, from now on, you do not need
* this class. Note that the removal of this class was done because it was 
* raising some threading issues. 

sftp support ?

according to libcurl website , they suppoert sftp , and they actually do , i coded a simple sftp client , do you suppoert a wrapper for this protocol ?

example18.cpp HAVE_BOOST

After ./autogen.sh and ./configure and make project can't be built under Ubuntu 16.06. HAVE_BOOST is not defined when example18.cpp is compiled.

Why this check is even there?

Silent GET request

is it possible to perform a GET request to a rest server, doesn't show the response payload on stdout but get the response code?
with ostringstream I can't analyze response code but with perform method it show me response on stdout.

dll import error

hello, i get a bunch of errors using curlpp
\curlpp\internal\optioncontainer.inl(39): error C2491: 'curlpp::internal::OptionContainer::OptionContainer': definition of dllimport function not allowed

using visual studio 2015

How to add curl library in curlp for build?

When I build a library in a process I have errors like these:

libcurl/7.50.3@lasote/stable: Not found in local cache, looking in remotes... libcurl/7.50.3@lasote/stable: Trying with 'conan-center'... ERROR: Unable to find 'libcurl/7.50.3@lasote/stable' in remotes
How to add libcurl on the build? I make in VS 2015. Thanks.

cannot build in linux: required file './README' not found

In linux, calling ./autogen.sh to create ./configure exit with an error:

configure.ac:9: installing './missing'
Makefile.am: error: required file './README' not found
examples/Makefile.am:88: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
examples/Makefile.am: installing './depcomp'
src/curlpp/Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/curlpp/internal/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/utilspp/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
The automake command failed

After creating an empty README ./autogen.sh works correctly

Send parameters in GET request ?

Is it possible to url parameter in GET request.
Example :

base_url : https://api.example.com/
methods_name : <some_method_name>/<param1>/<param2>/..../<param3>

Different methods will accept different parameters. Instead of hard-coding and modifying base_url with parameters every time. I wish to send url_params separately, and it modify the base_url depending upon parameters.

curlpp configure.ac wipes out CXX optimisation flags

I've noticed that the autotools build system that comes with 0.7.3 deliberately passes CXXFLAGS through a sed filter to remove anything matching -O[0-9]*. Why is this? I was attempting to pass -O3 as part of my configure for a powerpc-linux cross compile and was surprised to see that CFLAGS were preserved but CXX was not.

The following error occurs on linux gnu (Ubuntu 18.04) distro. Am I missing a package? Which undefined resolution is left out?

/tmp/ccIk0bXG.o: In function `curlpp::OptionTrait<std::function<unsigned long (char*, unsigned long, unsigned long)>, (CURLoption)20011>::updateHandleToMe(curlpp::internal::CurlHandle*) const':
code.cpp:(.text._ZNK6curlpp11OptionTraitISt8functionIFmPcmmEEL10CURLoption20011EE16updateHandleToMeEPNS_8internal10CurlHandleE[_ZNK6curlpp11OptionTraitISt8functionIFmPcmmEEL10CURLoption20011EE16updateHandleToMeEPNS_8internal10CurlHandleE]+0x6a): undefined reference to `curlpp::internal::OptionSetter<std::function<unsigned long (char*, unsigned long, unsigned long)>, (CURLoption)20011>::setOpt(curlpp::internal::CurlHandle*, std::function<unsigned long (char*, unsigned long, unsigned long)>&)'
/tmp/ccIk0bXG.o: In function `curlpp::OptionTrait<std::function<int (double, double, double, double)>, (CURLoption)20056>::updateHandleToMe(curlpp::internal::CurlHandle*) const':
code.cpp:(.text._ZNK6curlpp11OptionTraitISt8functionIFiddddEEL10CURLoption20056EE16updateHandleToMeEPNS_8internal10CurlHandleE[_ZNK6curlpp11OptionTraitISt8functionIFiddddEEL10CURLoption20056EE16updateHandleToMeEPNS_8internal10CurlHandleE]+0x6a): undefined reference to `curlpp::internal::OptionSetter<std::function<int (double, double, double, double)>, (CURLoption)20056>::setOpt(curlpp::internal::CurlHandle*, std::function<int (double, double, double, double)>&)'
collect2: error: ld returned 1 exit status

Undefined ref curlpp::InfoTypeConverter

Trying to use DeepDetect which has a deps on curlpp

I install curlpp thru apt-get and removed and built (lib not the examples) from source using make and make install but I keep getting the same error in linking stage of DeepDetect

In function curlpp::Info<(CURLINFO)2097154, long>::get(curlpp::Easy&)': /usr/include/curlpp/Info.inl:39: undefined reference to curlpp::InfoTypeConverter::get(curlpp::Easy&, CURLINFO, long&)'
../src/libddetect.a(tflib.cc.o): In function curlpp::Info<(CURLINFO)2097154, long>::get(curlpp::Easy&)': /usr/include/curlpp/Info.inl:39: undefined reference to curlpp::InfoTypeConverter::get(curlpp::Easy&, CURLINFO, long&)'
../src/libddetect.a(xgbinputconns.cc.o): In function curlpp::Info<(CURLINFO)2097154, long>::get(curlpp::Easy&)': /usr/include/curlpp/Info.inl:39: undefined reference to curlpp::InfoTypeConverter::get(curlpp::Easy&, CURLINFO, long&)'
/usr/include/curlpp/Info.inl:39: undefined reference to `curlpp::InfoTypeConverter::get(curlpp::Easy&, CURLINFO, long&)'

Any pointers would be helpful

SMTP support?

Hi,
is SMTP supported by curlpp?
If not, will it be supported in the future? Any plan for that?
if yes, may I have an example sending an email using curlpp?

Best regards
Giuliano

RuntimeError Exception: No url set on VS 2015!

I am new to the curlpp library and would like to see why my program is dealing with this exception. I take the code from github example00.cpp. Tell me how this exception needs to be processed in order for the program to work correctly?
Output console:
'Test_curlpp.exe' (Win32): Loaded 'C:\Users\Max\Documents\Visual Studio 2015\Projects\Test_curlpp\x64\Debug\Test_curlpp.exe'. Symbols loaded. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Users\Max\Documents\Visual Studio 2015\Projects\Test_curlpp\x64\Debug\curlpp.dll'. Module was built without symbols. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Users\Max\Documents\Visual Studio 2015\Projects\Test_curlpp\x64\Debug\libcurl.dll'. Module was built without symbols. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\Wldap32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\normaliz.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Unloaded 'C:\Windows\System32\ucrtbased.dll' 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'. Cannot find or open the PDB file. Exception thrown at 0x00007FFF27C1A388 in Test_curlpp.exe: Microsoft C++ exception: curlpp::LibcurlRuntimeError at memory location 0x000000457070FBA0. 'Test_curlpp.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot find or open the PDB file. The thread 0x2b60 has exited with code 0 (0x0). The thread 0x1788 has exited with code 0 (0x0). The thread 0x2b4c has exited with code 0 (0x0). The program '[10256] Test_curlpp.exe' has exited with code 0 (0x0).

Do not judge strictly once again I am writing a novice in this. I am writing on VS 2015. Thank you.

Make visual Studio Community Project files.

On Windows you do not need a lincense to use Visual Studio Community. With Community you get everything that is in all the other editions of visual Studio for free as well. So, all the more reasons to make one. I could even Pull request some if you would like because I use the latest Update to Visual Studio Community 2015.

Silent GET request

i asked this question in another issue, but the solution doesn't work for me:
Iis it possible to perform a GET request to a rest server, doesn't show the response payload on stdout but get the response code?
with ostringstream I can't analyze response code but with perform method it show me response on stdout.

Connection is broken but not cancelled

  • curlpp: 0.8.1
  • curl: 7.59.0
  • OS: Gentoo Linux

I'm writing a program that makes a very long lasting connection. I noticed that there is no data incoming after a while but perform() is not returning. Would it be possible that curlpp detects if a connection is broken and cancel it?

Here is an example program:

#include <string>
#include <iostream>
#include <functional>
#include <thread>
#include <chrono>
#include <ctime>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <curlpp/Infos.hpp>

using std::string;
using std::cout;
using std::chrono::system_clock;
using namespace std::placeholders;  // _1, _2, _3

const size_t callback(char* data, size_t size, size_t nmemb, string *str)
{
    str->append(data, size * nmemb);
    cout << "Received " << size * nmemb << " Bytes\n";
    return size * nmemb;
};

void get_stream(string &stream)
{
    curlpp::Easy request;

    request.setOpt<curlpp::options::Url>
        ("https://botsin.space/api/v1/streaming/hashtag?tag=test");
    request.setOpt<curlpp::options::WriteFunction>
        (std::bind(&callback, _1, _2, _3, &stream));

    request.perform();
    cout << "Connection lost\n";
}

int main(int argc, char *argv[])
{
    curlpp::initialize();
    
    string stream;
    std::thread thr(get_stream, std::ref(stream));

    while (true)
    {
        std::this_thread::sleep_for(std::chrono::seconds(10));
        std::time_t tt = system_clock::to_time_t(system_clock::now());
        cout << std::ctime(&tt) << stream << std::endl;
        stream.clear();
    }

    thr.join();
    
    curlpp::terminate();
    return 0;
}

And here is the produced log: curlpp.log (The ":thump" are heartbeat comments, sent every ~15s)

upload file from memory

I add this code to form.cpp, but not working.
curl_formadd(first,
last,
CURLFORM_COPYNAME, "file",
CURLFORM_BUFFER, "random_img_name.jpg",
CURLFORM_BUFFERPTR, imgBuffPtr,
CURLFORM_BUFFERLENGTH, imgBuffLength,
CURLFORM_END);

Warning during compilation

Hi. I'm using your nice wrapper in a C++ project pulling some XML-data from the web. The project is in eclipse (mars). When compiling I would get a warning. The fix was very simple, merely adding a */ to the end of the line.

%>git diff
diff --git a/include/curlpp/config.win32.h b/include/curlpp/config.win32.h
index 1a67bc9..3dc90da 100644
--- a/include/curlpp/config.win32.h
+++ b/include/curlpp/config.win32.h
@@ -2,7 +2,7 @@
 /* config.h.in    Generated from configure.ac by autoheader.   */

 /* Define when building curlpp itself */
-/* DO NOT define or undefine this symbol if you are building from the IDE
+/* DO NOT define or undefine this symbol if you are building from the IDE */
 /* using solution files for VC9. Project files define or undefine this from within the IDE */
 //#define BUILDING_CURLPP

Wrong RelativePath in curlpp.VC8.vcproj

The files LifetimeLibrary.cpp and PrivateMembers.cpp are both located in .\src\utilspp\ but the project points to .\src\utilspp\singleton

I got the compiler error message that neither could be found.

Solution: I changed the RelativePath in the file properties within VisualStudio, but i think changing the entry in the curlpp.VC8.vcproj file with a text editor will do the trick too.

Centos7: Cmake 2.8 support

Hi,
I was trying to build the lib on Centos7. This OS ships with cmake 2.8.12
I KNOW this is an old version and is missing many nice features, but Centos7 is the newest free edition of the probably most widely used GNU/Linux distribution in an enterprise environment. So: How about keeping compatibility with Centos7? (Centos7 ships with libcurl 35, dated, but again: probably most widely used, gcc is 4.8.5 with about 95% completeness of C++11 support)
I can try to create a CMakeList.txt for cmake 2.8, but wonder about your plans to keep support for this edition? Redhat plans to provide production support for RHEL7 until 2024.

server is not exist block error

when server is not exist,or The server did not respond.
curlpp::Easy request will block for very very long time.
when i use request.setOpt(new Timeout(1));
it has little work.

Any HTTPS examples?

Or is there no extra configuration needed to make HTTPS requests?
<noob-alert/>

target pattern contains no '%'. Stop.

Does anyone know what this means? I'm compiling in CLion running on Bash on Windows.

/opt/clion-2017.1/bin/cmake/bin/cmake --build /mnt/c/Users/Aidan/Source/discord-aidobot/cmake-build-debug --target curlpp -- -j 8
lib/discordpp/lib/curlpp/CMakeFiles/curlpp.dir/depend.make:24: *** target pattern contains no '%'.  Stop.
CMakeFiles/Makefile2:221: recipe for target 'lib/discordpp/lib/curlpp/CMakeFiles/curlpp.dir/all' failed
make[2]: *** [lib/discordpp/lib/curlpp/CMakeFiles/curlpp.dir/all] Error 2
CMakeFiles/Makefile2:233: recipe for target 'lib/discordpp/lib/curlpp/CMakeFiles/curlpp.dir/rule' failed
make[1]: *** [lib/discordpp/lib/curlpp/CMakeFiles/curlpp.dir/rule] Error 2
Makefile:201: recipe for target 'curlpp' failed
make: *** [curlpp] Error 2

[Bug] vanilla POST request halt bug report

I found a bug to report...

I'm using curlpp 0.8.1 on Ubuntu 16 x86-64.

When I requested vanilla POST with no body,
the perform() halts with no error.
This is when I use curlpp::options::Post(true)

When I tried changing Post(true) to PostFields("") and PostFieldSize(0), it worked just fine.
I found a libcurl example(https://curl.haxx.se/libcurl/c/CURLOPT_POST.html), although I didn't tried running this code, documentation suggests that it should work.

Please review this bug.

Here is a snippet of code

Thank you.

// snippet 1
stringstream ss;
Easy request;

request.setOpt(new Url("some url"));
request.setOpt(new Post(true));

// halts here
ss << request;
// snippet 2
stringstream ss;
Easy request;

request.setOpt(new Url("some url"));
request.setOpt(new PostFields(""));
request.setOpt(new PostFieldSize(0));

// this works just fine
ss << request;

Incorrect char buffer in WriteFunctionFunctor call back

When receiving large JSON data set as multiple chunks via WriteFunctionFunctor callback, I notice incorrect/unprocessed char* ptr being returned whose size is much more than size X nmemb. The callback signature for WriteFunctionFunctor is as below.
typedef utilspp::Functor<
size_t,
TYPE_LIST_3(char*, size_t, size_t)> WriteFunctionFunctor
I am attaching the original JSON file and the file written as received via multiple WriteFunctionFunctor callbacks.

Please compare the attached files and you could notice an unprocessed or incorrect JSON formation inbetween.

Also you could see a '0' character at last in the receivedJSON which shows the HTTP Chunk Encoding is not properly processed(not being removed which marks the end of data/HTTP response) before being returned to the callback function.

OriginalJSON.txt
JSONReceivedOverMultipleCallbacks.txt

istream reads may never finish

While writing a simple file upload routine, we discovered that the upload would seemingly hang until eventually the connection timed out.

We discovered that the problem was in curlpp's use of readsome. If no data was available for readsome, it returned 0, without ever buffering more data to read. (This may depend on the particular istream subclass and the particular C++ RTL; we're using a std::stringstream in Embarcadero C++Builder 10.) curlpp didn't treat 0 bytes read as an abort, but it also didn't ever buffer more data to read, and it apparently didn't do anything to continue or abort the HTTP transfer.

This answer suggests that readsome is "fairly useless" and "highly implementation-specific," so read seems to be a safer choice.

C2491 31 Times on inl files

Receiving numerous errors when installing from Nuget related to C2491.
Others are recieving the same problem.
Problem can be recreated by Going into VS17 and creating a console app that uses the version of curlpp from nuget.
Try any of the example programs eg example04.
Problem occurs.

Disable auto logs

How can I disable the logs automatically printed by curlpp, I can't find the print code in the code.Thanks!

Release a new version

Hello, could you please make a new release that includes the GCC 6 fixes? This will give me enough time to make sure it goes into the next version of Debian stable. Thanks!

curlpp.pc: doesn't contain version number

The resulting curlpp.pc file doesn't contain a version number after using cmake prior to build curlpp. I suspect that this explains why my package cannot require curlpp for version >= 0.8.1 appropriately. I am using autotools for building. See the following:

configure: error: Package requirements (curlpp >= 0.8.1) were not met:

Requested 'curlpp >= 0.8.1' but version of curlpp is

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables CURLPP_CFLAGS
and CURLPP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Even though you seem to have dropped autotools as build system, I think that other packages using other build system should still be able to require curlpp for a specific subset of versions. This means, you should fix the curlpp.pc file if I'm not mistaken.

curlpp-config doesn't work

Platform: macOS 10.12.3
Version:0.7.4

curlpp-config doesn't work and abort with the error:

/usr/local/bin/curlpp-config: /bin/sh^M: bad interpreter: No such file or directory

I'm using homebrew, but this problem also occurs with manual build.

Building in msvc requires makefile, but it's non existant

Win32 Documentation states to use the makefile, however all msvc makefiles that I could see from a few years back and now not included and .gitignore d.

Either documentation out of date or user error. Can't proceed to install using option C in the meantime.

@libdir@ pkg-config template substitution broken

At configure time extras/CMakeLists.txt performs a template substitution of the pkg-config manfiest extras/curlpp.pc.in.

Trying to compile with g++ using the libcurlpp library fails with the following:

../libtool: line 7485: cd: lib/x86_64-linux-gnu: No such file or directory
libtool:   error: cannot determine absolute directory name of 'lib/x86_64-linux-gnu'
Makefile:808: recipe for target 'heliosd' failed

This is because the substitution variable for the library path @libdir@ is missing a leading forward slash:

$ pkg-config --libs curlpp 
-Llib/x86_64-linux-gnu -lcurlpp -Wl,-Bsymbolic-functions -Wl,-z,relro -lcur

This can be fixed by modifying CMakeList.txt's...
set(libdir "${CMAKE_INSTALL_LIBDIR}")

...to...
set(libdir "/${CMAKE_INSTALL_LIBDIR}")

I recommend the template look something like this:

# This is a comment
prefix=@prefix@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Name: curlpp
Description: cURLpp is a libcurl C++ wrapper
Version:                            
Libs: -L${libdir} -lcurlpp -Wl,-Bsymbolic-functions -Wl,-z,relro
Cflags: -I{includedir}/
# libcurl is required as non-private because CurlHandle.inl uses curl_easy_setopt.
Requires: libcurl

curlpp::infos::XX:get doesn' t return same result as InfoGetter

Hello,

first i would like to thank you for writing this library as working with libcurl C interface is a hell.

However i have found one cosmetic issue, that curlpp::infos::XX::get gives different output than InfoGetter. InfoGetter always gives correct results.

Sample code

double download_time, download_speed, download_time2, download_speed2;

curlpp::InfoGetter::get(request,CURLINFO_TOTAL_TIME, download_time);
curlpp::InfoGetter::get(request,CURLINFO_SPEED_DOWNLOAD, download_speed);

curlpp::infos::TotalTime::get(request, download_time2);
curlpp::infos::SpeedDownload::get(request, download_time2);

Strange thing for me was that
curlpp::infos::ResponseCode::get(request) was working as it should and i have found the problem.
This function defined in Info.cpp

template<>
void
InfoTypeConverter<double>::get(const curlpp::Easy & handle, 
				 CURLINFO info,
				 double & value)
{
  curl_off_t tmp;
  InfoGetter::get(handle, info, tmp);
  value = (double)tmp;
}

for some strange reason wants to put double inside a long. What actually this does is, it inserts time which is double into long removing the floating point. After that the conversion to value just randomly inserts floating point back. I haven' t tested it as i end up with using InfoGetter directly, but this should fix the problem.

template<>
void
InfoTypeConverter<double>::get(const curlpp::Easy & handle, 
				 CURLINFO info,
				 double & value)
{
  InfoGetter::get(handle, info, value);
}

How do I download this library

There are a lot of files, and I'm relatively new to C++.
The only thing that the front page tells me is to visit https://github.com/jpbarrette/curlpp/
for how to download. But I am already on this page, and it confuses me.

If someone could give me a hint, that would be hugely appreciated.
Thanks.

double call to CurlHandle destructor

Hi,

I am experiencing a weird crash, which trace looks like:

Program terminated with signal SIGABRT, Aborted.
#0  0x00007f6c9ff2bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007f6c9ff2bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f6c9ff2f0d8 in __GI_abort () at abort.c:89
#2  0x00007f6c9ff68394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7f6ca0076b28 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007f6c9ff7466e in malloc_printerr (ptr=<optimized out>, str=0x7f6ca0076c10 "double free or corruption (!prev)", action=1) at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
#5  0x00007f6c9aee9fcd in CRYPTO_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#6  0x00007f6c9af60dd8 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#7  0x00007f6c9af61a50 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#8  0x00007f6c9af61b89 in ENGINE_finish () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#9  0x00007f6c9af53490 in RSA_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#10 0x00007f6c9af7c6eb in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#11 0x00007f6c9af7cde8 in EVP_PKEY_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#12 0x00007f6c9af8b700 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#13 0x00007f6c9af90e0a in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#14 0x00007f6c9af9108f in ASN1_template_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#15 0x00007f6c9af90f2a in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#16 0x00007f6c9af9108f in ASN1_template_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#17 0x00007f6c9af90f2a in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#18 0x00007f6c9af90fe5 in ASN1_item_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#19 0x00007f6c9af70260 in sk_pop_free () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#20 0x00007f6c9b2a0f45 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#21 0x00007f6c9b2a1b67 in SSL_SESSION_free () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#22 0x00007f6ca21210c2 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#23 0x00007f6ca21213bb in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#24 0x00007f6ca20f1a49 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#25 0x00007f6ca20fc9fa in curl_easy_cleanup () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#26 0x00007f6ca236118d in curlpp::internal::CurlHandle::~CurlHandle() () from /usr/lib/x86_64-linux-gnu/libcurlpp.so.0
#27 0x00007f6ca23612ca in curlpp::internal::CurlHandle::~CurlHandle() () from /usr/lib/x86_64-linux-gnu/libcurlpp.so.0
#28 0x00007f6ca235b489 in std::auto_ptr<curlpp::internal::CurlHandle>::~auto_ptr() () from /usr/lib/x86_64-linux-gnu/libcurlpp.so.0
#29 0x00007f6ca235afa3 in curlpp::Easy::~Easy() () from /usr/lib/x86_64-linux-gnu/libcurlpp.so.0
#30 0x000000000070c1c0 in dd::httpclient::~httpclient (this=0x7f6bf3ffe910, __in_chrg=<optimized out>)
    at /data/apps/deepdetect/repo/src/utils/httpclient.hpp:37
#31 0x000000000072274e in dd::DataEl<dd::DDImg>::read_element (this=0x7f6bf3ffea90, 
    uri="https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/12905019_760584740708335_1210783038_n.jpg")
    at /data/apps/deepdetect/repo/src/inputconnectorstrategy.h:54
#32 0x00000000007084b1 in dd::ImgInputFileConn::transform () at /data/apps/deepdetect/repo/src/imginputfileconn.h:257
#33 0x00007f6ca04d834a in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#34 0x00007f6ca1aa2182 in start_thread (arg=0x7f6bf3fff700) at pthread_create.c:312
#35 0x00007f6c9ffef47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

This comes in the context of using multiple threads, each creating an object with its own curlpp::Easy handles. I've carefully investigated, tried many variants, tried against current master branch, but could not find the cause.

The calling code looks like:

curlpp::Easy request;                                                                                                                                           
curlpp::options::WriteStream ws(&os);  
curlpp::options::CustomRequest pr(http_method);  
request.setOpt(new curlpp::options::Url(url));
request.setOpt(ws);
request.setOpt(pr);
request.perform();
outstr = os.str();                                                                                                          
outcode = curlpp::infos::ResponseCode::get(_request);

This is on Ubuntu 14.04 using the built-in packages (though curlpp master yields the same error).

Any help is greatly appreciated!

Unable to find LIB_CURL

I installed libcurl (v7.51) on Windows via CMake, with out any problems. It is installed in C:/Program Files (x86)/CURL, as expected. However, when I try to generate a project from cmake, it fails to find libcURL.

I'm at a loss to explain why it would fail like this...

Here is the log:

-- Building for: Visual Studio 15 2017
    -- The C compiler identification is MSVC 19.10.24629.0
    -- The CXX compiler identification is MSVC 19.10.24629.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.24629/bin/HostX86/x86/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.24629/bin/HostX86/x86/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.24629/bin/HostX86/x86/cl.exe
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.24629/bin/HostX86/x86/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    --      Using Sources From: C:/Users/<username>/Documents/gitter++/lib/curlpp/
    --      Putting all major output in: C:/Users/<username>/Documents/gitter++/lib/curlpp/build/
    --      Inputs of type .cpp at: C:/Users/<username>/Documents/gitter++/lib/curlpp/src/
    --      Inputs of type .h and .hpp at: C:/Users/<username>/Documents/gitter++/lib/curlpp/include/
    --      Inputs to be built as standalone examples are at: C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/
    --      Using Header Files:
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/EmptyType.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/LifetimeWithLongevity.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/SingletonHolder.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/LifetimeLibrary.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/CreationStatic.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/CreationUsingNew.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/LifetimeDefault.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/singleton/PrivateMembers.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/NullType.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/ThreadingSingle.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/Singleton.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/TypeTrait.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/clone_ptr.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/functor/MemFunHandler.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/functor/FunctorHandler.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/functor/Binder.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/functor/FunctorImpl.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/functor/Functor.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/TypeList.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/NonCopyable.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/SmartPtr.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/ThreadingFactoryMutex.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/utilspp/Functors.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Exception.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Option.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Info.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Easy.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Form.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Types.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/OptionBase.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Infos.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Options.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/Multi.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/OptionContainerType.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/global.h
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/buildconfig.h
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/OptionContainer.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/SList.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/CurlHandle.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/OptionSetter.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/internal/OptionList.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/include/curlpp/cURLpp.hpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/autolink.h
    --      Using Source Files:
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/utilspp/PrivateMembers.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/utilspp/LifetimeLibrary.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Form.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Exception.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Options.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Option.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Options.custom.ins
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Info.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Multi.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/OptionBase.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/internal/SList.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/internal/OptionSetter.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/internal/OptionList.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/internal/CurlHandle.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Infos.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/Easy.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/src/curlpp/cURLpp.cpp
    --      Using Example Files:
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example00.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example01.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example02.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example03.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example04.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example05.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example06.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example07.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example08.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example09.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example10.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example11.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example12.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example13.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example14.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example16.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example15.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example17.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example18.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example19.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example20.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example21.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example22.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example23.cpp
    --              C:/Users/<username>/Documents/gitter++/lib/curlpp/examples/example24.cpp
    -- Looking for CURL
    -- Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
    CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
    Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
    Call Stack (most recent call first):
    C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
    C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.6/Modules/FindCURL.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    CMakeLists.txt:138 (find_package)


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/<username>/Documents/gitter++/lib/curlpp/build/CMakeFiles/CMakeOutput.log".

Thanks for any advice/guidance you could provide.

Cross Compile Error

Cross Compiled by arm-none-linux-gnueabi-gcc it seems that taking -I/usr/local/include and -L/usr/local/lib in Makefile is quite harmful for cross compile.Hope for improvement.

[question] status of CURLPP project

at this time:

  1. there are 5 openned Issues and 3 PR. the oldest item was openned more than half a year ago.
  2. some planned features (eg CMAKE support) were not fully implemented.
  3. almost all files in master branch dated by 2009.

is this a "dead" project? does somebody really support it?

CMake build requires missing directory

When I attempt to run cmake it fails with the following error:

CMake Error at src/utilspp/CMakeLists.txt:4 (add_subdirectory):
add_subdirectory given source "singleton" which is not an existing
directory.

It fails this way for in source and out of source builds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.