Rob Ward | 9 Feb 18:58
Picon
Gravatar

Fwd: Re: setting LD_LIBRARY_PATH when cross-compiling

On 9 February 2012 16:53, Patrick Monnerat <Patrick.Monnerat <at> datasphere.ch> wrote:
>
>
> Rob Ward wrote:
>
> > Comments on if this approach will/won't work or if it could
> > be modified would be appreciated, and if it is completely
> > wrong please tell me, I won't take it personally :-)
>
> I think the approach is good, because it lets "configure" do the job.
> However I remember some similar problem with the "insight" debugger when
> compiling on a [3456]86 architecture, targetting another architecture in
> the same family (i.e.: cross-compiling for i686 on a i386): in this
> case, configure "thinks" we are cross-compiling even if the binary code
> compatibility is assured. I had to set an external mess to avoid this...
> But it was long ago... should be tested with more recent autotools.
>
> Patrick
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html

Hi Patrick,

Thanks for that, not sure how well it detects that type of situation, I guess this just needs testing on lots of different machines.

I have additionally attached a change to add output to ./configure when run to show if cross compiling in an easy to read manner.

Further comments on this welcome(as are tests in cross compile environments as it is still untested)

Cheers,

Rob

--
------------------------------

Rob Ward
www.rob-ward.co.uk

From cf59a674fb60ea702980b154e1f98e3c8a59adb1 Mon Sep 17 00:00:00 2001
From: Rob Ward <rob <at> rob-ward.co.uk>
Date: Thu, 9 Feb 2012 17:42:29 +0000
Subject: [PATCH 2/2] Adds Cross Compiling flag to output from configure

Adds Cross Compiling : ${cross_compiling} to the list that is output from configure
---
 configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7f74dca..7225e0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3310,6 +3310,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
   Host setup:      ${host}
   Install prefix:  ${prefix}
   Compiler:        ${CC}
+  Cross Compiling: ${cross_compiling}
   SSL support:     ${curl_ssl_msg}
   SSH support:     ${curl_ssh_msg}
   zlib support:    ${curl_zlib_msg}
--

-- 
1.7.1

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Scott Richter | 9 Feb 15:09
Picon
Gravatar

Using Default Proxy Credentials on Windows

Hello,

I have an application using libcurl to perform transfers over HTTP and HTTPS to a web server.

Many of the end-users' PCs are behind proxy servers using domain authentication.  I'm not sure of the details of how this works, but we have the same thing here where I work.  I don't have to enter my username/password for the proxy server, it just works using my Windows login credentials.

I wrote a .NET application a while back, and I used the CredentialCache.DefaultNetworkCredentials as the credentials for the proxy settings.  This application is able to connect to the Internet fine without the user entering their login credentials.

When I try to use libcurl to transfer files, I am getting a proxy authentication required error.  My questions is, how do I tell libcurl to use the default credentials of the logged in user for proxy authentication, in the same way I can tell .NET to do so?  My goal is that the user should never have to enter their proxy username/password, because most of my users will have no idea what that is.  Any help would be appreciated.

Thanks,
Scott

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Rohan Desai | 9 Feb 03:31
Picon
Gravatar

Question about using curl_easy_setopt CURL_INFILESIZE_LARGE

Hello,


I am using libcurl to send an HTTP PUT. To set the Content-Length on upload I use a call to:

curl_easy_setopt(curl handle, CURLOPT_INFILESIZE_LARGE, file size)

For most requests, i provide a curl_off_t for file size. However for 0-byte (empty) files i use:

curl_easy_setopt(curl handle, CURLOPT_INFILESIZE_LARGE, 0L)

This is causing my PUT to sometimes go out with huge Content-Length values. For  example:

Content-Length: 163208757248

Any ideas why this happens?

Thanks,

Rohan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Preston Van Loon | 9 Feb 00:13
Picon
Gravatar

How to send http post without receiving data

I have set up a successful POST function using the curl easy interface.
How do I set it up so that only sends the POST data, but does not receive data?
Better yet, how can I set it up so it sends the POST, but doesn't wait around to see if it even went through?

Thanks

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg | 8 Feb 22:30
Picon
Favicon
Gravatar

setting LD_LIBRARY_PATH when cross-compiling

Hi friends,

I found this patch of curl's configure.ac in the Yocto project:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-support/curl/c
url/noldlibpath.patch

While being quite hard-coded, it does have a point in that we should not touch 
LD_LIBRARY_PATH when cross-compiling. Any taker on fixing it properly?

--

-- 

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

Rich Gray | 8 Feb 19:10
Favicon
Gravatar

POP3 returns line data and CRLF separately, drops final CRLF

As noted in a previous e-mail (Jan 31, "State of POP3 in curl?"), I'm
working on a prototype POP3 download program utilizing libcurl.  I've got
my part of that prototype pretty much completed, but have noticed a couple
of anomalies:

1.  Libcurl is returning message data line-by-line, with two callbacks per
line - one for the line data and the other for the CRLF.  This seems like
strange behavior.  I'd coded as if I were getting the data off a TCP
connection - might get one byte, might get the whole message in one shot,
might get anything between.  So I'm curious as to what the intent is here.
If it's going to return line at a time, it would be nice to get the line
with the CRLF in one callback.  If, as a function of the dot de-stuffing,
libcurl returns whole chunks of message data on CRLF boundaries, that
would be fine too.  I can deal with full, unaligned chunks of data too.
For the moment, I'm not going to consider any sort of alignment
entitlement.

2. Libcurl is dropping the final CRLF from the data.  Although it can be
coped with, this seems wrong.  E-mail messages are always CRLF terminated
lines.  Not getting the final CRLF leaves a hanging, incomplete, line.  I
think this might be a mis-interpretation of RFC 1939, section 3 - Basic
Operation:

   Responses to certain commands are multi-line.  In these cases, which
   are clearly indicated below, after sending the first line of the
   response and a CRLF, any additional lines are sent, each terminated
   by a CRLF pair.  When all lines of the response have been sent, a
   final line is sent, consisting of a termination octet (decimal code
   046, ".") and a CRLF pair.  If any line of the multi-line response
   begins with the termination octet, the line is "byte-stuffed" by
   pre-pending the termination octet to that line of the response.
   Hence a multi-line response is terminated with the five octets
   "CRLF.CRLF".  When examining a multi-line response, the client checks
   to see if the line begins with the termination octet.  If so and if
   octets other than CRLF follow, the first octet of the line (the
   termination octet) is stripped away.  If so and if CRLF immediately
   follows the termination character, then the response from the POP
   server is ended and the line containing ".CRLF" is not considered
   part of the multi-line response.

I think the libcurl implementation has keyed off the "CRLF.CRLF" sentence
in the middle of this paragraph, whereas the final sentence clearly states
that the final ".CRLF" is not part of the data.  By implication, the
immediately preceding CRLF of the last line is part of the data.  Or, it's
just a bug! ;P

Using this write callback routine for a LIST command,

 size_t pop_list_data(char *ptr, size_t size, size_t nmemb, void
*userdata)
 {
    int bytes = (int)(size * nmemb);
    int *num_msgs = userdata;
    int n;

    printf("list >%.*s<\n", bytes, ptr);
    if (*ptr >= '0' && *ptr <= '9')
       if ((n = atoi(ptr)) > 0)
          *num_msgs = n;
    return bytes;
 }

with two messages in the mailbox, I get:

> LIST
< +OK 2 messages (31754 octets)
list >1 16050<
list >
<
list >2 15704<
* Connection #0 to host XXXXXX left intact

which shows both issues 1 & 2.   (Yes, I did shamelessly take advantage of
the line-by-line data return for the prototype. ;)  This will be redone in
a final version anyway, using STAT or UIDL.)

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

Picon
Gravatar

Protocol https not supported or disabled in libcurl for .aspx site

Hi, i have this error message traing to make a login on a .aspx site. Here is my code:
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <curl/easy.h>
int main()
{
curl_global_init( CURL_GLOBAL_ALL );
CURL * myHandle = curl_easy_init ( );
 
curl_easy_setopt(myHandle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
curl_easy_setopt(myHandle, CURLOPT_AUTOREFERER, 1 );
curl_easy_setopt(myHandle, CURLOPT_FOLLOWLOCATION, 1 );
curl_easy_setopt(myHandle, CURLOPT_COOKIEFILE, "");
curl_easy_setopt(myHandle, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(myHandle, CURLOPT_SSL_VERIFYHOST, 2);
curl_easy_setopt(myHandle, CURLOPT_TIMEOUT, 10);
curl_easy_setopt(myHandle, CURLOPT_VERBOSE, 1L);
 
curl_easy_setopt(myHandle, CURLOPT_URL, "https://trader.iforex.com/webpl/frm.aspx");
curl_easy_perform( myHandle );

curl_easy_setopt(myHandle, CURLOPT_REFERER, "https://trader.iforex.com/webpl/frm.aspx");
char *data="username=myuser <at> lol.com&password=mypassw";
curl_easy_setopt(myHandle, CURLOPT_POSTFIELDS, data);
curl_easy_perform( myHandle );
curl_easy_cleanup( myHandle );

return 0;
}
 
I HAVE THIS ERRORS:
#Protocol https not supported or disabled in libcurl
#Protocol https not supported or disabled in libcurl
 
Really do not understand what is wrong. I'm not very familiar with libcurl but I have everything correct.
 
HERE MY CURL-CONFIG
 
root <at> ubuntu10.4:/curl-7.24.0/examples# curl-config --version
libcurl 7.24.0
root <at> ubuntu10.4:/curl-7.24.0/examples# curl-config --libs
-L/usr/local/lib -lcurl -L/usr/local/ssl/lib -lidn -lssh2 -lssl -lcrypto -lldap -lrt -lssl -lcrypto -ldl -lz -lz -lssh2
root <at> ubuntu10.4:/curl-7.24.0/examples# curl-config --protocols
DICT
FILE
FTP
FTPS
GOPHER
HTTP
HTTPS
IMAP
IMAPS
LDAP
LDAPS
POP3
POP3S
RTSP
SCP
SFTP
SMTP
SMTPS
TELNET
TFTP
root <at> ubuntu10.4:/curl-7.24.0/examples# curl-config --features
SSL
IPv6
libz
IDN
NTLM
NTLM_WB
 
Appreciate any help or guide to the solution.
 
Thanks!!!....
Don.
 
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
ajil koshy | 8 Feb 15:24
Picon
Gravatar

How to identify graceful disconnection by remote peer while using multi-interface

Hi,

I have written an HTTPS client application using libcurl v7.23.1 (powered by openssl for SSL support) on windows. I am using multi-interface to connect to a remote HTTPS server and exchange data. Only a single easy handle is added to the multi-stack. As illustrated in the code example for using multi-interface on the libcurl site, I alternately call multi-perform & select API in a loop. Once my client and the remote server have exchanged data, the remote server sends ssl_close_notify and closes the TCP connection.

I would like to know on the client side, what is the right way to identify that the remote peer has disconnected gracefully i.e. closed the TCP connection?

I have emperically verified that max_fd contains a value of -1 if we call curl_multi_fdset () after remote peer has disconnected but I doubt if this can be used as an indicator for deducing this (based on documentation of culr_multi_fdset ()). I would expect that the number of running easy handles to hit zero if peer disconnects but this doesn't happen.

Thanks
Ajil Koshy

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
sukanya c | 8 Feb 14:02
Picon

Memory consumption during large uploads..

I work for activesync application that use libcurl for client HTTP operations.
 
I noticed that during 10MB data upload, the peak memory consumption reaches more than 10MB.

Is it possible to send data to network in the form of chunks and discard the chunks that are already posted to network. This can reduce the peak memory consumption on the client during uploads.

Please suggest any other better methods that I can use to reduce the memory consumption for clients during large data upload.

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

IPV6 handing regression bisected to commit 9109cdec11ee5a19f132fd7bdf2e9ceefea4de41

Hi:

In the latest curl release there is a regression

9109cdec11ee5a19f132fd7bdf2e9ceefea4de41 is the first bad commit
commit 9109cdec11ee5a19f132fd7bdf2e9ceefea4de41
Author: Daniel Stenberg <daniel <at> haxx.se>
Date:   Mon Dec 5 10:58:38 2011 +0100

     Curl_socket: internal replacement for socket()

     Moved out into a separate function to work as a "generic" socket()
     replacement.

:040000 040000 e0da372e84bb0ef7b31fd40ba0193bf5e5ca686e
0c3f9b07f90ece45b95a32e1ad0800b89ef5077d M      lib

Test:

curl 
http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/repodata/repomd.xml

boot your system with ipv6.disable=1

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

Olaf van der Spek | 6 Feb 23:38

Makefile.vc: why .vc?

Hi,

Why does this file have a .vc extension?
Dropping the extension would allow nmake to be invoked without /f
Makefile.vc argument.

--

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


Gmane