Getting LibCurl to work with Visual Studio 2013

A lot of these instructions are out of date because they recommend the win32-ssl-devel-msvc package for curl, which no longer exists. The following instructions allow you to build libcurl using only: Visual Studio 2013 curl generic source tarball (tested on curl 7.44.0). A. Build libcurl static library Download the latest curl generic source from: http://curl.haxx.se/latest.cgi?curl=tar.gz … Read more

Persistent/keepalive HTTP with the PHP Curl library?

cURL PHP documentation (curl_setopt) says: CURLOPT_FORBID_REUSE – TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse. So: Yes, actually it should re-use connections by default, as long as you re-use the cURL handle. by default, cURL handles persistent connections by itself; should you need some … Read more

Download file using libcurl in C/C++

The example you are using is wrong. See the man page for easy_setopt. In the example write_data uses its own FILE, *outfile, and not the fp that was specified in CURLOPT_WRITEDATA. That’s why closing fp causes problems – it’s not even opened. This is more or less what it should look like (no libcurl available … Read more

Http status code with libcurl?

http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html CURLINFO_RESPONSE_CODE Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This will be zero if no server response code has been received. Note that a proxy’s CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE and not this. curl_code … Read more

C libcurl get output into a string

You can set a callback function to receive incoming data chunks using curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, myfunc); The callback will take a user defined argument that you can set using curl_easy_setopt(curl, CURLOPT_WRITEDATA, p) Here’s a snippet of code that passes a buffer struct string {*ptr; len} to the callback function and grows that buffer on each call … Read more

Why can’t Python find shared objects that are in directories in sys.path?

sys.path is only searched for Python modules. For dynamic linked libraries, the paths searched must be in LD_LIBRARY_PATH. Check if your LD_LIBRARY_PATH includes /usr/local/lib, and if it doesn’t, add it and try again. Some more information (source): In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)