libcurl

Why does file upload stop after sending a couple of chunks of data (using multipart/form-data)?

一世执手 提交于 2019-12-13 03:49:33
问题 I'm using libcurl to upload a firmware file to a hardware device. I'm using multipart/form-data and it looks like the file upload starts okay but it doesn't load the entire file. The file I'm uploading is 144,855,725 bytes but it appears that only two 64k chunks are being sent. In the posted code I am using a read callback function. I had also tried just passing the file name to the curl_mime_filedata function and the results were the same. One interesting note is that when I run the program

Downloading image via libcurl

a 夏天 提交于 2019-12-13 03:48:30
问题 I try to download image via libcurl (I know other options to download, but I need to get it done via libcurl) When I download & save the image, I can not open it. The file size is different as when downloading file myself. using System; using System.Windows.Forms; using SeasideResearch.LibCurlNet; using System.IO; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { HTTP cURL

logging in libcurl

删除回忆录丶 提交于 2019-12-13 03:40:55
问题 How to modify libcurl so that all the error descriptions are collected in a common log file ? I am trying to port libcurl to android and display curl logs on adb. Is there a way to log all the activities of libcurl ? 回答1: How about simply using CURLOPT_DEBUGFUNCTION? It was designed for exactly such a purpose... 来源: https://stackoverflow.com/questions/15337319/logging-in-libcurl

Internal connection management in libcurl and DNS ttl

吃可爱长大的小学妹 提交于 2019-12-13 03:25:04
问题 libcurl caches connections and reuses them for consecutive requests. Suppose I have 4 connections in progress to example.com and I need to make 5th connection. Libcurl will try to establish new 5th connection to example.com . What will happen if at the time the 5th connection is created TTL for example.com DNS result expired? I suppose libcurl doesn't cache DNS results and simply queries OS resolver (I don't use ares), and if example.com expired in the cache a new DNS request will be made.

C++ LibcURL IMAP fetch what is the variable holding the subject line?

Deadly 提交于 2019-12-13 03:18:25
问题 Code is https://curl.haxx.se/libcurl/c/imap-fetch.html In that example what would be variable holding the Subject line be. It prints it out in the console but I would like to be able to compare the content of the subject. For instance if I wanted to: If (subject == "sample text") { Do things; } 回答1: You can use a URL that retrieves only the subject, if that's what you want. curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1;SECTION=HEADER.FIELDS%20(Subject)"); Some of

libcurl - dll error on 32bit but not 64bit

牧云@^-^@ 提交于 2019-12-12 19:55:32
问题 This is a new thread started from post (link). I have used the suggested curl library (link) for building libcurl into my dll. I link in libcurl_imp.lib and have created library routines for calling the curl methods. This all works a treat - BUT ONLY ON A 64BIT MACHINE? - if I try to run the same dll/binary app on a 32bit XP machine it just dumps out immediately. In fact all my applications abort - and they make no reference to my new library routines, they just use the dll. It seems that

Curl on Windows

时光总嘲笑我的痴心妄想 提交于 2019-12-12 19:28:03
问题 I have followed all on this link : How do I install/set up and use cURL on Windows? But I could not install latest curl 7.50.3 from https://curl.haxx.se/download.html. on windows 7 / 2008 Server R2 I have basically tried below 1. Download Win64 version 2. Unzip 3. Copy curl.exe under /src to C:\Windows (thats my %windir%) 4. Open cmd and type 'curl' Below is the error im getting c:\Curl\src>curl curl:./.libs/lt-curl.c:233: FATAL: couldn't find curl. I have also added the folder where I have

Including libcurl in project

只谈情不闲聊 提交于 2019-12-12 16:06:14
问题 So I downloaded the zip file from the curl website. I copied the directory with all of the header files into my include directory. Including the curl.h works with no problems, however, when I go to actually call a function, suddenly my c++ app will no longer compile. Here's the error I'm receiving: [Linker error] undefined reference to `curl_easy_init' Here's the code: #define CURL_STATICLIB #include <curl/curl.h> #include <string> #include <iostream> using namespace std; int main() { string

How to send an attachment with email using libcurl and c language?

我的梦境 提交于 2019-12-12 14:44:56
问题 I am using curl library for email sending. I am able to send email successfully. I can see FROM, Subject and body properly at receiving end. Now my need is for attachment in the email. I have followed in this way: http://msdn.microsoft.com/en-us/library/ms526560(v=exchg.10).aspx static const char *text[]={ "Date: Wed, 06 Feb 2013 12:30:30 +1100\n", "To: " RECIPIENT "\n", "From: " MAILFROM "\n", "MIME-Version: 1.0", "Content-Type: multipart/mixed", "boundary=""XXXXX""\n", "Subject: email

C++: Libcurl curl_easy_init() gives an access violation error and crashes the program

守給你的承諾、 提交于 2019-12-12 14:22:58
问题 I'm trying to use libcurl with a program I'm making, but I'm having some problems with it. So far I've only tried the examples from libcurl's website, but they crash as soon as the program gets to the curl initialization. My current code: #include <iostream> #include <curl/curl.h> int main(int argc, char *argv[]) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://garrysmod.fi/"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); }