<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.web.curl.library">
    <title>gmane.comp.web.curl.library</title>
    <link>http://blog.gmane.org/gmane.comp.web.curl.library</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39490"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39475"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39474"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39473"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39459"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39454"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39452"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39446"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39445"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39442"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39441"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39431"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39423"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39419"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39417"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39415"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39412"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39407"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39402"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.web.curl.library/39400"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39490">
    <title>Daemon hang after curl_easy_perform</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39490</link>
    <description>&lt;pre&gt;Hi all,

I have an issue with my daemon hanging when left overnight.(Daemon
undergoing stress testing at the moment). I am unable to narrow down the
issue.

I have taken the sample of my daemon when the hang happened and below is
log. One of the thread did try using curl_easy_perform post which ended up
with OSSpinLockunlock.

I was not able to gather more information from it as to what might have
gone wrong. I went through the Multi-threading issue and have set
CURLOPT_NOSIGNAL option to .

Can any one please help me out

thanks in advance.

Analysis of sampling sefiltd (pid 161) every 1 millisecond
Process:         sefiltd [161]
Path:            /usr/sbin/sefiltd
Load Address:    0x1000
Identifier:      sefiltd
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  launchd [1]

Date/Time:       2013-05-24 11:29:30.446 +0530
OS Version:      Mac OS X 10.8.3 (12D78)
Report Version:  7

Call graph:
    2663 Thread_1126   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2663 ???  (in sefiltd)  load address 0x1000 + 0x2469  [0x3469]
    +   2663 ???  (in sefiltd)  load address 0x1000 + 0x2a00  [0x3a00]
    +     2620 ???  (in sefiltd)  load address 0x1000 + 0x1053b  [0x1153b]
    +     ! 2619 usleep$UNIX2003  (in libsystem_c.dylib) + 60  [0x910ca91e]
    +     ! : 2618 nanosleep$UNIX2003  (in libsystem_c.dylib) + 189
[0x910caa55]
    +     ! : | 2618 __semwait_signal  (in libsystem_kernel.dylib) + 10
[0x943e9c72]
    +     ! : 1 cerror_nocancel  (in libsystem_kernel.dylib) + 52
[0x943eb4b3]
    +     ! :   1 cthread_set_errno_self  (in libsystem_c.dylib) + 1
[0x910484e4]
    +     ! 1 usleep$UNIX2003  (in libsystem_c.dylib) + 0  [0x910ca8e2]
    +     39 ???  (in sefiltd)  load address 0x1000 + 0x10687  [0x11687]
    +     ! 32 ???  (in sefiltd)  load address 0x1000 + 0xf8be  [0x108be]
    +     ! : 32 __sysctl  (in libsystem_kernel.dylib) + 10  [0x943e9fce]
    +     ! 7 ???  (in sefiltd)  load address 0x1000 + 0xf8fb  [0x108fb]
    +     !   7 __sysctl  (in libsystem_kernel.dylib) + 10  [0x943e9fce]
    +     3 ???  (in sefiltd)  load address 0x1000 + 0x10519  [0x11519]
    +     ! 2 ???  (in sefiltd)  load address 0x1000 + 0x271d2  [0x281d2]
    +     ! : 2 ???  (in sefiltd)  load address 0x1000 + 0x1c561  [0x1d561]
    +     ! :   2 ???  (in sefiltd)  load address 0x1000 + 0x1c507
[0x1d507]
    +     ! :     2 send$UNIX2003  (in libsystem_c.dylib) + 54  [0x910cabfa]
    +     ! :       2 __sendto  (in libsystem_kernel.dylib) + 10
[0x943e9ce2]
    +     ! 1 ???  (in sefiltd)  load address 0x1000 + 0x2721c  [0x2821c]
    +     !   1 ???  (in sefiltd)  load address 0x1000 + 0x236d9  [0x246d9]
    +     !     1 std::basic_string&amp;lt;char, std::char_traits&amp;lt;char&amp;gt;,
std::allocator&amp;lt;char&amp;gt; &amp;gt;::basic_string(char const*, std::allocator&amp;lt;char&amp;gt;
const&amp;amp;)  (in libstdc++.6.dylib) + 28  [0x99b9eb2c]
    +     !       1 strlen  (in libsystem_c.dylib) + 20  [0x9102c644]
    +     1 ???  (in sefiltd)  load address 0x1000 + 0x100af  [0x110af]
    2663 Thread_1128   DispatchQueue_2: com.apple.libdispatch-manager
(serial)
    + 2663 _dispatch_mgr_thread  (in libdispatch.dylib) + 53  [0x93d7e7a9]
    +   2663 _dispatch_mgr_invoke  (in libdispatch.dylib) + 993
[0x93d7ec71]
    +     2663 kevent  (in libsystem_kernel.dylib) + 10  [0x943ea9ae]
    2663 Thread_1132
    + 2663 thread_start  (in libsystem_c.dylib) + 34  [0x9102ad4e]
    +   2663 _pthread_start  (in libsystem_c.dylib) + 344  [0x910405b7]
    +     2663 ???  (in sefiltd)  load address 0x1000 + 0x10c71  [0x11c71]
    +       2663 ???  (in sefiltd)  load address 0x1000 + 0x37bf  [0x47bf]
    +         2663 pthread_cond_wait$UNIX2003  (in libsystem_c.dylib) + 71
[0x910cb095]
    +           2663 _pthread_cond_wait  (in libsystem_c.dylib) + 833
[0x91045280]
    +             2663 __psynch_cvwait  (in libsystem_kernel.dylib) + 10
[0x943e98e2]
    2663 Thread_1133
    + 2663 thread_start  (in libsystem_c.dylib) + 34  [0x9102ad4e]
    +   2663 _pthread_start  (in libsystem_c.dylib) + 344  [0x910405b7]
    +     2663 ???  (in sefiltd)  load address 0x1000 + 0x10c71  [0x11c71]
    +       2051 ???  (in sefiltd)  load address 0x1000 + 0x394f  [0x494f]
    +       ! 2051 pthread_cond_wait$UNIX2003  (in libsystem_c.dylib) + 71
[0x910cb095]
    +       !   2051 _pthread_cond_wait  (in libsystem_c.dylib) + 833
[0x91045280]
    +       !     2051 __psynch_cvwait  (in libsystem_kernel.dylib) + 10
[0x943e98e2]
    +       612 ???  (in sefiltd)  load address 0x1000 + 0x3a86  [0x4a86]
    +         612 ???  (in sefiltd)  load address 0x1000 + 0x448e8
[0x458e8]
    +           389 ???  (in sefiltd)  load address 0x1000 + 0x44525
[0x45525]
    +           : 388 ???  (in sefiltd)  load address 0x1000 + 0x443ce
[0x453ce]
    +           : | 388 ???  (in sefiltd)  load address 0x1000 + 0x43b43
[0x44b43]
    +           : |   388 __select  (in libsystem_kernel.dylib) + 10
[0x943e9be6]
    +           : 1 ???  (in sefiltd)  load address 0x1000 + 0x443b6
[0x453b6]
    +           :   1 ???  (in sefiltd)  load address 0x1000 + 0x12075
[0x13075]
    +           :     1 ???  (in sefiltd)  load address 0x1000 + 0x11a48
[0x12a48]
    +           :       1 strftime$UNIX2003  (in libsystem_c.dylib) + 74
[0x910b1af2]
    +           :         1 strftime_l$UNIX2003  (in libsystem_c.dylib) +
51  [0x910b09c7]
    +           :           1 tzset  (in libsystem_c.dylib) + 18
[0x910af327]
    +           :             1 tzsetwall_basic  (in libsystem_c.dylib) +
242  [0x910ae2b1]
    +           :               1 tzload  (in libsystem_c.dylib) + 345
[0x910ae82e]
    +           :                 1 access  (in libsystem_kernel.dylib) +
10  [0x943ea15e]
    +           223 ???  (in sefiltd)  load address 0x1000 + 0x444fb
[0x454fb]
    +             223 ???  (in sefiltd)  load address 0x1000 + 0x44018
[0x45018]
    +               222 ???  (in sefiltd)  load address 0x1000 + 0x43c7d
[0x44c7d]
    +               | 222 __select  (in libsystem_kernel.dylib) + 10
[0x943e9be6]
    +               1 ???  (in sefiltd)  load address 0x1000 + 0x43d2e
[0x44d2e]
    +                 1 ???  (in sefiltd)  load address 0x1000 + 0x11c1c
[0x12c1c]
    +                   1 ???  (in sefiltd)  load address 0x1000 + 0x11a29
[0x12a29]
    +                     1 localtime  (in libsystem_c.dylib) + 231
[0x910af8f5]
    +                       1 tzsetwall_basic  (in libsystem_c.dylib) +
242  [0x910ae2b1]
    +                         1 tzload  (in libsystem_c.dylib) + 12
[0x910ae6e1]
    2663 Thread_1134
      2663 thread_start  (in libsystem_c.dylib) + 34  [0x9102ad4e]
        2663 _pthread_start  (in libsystem_c.dylib) + 344  [0x910405b7]
          2663 ???  (in sefiltd)  load address 0x1000 + 0x10c71  [0x11c71]
            2663 ???  (in sefiltd)  load address 0x1000 + 0xf850  [0x10850]
              2663 ???  (in sefiltd)  load address 0x1000 + 0xf594
[0x10594]
                2663 ???  (in sefiltd)  load address 0x1000 + 0x9a35
[0xaa35]
                  2663 ???  (in sefiltd)  load address 0x1000 + 0x2b992
[0x2c992]
                    2663 ???  (in sefiltd)  load address 0x1000 + 0x2b49d
[0x2c49d]
                      2663 ???  (in sefiltd)  load address 0x1000 +
0x31a8e  [0x32a8e]
                        2663 ???  (in sefiltd)  load address 0x1000 +
0x2d7ab  [0x2e7ab]
                          2663 Curl_do_perform  (in libcurl.4.dylib) + 153
[0x9009e802]
                            2663 Curl_resolver_wait_resolv  (in
libcurl.4.dylib) + 35  [0x900b57d0]
                              2663 Curl_thread_join  (in libcurl.4.dylib) +
28  [0x900b4691]
                                2663 pthread_join$UNIX2003  (in
libsystem_c.dylib) + 87  [0x910cac56]
                                  2663 _pthread_lookup_thread  (in
libsystem_c.dylib) + 65  [0x91040d95]
                                    2315 _pthread_find_thread  (in
libsystem_c.dylib) + 92  [0x91040f6d]
                                    ! 2315 swtch_pri  (in
libsystem_kernel.dylib) + 10,0  [0x943e78aa,0x943e78a0]
                                    264 _pthread_find_thread  (in
libsystem_c.dylib) + 98,92,...  [0x91040f73,0x91040f6d,...]
                                    62 _spin_lock$VARIANT$mp  (in
libsystem_c.dylib) + 13,4,...  [0x9102d3bd,0x9102d3b4,...]
                                    7 DYLD-STUB$$_spin_lock  (in
libsystem_c.dylib) + 0  [0x910dad9c]
                                    6 DYLD-STUB$$swtch_pri  (in
libsystem_c.dylib) + 0  [0x910dab9e]
                                    5 _sysenter_trap  (in
libsystem_kernel.dylib) + 0  [0x943eb4c2]
                                    3 DYLD-STUB$$_spin_unlock  (in
libsystem_c.dylib) + 0  [0x910dadb4]
                                    1 _pthread_find_thread  (in
libsystem_c.dylib) + 80  [0x91040f61]
                                      1 OSSpinLockUnlock  (in
libsystem_c.dylib) + 0  [0x9102d3e4]

Total number in stack (recursive counted multiple, when &amp;gt;=5):

Sort by top of stack, same collapsed (when &amp;gt;= 5):
        __psynch_cvwait  (in libsystem_kernel.dylib)        4714
        kevent  (in libsystem_kernel.dylib)        2663
        __semwait_signal  (in libsystem_kernel.dylib)        2618
        swtch_pri  (in libsystem_kernel.dylib)        2315
        __select  (in libsystem_kernel.dylib)        610
        _pthread_find_thread  (in libsystem_c.dylib)        264
        _spin_lock$VARIANT$mp  (in libsystem_c.dylib)        62
        __sysctl  (in libsystem_kernel.dylib)        39
        DYLD-STUB$$_spin_lock  (in libsystem_c.dylib)        7
        DYLD-STUB$$swtch_pri  (in libsystem_c.dylib)        6
        _sysenter_trap  (in libsystem_kernel.dylib)        5
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Arjun SM</dc:creator>
    <dc:date>2013-05-24T07:02:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39475">
    <title>proposed patch to ssluse.c to fix sockets hanging in close_wait forever</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39475</link>
    <description>&lt;pre&gt;Hi All,

We have an application that uses the curl multi interface. We found that in
specific cases if the connection is abruptly closed, the underlying socket
is listed in a close_wait state. We continue to call the
curl_multi_perform, curl_mutli_fdset etc. None of these APIs report the
socket closed / connection finished.  Since we have cases where the multi
connection is only used once, this can pose a problem for us. I've read
that if another connection was to come in, curl would see the socket as bad
and attempt to close it at that time - unfortunately, this does not work
for us.

What I've found is that in specific situations, if SSL_write returns 0,
curl does not recognize the socket as closed (or errored out) and does not
report it to the application. I believe we need to change the code
slightly, to check if ssl_write returns 0. If so, treat it as an error -
the same as a negative return code.

For OpenSSL - the ssl_write documentation is here:
http://www.openssl.org/docs/ssl/SSL_write.html

My proposed patch is below.

Thanks!

Mike

diff --git a/lib/ssluse.c b/lib/ssluse.c****

index 22d8bcb..248c403 100644****

--- a/lib/ssluse.c****

+++ b/lib/ssluse.c****

&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2645,7 +2654,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static ssize_t ossl_send(struct connectdata *conn,***
*

   memlen = (len &amp;gt; (size_t)INT_MAX) ? INT_MAX : (int)len;****

   rc = SSL_write(conn-&amp;gt;ssl[sockindex].handle, mem, memlen);****

****

-  if(rc &amp;lt; 0) {****

+  /* need to make sure that if ssl_write returns any error we note it****

+   *  according to open ssl documentation if ssl_write returns 0 it means**
**

+   *  "The write operation was not successful. Probably the underlying
connection was closed."****

+   *  We noticed some cases where if an abnormal disconnect occurs, a
socket would get stuck****

+   *  in a "close_wait" state.****

+   *  http://www.openssl.org/docs/ssl/SSL_write.html****

+   */****

+  if(rc &amp;lt;= 0) {****

     err = SSL_get_error(conn-&amp;gt;ssl[sockindex].handle, rc);****

****

     switch(err) {
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Mike Giancola</dc:creator>
    <dc:date>2013-05-22T13:27:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39474">
    <title>cURL SFTP upload speed only 50% compared to command line SFTP</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39474</link>
    <description>&lt;pre&gt;I need to use cURL to upload some files to an SFTP server but it's
running a lot slower than standard SFTP from the command line.
Uploading using the standard SFTP client on Ubuntu 12.04, I'm getting
around 70Kb/s (this is fine, that's just the speed of the server), but
when using cURL, it's around 35Kb/s, half the speed of SFTP :/

Does anyone know of any ways I can speed up cURL, preferably without
having to upgrade to a new version as I really struggled to get my
version upgrading when I tried a while ago! But obviously I will if I
have to to get it working.

Here's the command I used for for SFTP:

/usr/bin/sftp -oProtocol=2 -oIdentityFile=/path/to/key.pri -oPort=5000
-oStrictHostKeyChecking=no username&amp;lt; at &amp;gt;thedomain.com

then just "put filename.wav" when it's connected...

and with cURL:

curl -v -u username: --key /path/to/key.pri --pubkey /path/to/key.pub
-T /path/to/filename.wav
sftp://thedomain.com:5000/folder/TEST/filename.wav --insecure

This is the cURL version info:

curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1
zlib/1.2.3.4 libidn/1.23 libssh2/1.2.8 librtmp/2.3 Protocols: dict
file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp
scp sftp smtp smtps telnet tftp Features: GSS-Negotiate IDN IPv6
Largefile NTLM NTLM_WB SSL libz TLS-SRP

I assume it's not like this for everyone?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>Ben Thomas</dc:creator>
    <dc:date>2013-05-22T12:06:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39473">
    <title>about doubt about using curl</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39473</link>
    <description>&lt;pre&gt;In xmlrpc-c, when timeout occurred, there are no messages in the queue, so, when it calls curl_multi_info_read to get privateCurlMsgP, curl_multi_info_read will return NULL. In this situation, xmlrpc fails to get resources and the memory won't be freed.

In normal situation, curl_multi_info_read will return te messages. Then, calls curl_easy_getinfo to retrieve information from a performed transfer. Finally xmlrpc-c calls the function curlTransaction_finish of its own to release the resources.

However, if timeout occurs, curl_multi_info_read return &amp;amp;easy-&amp;gt;msg-&amp;gt;extmsg which is NULL. Is there a function in curl like curl_multi_info_read which returns the easy-&amp;gt;easy_handle directly? 

Like:
CURL *curl_multi_easy_handle_read(CURLM *multi_handle)
{
  struct Curl_multi *multi=(struct Curl_multi *)multi_handle;

  if(GOOD_MULTI_HANDLE(multi)) {
    struct Curl_one_easy *easy;

    easy=multi-&amp;gt;easy.next;

    if(!easy) {
      return NULL;
    }
    if(easy-&amp;gt;msg_num) {
      easy-&amp;gt;msg_num --;
      multi-&amp;gt;num_msgs--;
    }

    return easy-&amp;gt;easy_handle;
  }
  else
    return NULL;
}

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>pengyi Peng(Yi</dc:creator>
    <dc:date>2013-05-22T03:58:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39459">
    <title>Feature window closes on May 22nd!</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39459</link>
    <description>&lt;pre&gt;Hi friends,

If you want any change, any new feature, into next curl and libcurl release 
you better get it to us in time to get merged before May 22nd!

That day we switch to bugfixes-only mode and we'll be like that until the next 
release, now planned to ship on June 22.

So, time to ramp up the work on that patch of yours and send it over! =)

(As usual, you can find our work-in-progress release-notes for the pending 
release here: http://curl.haxx.se/dev/release-notes.html )

&lt;/pre&gt;</description>
    <dc:creator>Daniel Stenberg</dc:creator>
    <dc:date>2013-05-18T21:22:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39454">
    <title>Interest in an Expat XML example?</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39454</link>
    <description>&lt;pre&gt;Since there doesn't seem to be much interest in rolling the code I
wrote for WebDAV PROPFIND into core, I'd be happy to factor it as an
example. It was hard finding a good way to do XML stream parsing with
libcurl when I set out to write it. The method I used should be usable
for any XML.

--
David Strauss
   | david&amp;lt; at &amp;gt;davidstrauss.net
   | +1 512 577 5827 [mobile]
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>David Strauss</dc:creator>
    <dc:date>2013-05-18T03:41:45</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39452">
    <title>Modify cURL to store cookies in variable</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39452</link>
    <description>&lt;pre&gt;Hello, my name is Rodrigo. I'm currently trying to make a PHP script
with cURL that needs to store cookies, I tried to use the "normal"
cookie file with CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE but I am using
parallel connections and need the cookie immediatly after the request
was made. I search a lot and noticed there isn't a standard way to store
cookies in variables, so I decided to try to modify cURL source to
implement this.

What I had in mind was to check how cookies where written to files with
CURLOPT_COOKIEJAR but instead of writing the cookies to files, returning
them so they could be stored in variables, I would like to do something
like this in PHP:

curl_setopt($handle, CURLOPT_COOKIEVAR, $cookie);

Where CURLOPT_COOKIEVAR would be the name of the option to store cookies
in variables and $cookie would store the cookie in a string.

So, my question is, any idea of where in cURL's source CURLOPT_COOKIEJAR
is implemented?

Thanks in advance.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>Rodrigo</dc:creator>
    <dc:date>2013-05-17T19:51:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39446">
    <title>[PATCH] cookie path match fail</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39446</link>
    <description>&lt;pre&gt;Hello cURL hackers,

I found a bug which cURL sends cookies to the path not to aim at.
For example:
- cURL sends a request to http://example.fake/hoge/
- server returns cookie which with path=/hoge;
  the point is there is NOT the '/' end of path string.
- cURL sends a request to http://example.fake/hogege/ with the cookie.

Because Curl_cookie_getlist() compares path using strncmp().

I think cURL should send without the cookie, this case.

An attached patch fixs this problem and test case.


Best regards,
thanks
===============
YAMADA Yasuharu
ACCESS CO., LTD.
Yasuharu.Yamada&amp;lt; at &amp;gt;access-company.com

&lt;/pre&gt;</description>
    <dc:creator>YAMADA Yasuharu</dc:creator>
    <dc:date>2013-05-17T06:49:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39445">
    <title>Read Certificates from curl</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39445</link>
    <description>&lt;pre&gt;Hi ,
I have compiled curl with openssl  , now I need to read few variables from
the certificates during handshake and validate them .
I need to read below cariables
1. policy mapping
2. All critical section
3. Name constraints .

I need above vars from certificate and   validate . if validation fails
against my requirement I have to reject the certificate .
is it possible to do this from the curl side or I have to look in openssl
only ?

--Indra
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Indtiny s</dc:creator>
    <dc:date>2013-05-17T06:33:24</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39442">
    <title>axtls memory leak</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39442</link>
    <description>&lt;pre&gt;Hello,

In recent testing, a memory leak in lib/axtls.c was discovered.  In hindsight, it's pretty obvious, but because it was such a small, slow leak, it was never noticed before.  In any case, here's a patch.

I also got axTLS's ability to use non-blocking connect and read calls working.  This was discussed long ago, but was dropped.  Should this be made to respect some user setting or preference?

Thanks,
Eric
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Hu, Eric</dc:creator>
    <dc:date>2013-05-16T15:34:48</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39441">
    <title>Building libcurl on OpenVMS Alpha and Itanium</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39441</link>
    <description>&lt;pre&gt;I'm trying to build libcurl libraries for OpenVMS (both Alpha and Itanium)
using latest available cURL sources (version 7.30.0 from http://curl.haxx.se
).
The binary distribution works fine, but I need a C/C++ callable interface to
eliminate needless spawning of CURL.EXE.

I extracted the archive to my personal directory:

  DSA0:[BH.CURL_7_30_0]

Executing the &amp;lt; at &amp;gt;build_vms.com script from the [.PACKAGE.VMS] subdirectory
yields:

  CC (opts) $1$DKC0:[BH.CURL-7_30_0.LIB]ASYN-ARES.C;1

  #include "config_vms.h"
  .^
  %CC-F-NOINCLFILEF, Cannot find file "config_vms.h" specified in
  #include directive.
  at line number 1438 in file
  $1$DKC0:[BH.curl-7_30_0.packages.vms.ALPHA]CURL_CONFIG.H;1

The config_vms.h was created but resides in DSA0:[BH.CURL-7_30_0].

As a work-around... I copied the config_vms.h file into the
[.PACKAGES.VMS.ALPHA] directory but the build then fails with:

  CC (opts) $1$DKC0:[BH.CURL-7_30_0.LIB]ASYN-ARES.C;1

  #include &amp;lt;gnutls/gnutls.h&amp;gt;
  .^
  %CC-F-NOINCLFILEF, Cannot find file &amp;lt;gnutls/gnutls.h&amp;gt; specified in
#include directive.
  at line number 108 in file $1$DKC0:[BH.curl-7_30_0.lib]urldata.h;1

For my current needs I don't require SSL or TLS support.  I see from the
build_vms.com script that one could use NOSSL, however there is no option to
turn off GNUTLS (or any other possible GNU libraries)

I checked the archive and the last traffic circa Mar 2013 implies
outstanding
problems with the VMS build had been addressed.  Any suggestions / guidance
would be appreciated.

-Brad
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Brad Coish</dc:creator>
    <dc:date>2013-05-16T14:32:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39431">
    <title>AW: Re: IMAP and POP3 with libcurl 7.30</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39431</link>
    <description>&lt;pre&gt;Hello, 
thanks so far, but that was not quite a solution for me. Did anyone really test it? My evidence is quite good or not?

Or what could have went wrong during compiling the lib? But the version output is also quite astonishing if it would not be the real 7.30 version.

Any further help is very welcome.
Thanks in advance.
xyzzyx.

-------- Original message --------
Subject: Re: IMAP and POP3 with libcurl 7.30 
From: David Strauss &amp;lt;david&amp;lt; at &amp;gt;davidstrauss.net&amp;gt; 
To: libcurl development &amp;lt;curl-library&amp;lt; at &amp;gt;cool.haxx.se&amp;gt; 
CC:  

On Sun, May 12, 2013 at 8:37 AM, xyzzyx &amp;lt;1xyzzyx1&amp;lt; at &amp;gt;gmx.de&amp;gt; wrote:

While I don't have the experience using libcurl with IMAP to help you
directly here, I can say that the command-line curl uses libcurl. If
something is possible with the curl CLI, it's possible with libcurl.

There are a couple of cases where the curl CLI provides additional
logic, like HTTP retries, on top of libcurl. But, it's never redundant
with what libcurl provides itself.

--
David Strauss
   | david&amp;lt; at &amp;gt;davidstrauss.net
   | +1 512 577 5827 [mobile]
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>1xyzzyx1</dc:creator>
    <dc:date>2013-05-14T18:33:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39423">
    <title>how curl get access_token in OAuth?</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39423</link>
    <description>&lt;pre&gt;I want to write third party application,I use c and curl,first,and my
application is desktop application without server.First,I POST a
request,then the server send me back a webpage,users should enter their
username and password,if everything is ok,the webpage will redirect to a
new webpage,and the access_token will be appended at the end of the url of
the new webpage.So my question is how can I use curl to get the
access_token in the url of the new webpage.Thank you.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Feng Helong</dc:creator>
    <dc:date>2013-05-14T00:10:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39419">
    <title>Question about cacert.pem on Windows with MinGW</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39419</link>
    <description>&lt;pre&gt;Hello,

I am developping a library for Puredata to make RESTful web requests.

Everything is working quite well with libcurl, but I have a problem
using SSL secured requests in Windows.

I am cross compiling libcurl on Linux using MXE, but I get SSL errors
when setting the path to the cacert.pem from the library.

This is what I have tried:
I am setting the cacert path using

curl_easy_setopt(curl_handle, CURLOPT_SSLCERT, common-&amp;gt;cert_path);

where common-&amp;gt;cert_path is char[2048] (not a pointer, just for testing)
and is C:/Program Files (x86)/pd/extra/purest_json/cacert.pem

cacert.pem is the download from http://curl.haxx.se/docs/caextract.html,
and I have set read/write access to everyone, I have already tried
replacing slashes with backslashes.

Here are the configure scripts from MXE that I have tried and the error
codes:

gnutls:
-------
./configure \
        --host='$(TARGET)' \
        --build="`config.guess`" \
        --disable-shared \
        --prefix='$(PREFIX)/$(TARGET)' \
        --with-gnutls \
        --without-ssl \
        --with-libidn \
        --enable-sspi \
        --enable-ipv6 \
        --with-libssh2

error code: CURLE_SSL_CACERT_BADFILE (77)

openssl:
--------
./configure \
        --host='$(TARGET)' \
        --build="`config.guess`" \
        --disable-shared \
        --prefix='$(PREFIX)/$(TARGET)' \
        --without-gnutls \
        --with-ssl \
        --with-libidn \
        --enable-sspi \
        --enable-ipv6 \
        --with-libssh2

error code: CURLE_SSL_CERTPROBLEM (58)

My C code for using libcurl is at
https://github.com/residuum/PuRestJson/blob/master/ctw.c

Thanks for you help,
Thomas
&lt;/pre&gt;</description>
    <dc:creator>Thomas Mayer</dc:creator>
    <dc:date>2013-05-13T20:13:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39417">
    <title>site contents now off git</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39417</link>
    <description>&lt;pre&gt;Hi all,

I've just switched the web site to now update its contents automatically from 
this git repository: https://github.com/bagder/curl-www

Please point out any problems you encounter as I'm sure there are some flaws 
left due to this transition.

&lt;/pre&gt;</description>
    <dc:creator>Daniel Stenberg</dc:creator>
    <dc:date>2013-05-13T17:44:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39415">
    <title>FTP upload stall?</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39415</link>
    <description>&lt;pre&gt;We've been getting a problem with our unit tests where FTP uploads using curl_multi were stalling. The test in question starts off three uploads and three downloads to the same server in parallel. Unless we're somehow missing an error condition somewhere, it looks like all the uploads hang.

I seem to have tracked this down to commit 57aeabcc1a20ff8ed1d725ef0309d0d8f64194d8. 

Taking the latest code (7ed25ccf0d1e5b8c7fd3bd90f0375a06011cd394 ), then reversing commit 57aeabcc1a20ff8ed1d725ef0309d0d8f64194d8, seems to be enough to fix the stall for us.

I'm not sure if the problem is the libcurl code itself, or some side-effect of the change, maybe taking away some other behaviour that we're relying on.

I don't have a plain C test yet, but I'll attempt to make one if I can. I thought I'd give you a heads-up in the meantime, just in case it's a problem that someone else can verify in the meantime.

Cheers,

- Sam -

sam deane / &amp;lt; at &amp;gt;samdeane | elegantchaos.com / &amp;lt; at &amp;gt;elegantchaoscom | mac and ios software development


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>Sam Deane</dc:creator>
    <dc:date>2013-05-13T14:54:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39412">
    <title>Content-Length missing when setting cookie</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39412</link>
    <description>&lt;pre&gt;Hi,

I am having a problem with POST method and cookie.

When just CURLOPT_POSTFIELDS and CURLOPT_POSTFIELDSIZE are set I can see
correct Content-Length header in the outgoing request.

Problem starts when I also set CURLOPT_COOKIE, then I can see valid Cookie
header in the request but Content-Length is suddenly missing.

Changing the order of actions (first cookie then post) doesn't work either
(I thought maybe I was overwriting header with CUROPT_COOKIE)

What is happening?

Regards,
Szymon Gatner
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Szymon Gatner</dc:creator>
    <dc:date>2013-05-13T09:22:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39407">
    <title>IMAP and POP3 with libcurl 7.30</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39407</link>
    <description>&lt;pre&gt;Hello,

we compiled libcurl 7.30 with OpenSSL 1.0.1e for mipsel-linux-uclibc (before 
that we compiled libcurl 7.29 too).
We used the source archive from here: http://curl.haxx.se/download.html.

I have some questions how to use libcurl for IMAP
because it seems so for us that the new IMAP functions are only working in 
the command line curl and not with the libcurl functions.
But as I understood the published changelog and the updated documentation 
for setopt (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html) they should 
also work for the libcurl functions, or am I mistaken?

For initializing I use the following (and the corresponding functions for 
cleaning up):
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
But I think curl_global_init is not meant to activate the new IMAP 
functions, right?

curl command line version:
curl 7.30.0 (mipsel-unknown-linux-uclibc) libcurl/7.30.0 OpenSSL/1.0.1e
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp 
smtp smtps telnet tftp
Features: Largefile NTLM NTLM_WB SSL TLS-SRP

libcurl version result from "curl_version()" &amp;lt;libcurl/7.30.0 OpenSSL/1.0.1e&amp;gt;


Some examples:
For all of these: I exchanged the real user and password with just 
“user:password”, user is in this case normally the complete email address 
with %40 instead of the &amp;lt; at &amp;gt; sign.
The command line curl version works always pretty fine, but with the same 
url the libcurl function do not deliver the same result (or no result).
There are two mails in this INBOX.


1a) IMAP test 1, command line:
curl -v -o imap.txt 'imap://user:password&amp;lt; at &amp;gt;imap.1und1.de'

- delivers the folder list including the folder “INBOX”
* LIST (\HasNoChildren) "/" Drafts
* LIST (\HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" Sent
* LIST (\HasNoChildren) "/" Spam
* LIST (\HasNoChildren) "/" Trash

1b) IMAP test 1, libcurl functions:
CURLOPT_URL, “imap://user:password&amp;lt; at &amp;gt;imap.1und1.de”
CURLOPT_HEADER, 1
CURLOPT_WRITEFUNCTION, WriteMemoryCallback
CURLOPT_WRITEDATA, (void *)&amp;amp;data
CURLOPT_HEADERFUNCTION, WriteMemoryCallback
CURLOPT_WRITEHEADER, (void *)&amp;amp;header

- delivers the multipart message from the body of the first mail as data

- delivers the IMAP protocol handshake and messages as header

- It should normally list the folders
Even if I would use the mail content from here, the email header would be 
missing (although I used CURLOPT_HEADER, 1) and I do not know from, to, 
subject and date.


2a) IMAP test 2, command line:
curl -v -o imap.txt 'imap://user:password&amp;lt; at &amp;gt;imap.1und1.de/INBOX'

- delivers:
* LIST (\HasNoChildren) "/" INBOX

2b) IMAP test 2, libcurl functions:
CURLOPT_URL, “imap://user:password&amp;lt; at &amp;gt;imap.1und1.de/INBOX”
CURLOPT_HEADER, 1
CURLOPT_WRITEFUNCTION, WriteMemoryCallback
CURLOPT_WRITEDATA, (void *)&amp;amp;data
CURLOPT_HEADERFUNCTION, WriteMemoryCallback
CURLOPT_WRITEHEADER, (void *)&amp;amp;header

- delivers the multipart message from the body of the first mail as data

- delivers the IMAP protocol handshake and messages as header

- It should normally list the folders
Even if I would use the mail content from here, the email header would be 
missing (although I used CURLOPT_HEADER, 1) and I do not know from, to, 
subject and date.


3a) IMAP test 3, command line:
curl -v -o imap.txt 'imap://user:password&amp;lt; at &amp;gt;imap.1und1.de/INBOX/;uid=1'

- delivers the complete email header (Return-Path, ... From:, To:, Subject:, 
Date:, ...) and multipart message of the body


3b) IMAP test 3, libcurl functions:
CURLOPT_URL, “imap://user:password&amp;lt; at &amp;gt;imap.1und1.de/INBOX/;uid=1”
CURLOPT_HEADER, 1
CURLOPT_WRITEFUNCTION, WriteMemoryCallback
CURLOPT_WRITEDATA, (void *)&amp;amp;data
CURLOPT_HEADERFUNCTION, WriteMemoryCallback
CURLOPT_WRITEHEADER, (void *)&amp;amp;header

- delivers no data

- delivers only the header saying unknown folder:
* OK IMAP server ready H mimap12 95897
B OK LOGIN completed
C NO unknown folder
* BYE Server logging out
D OK LOGOUT completed


4a) POP3 test, command line:
curl -v -o pop3.txt 'pop3://user:password&amp;lt; at &amp;gt;pop.1und1.de'

- delivers the result that there are two emails:
1 2559
2 2722

4b) POP3 test, libcurl functions:
CURLOPT_URL, “pop3://user:password&amp;lt; at &amp;gt;pop.1und1.de”
CURLOPT_HEADER, 1
CURLOPT_WRITEFUNCTION, WriteMemoryCallback
CURLOPT_WRITEDATA, (void *)&amp;amp;data
CURLOPT_HEADERFUNCTION, WriteMemoryCallback
CURLOPT_WRITEHEADER, (void *)&amp;amp;header

- delivers the result that there are two emails as data:
1 2559
2 2722

- delivers POP3 handshake and message as header (not shown here)


POP3 seems to work quite fine.

Questions regarding IMAP:
Why does IMAP work with the command line curl but not with the libcurl 
functions?

How would I get the mail header (it should be included when using 
"CURLOPT_HEADER, 1" or why not?)?

Is there any easy possibility to get the total number of messages?
Ok, I could parse the header to find the following which is included there, 
but is there a IMAP url with which I get this as result in data, like pop3 
example 4a?:
* 2 EXISTS
* 0 RECENT

Thanks,
Regards,
xyzzyx

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>xyzzyx</dc:creator>
    <dc:date>2013-05-12T15:37:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39402">
    <title>(unknown)</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39402</link>
    <description>&lt;pre&gt;Hello,

I think there is a memory leak in the curl code. Running valgrind on the
following code (first link) yields the output in the second link. Since
this is my first time attempting debugging "real" code I may have made some
trivial mistake, if this is the case please let me know, I would greatly
appreciate it.

source: http://pastie.org/pastes/7827550/text
valgrind output: http://pastie.org/pastes/7827548/text
curl version: 7.30.0

Thanks,
Quintillus
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Raheman Vaiya</dc:creator>
    <dc:date>2013-05-10T16:51:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39400">
    <title>Build problems for WIN64.</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39400</link>
    <description>&lt;pre&gt;Trying to build curl for WIN64 but run into some problems:
I got warnings about redefinitions of fstat/stat.
I could fix those by adding the follow lines to curl_setup.h:371 and
curl_setup.h:388
#  undef  fstat
#  undef  stat

The second problem is that I am unable to build the shared version of curl.
If I build with --disable-shared it compiles and work as expected but when
I want to build the shared library I get strange link errors:
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x7f): undefined reference to
`__imp_curl_strequal'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x147): undefined reference to
`__imp_curl_msnprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x177): undefined reference to
`__imp_curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x2e7): undefined reference to
`__imp_curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x340): undefined reference to
`__imp_curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x3b0): undefined reference to
`__imp_curl_mfprintf'
curl-tool_cb_dbg.o:tool_cb_dbg.c:(.text+0x40d): undefined reference to
`__imp_curl_mfprintf'

I checked the generated libcurl.a it links against and the strequal.o and
mprintf.o objects are both in there.
I am using the latest git master to build.
Any ideas what could cause this?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html&lt;/pre&gt;</description>
    <dc:creator>Vuurvlieg</dc:creator>
    <dc:date>2013-05-10T13:35:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.web.curl.library/39396">
    <title>Choosing which IP to connect to (SSL verification/connection reuse issues)</title>
    <link>http://comments.gmane.org/gmane.comp.web.curl.library/39396</link>
    <description>&lt;pre&gt;Hi,

Is there a way to tell curl to do connection caching per IP instead of per-host?
i.e. can I tell it to check its cache only *after* my OPENSOCKET_FUNCTION callback is invoked (which might change the IP)?

Background:

Given an https://example.com/something URL, where example.com points to multiple IP addresses
I want to be able to choose which IP address to connect to (for various reasons).

If this was HTTP it would be easy: just use the IP in the URL. However if I do that with HTTPS then certificate verification
fails as expected. I could turn off SSL_VERIFYHOST and do the verification myself, but I'd have to duplicate all of curl's
hostname verification logic and I'd rather not do that...

My current workaround is:
 * keep the domain name in the URL: https://example.com/something
 * override the IP address either by:
     * using CURLOPT_RESOLVE example.com:443:127.0.1.1
     * using CURLOPT_OPENSOCKETFUNCTION and changing the data in the *address pointer to point to my IP (127.0.1.1 in this example)
 * SSL verification succeeds now (its using the domain name from the URL)

However this stops working as soon as I try to connect to more than one IP address with same hostname,with the multi interface:
 * 1st call: OPENSOCKETFUNCTION callback changes IP for example.com to 127.0.1.1, this works
 * next URL https://example.com, but I want to use 127.0.1.2 now
 * curl will reuse the connection from the first IP (127.0.1.1) I've given it, and won't call my opensocket callback anymore

I could use CURLOPT_FRESHCONNECT to force a new connection, but then I won't be able to reuse my connection
with 127.0.1.1 ever. Would it help if I return the cached socket from OPENSOCKETFUNCTION callback,
 and CURL_SOCKOPT_ALREADY_CONNECTED from CURLOPT_SOCKOPT_FUNCTION?

Thanks,
--Edwin

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

&lt;/pre&gt;</description>
    <dc:creator>Török Edwin</dc:creator>
    <dc:date>2013-05-09T16:36:15</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.web.curl.library">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.web.curl.library</link>
  </textinput>
</rdf:RDF>
