Re: Segfault downloading two files with -O -J

2011-08-21 Thread Paul Howarth
On Sat, 20 Aug 2011 00:30:43 +0200 (CEST)
Daniel Stenberg dan...@haxx.se wrote:

 On Thu, 18 Aug 2011, Paul Howarth wrote:
 
  https://github.com/bagder/curl/commit/5eb2396cd15cbbf73b02
 
  It doesn't for me:
 
 Hm, ok then perhaps something else fixed it since with my git version
 I cannot reproduce. I also ran it successfully with valgrind to
 verify a little extra.
 
 Can you try the git version and check in your end?

I've tried with the 20110821 daily snapshot and get slightly different
output but still a core dump:

$ curl -O -J 
'http://koji.fedoraproject.org/koji/getfile?taskID=3281612name=ibus-1.3.99.20110419-15.fc15.x86_64.rpm'
 
'http://koji.fedoraproject.org/koji/getfile?taskID=3281612name=ibus-libs-1.3.99.20110419-15.fc15.x86_64.rpm'
 /dev/null
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
  0 00 00 0  0  0 --:--:-- --:--:-- --:--:-- 
0Warning: Refusing to overwrite ibus-1.3.99.20110419-15.fc15.x86_64.rpm: File 
Warning: exists
  0  388k0  10400 0   2369  0  0:02:48 --:--:--  0:02:48  2482
curl: (23) Failed writing body (0 != 1040)
Segmentation fault (core dumped)

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


Re: Segfault downloading two files with -O -J

2011-08-21 Thread Paul Howarth
On Sun, 21 Aug 2011 10:38:25 +0100
Paul Howarth p...@city-fan.org wrote:

 On Sat, 20 Aug 2011 00:30:43 +0200 (CEST)
 Daniel Stenberg dan...@haxx.se wrote:
 
  On Thu, 18 Aug 2011, Paul Howarth wrote:
  
   https://github.com/bagder/curl/commit/5eb2396cd15cbbf73b02
  
   It doesn't for me:
  
  Hm, ok then perhaps something else fixed it since with my git
  version I cannot reproduce. I also ran it successfully with
  valgrind to verify a little extra.
  
  Can you try the git version and check in your end?
 
 I've tried with the 20110821 daily snapshot and get slightly different
 output but still a core dump:
 
 $ curl -O -J
 'http://koji.fedoraproject.org/koji/getfile?taskID=3281612name=ibus-1.3.99.20110419-15.fc15.x86_64.rpm'
 'http://koji.fedoraproject.org/koji/getfile?taskID=3281612name=ibus-libs-1.3.99.20110419-15.fc15.x86_64.rpm'
 /dev/null % Total% Received % Xferd  Average Speed   Time
 Time Time  Current Dload  Upload   Total   SpentLeft  Speed
 0 00 00 0  0  0 --:--:-- --:--:--
 --:--:-- 0Warning: Refusing to overwrite
 ibus-1.3.99.20110419-15.fc15.x86_64.rpm: File 
 Warning: exists
   0  388k0  10400 0   2369  0  0:02:48 --:--:--
 0:02:48  2482 curl: (23) Failed writing body (0 != 1040)
 Segmentation fault (core dumped)

I got this backtrace from gdb:

#0  0x004067ce in header_callback (ptr=0x62a150, size=optimized out, 
nmemb=optimized out, stream=0x0) at main.c:4610
#1  0x77d9c04b in Curl_client_write (conn=0x62be30, type=optimized 
out, 
ptr=0x62a150 Content-Disposition: attachment; 
filename=ibus-libs-1.3.99.20110419-15.fc15.x86_64.rpm\r\n, len=88) at 
sendf.c:483
#2  0x77d9ab9e in Curl_http_readwrite_headers (data=0x621560, 
conn=0x62be30, nread=0x7fffd5a0, stop_reading=0x7fffd5af) at http.c:3397
#3  0x77dae33a in readwrite_data (done=0x7fffd63f, 
didwhat=read_sleb128: Corrupted DWARF expression.
) at transfer.c:464
#4  Curl_readwrite (conn=0x62be30, done=0x7fffd63f) at transfer.c:1025
#5  0x77dafb84 in Transfer (conn=0x62be30) at transfer.c:1392
#6  Curl_do_perform (data=0x621560) at transfer.c:2133
#7  0x00404369 in operate (argv=optimized out, argc=0, 
config=0x7fffd720) at main.c:5643
#8  main (argc=0, argv=optimized out) at main.c:5968

Paul.
 
 Paul.
 ---
 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


Re: Compiling libcurl staticly within DLL-module with mingw32

2011-08-21 Thread Alexander Tumin
I have tried to redefine CURL_EXTERN myself, in curl/curl.h after
where it was defined, both to __declspec(dllimport) and
__declspec(dllexport) with no luck - libcurl replaces all dll symbols
by it's own when linked staticly.
---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html



Re: Segfault downloading two files with -O -J

2011-08-21 Thread Daniel Stenberg

On Sun, 21 Aug 2011, Paul Howarth wrote:


I got this backtrace from gdb:


Thanks. I've pushed commit 61ae7e9ce77a now which I believe now makes the fix 
more complete. Sorry about that.


--

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


Re: Segfault downloading two files with -O -J

2011-08-21 Thread Paul Howarth
On Sun, 21 Aug 2011 13:02:29 +0200 (CEST)
Daniel Stenberg dan...@haxx.se wrote:

 On Sun, 21 Aug 2011, Paul Howarth wrote:
 
  I got this backtrace from gdb:
 
 Thanks. I've pushed commit 61ae7e9ce77a now which I believe now makes
 the fix more complete. Sorry about that.

Thanks, that seems to have nailed it here.

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



RE: [PATCH] Curl_gethostname() may or may not return the hostname as a FQDN

2011-08-21 Thread Daniel Stenberg

On Thu, 11 Aug 2011, Steve Holme wrote:

I have had an attempt at trying to use Curl_resolv() and 
Curl_resolv_timeout() but unfortunately the CANONICAL name is always empty. 
It would appear that the underlying Curl_resolver_getaddrinfo() does not set 
the ai_flags to include: AI_CANONNAME :(


(sorry for the major delay)

Argh, that's correct. We don't have anything in libcurl before this that 
needs that feature.


I wonder how large percentage of use cases this will work for anyway. Lots of 
machines today that speak SMTP will not be able to resolve their own names.


Is it really worth persuing or should we work on better documenting how a 
client should do to provide the full host name itself?


--

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


RE: [PATCH] Added AUTH NTLM for SMTP

2011-08-21 Thread Steve Holme
Hi Yang,
 
 There's no real need for you to generate an additional patch, I can manage
 from this point without it. But of course you can provide it if you wish
so ;-)

Many thanks - it is much appreciated. I spent just over 2 days (about 20
hours) writing the original modification to Libcurl and since then nearly 35
hours on producing the various patches.

At what stage are we now? I see there hasn't been any feedback about the
code moving to curl_ntlm.[ch] so can we start to introduce the smtp code
changes to introduce the NTLM feature?

Kind Regards

Steve 

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


RE: [PATCH] Curl_gethostname() may or may not return the hostname as a FQDN

2011-08-21 Thread Steve Holme
Hiya Daniel,

 (sorry for the major delay)

No problem - I assumed you were busy with more important Curl matters / have
a personal life ;-)

 Argh, that's correct. We don't have anything in libcurl before this that
needs that feature.
 
 I wonder how large percentage of use cases this will work for anyway. Lots
of machines today that speak SMTP will not be able to resolve their own
names.

I must admit I honestly can't answer that. My own testing of Libcurl has
been performed against Exchange Server 2010 and that doesn't appear to have
any problems. However, I have found various articles around the web that
talk about this problem with the Windows SMTP service. 

 Is it really worth persuing or should we work on better documenting how a
client should do to provide the full host name itself?

Good question. How easy / difficult would it be to add the AI_CANONNAME flag
to Curl_resolv()'s underlying functions and what impact would this have on
their performance?

Over the last week I have had some thoughts about the Curl_gethostname()
function and I must admit I really don't like changing the function's
argument list so dramatically (as I did in my example code). If we are to do
this I would much rather we change the behaviour of Curl_gethostname() to
return just the hostname, in a non-fully qualified manner, thus stripping
off the domain if necessary and adding a separate
Curl_getfullyqualifiedhostname() or Curl_getfqhostname() function that calls
Curl_resolv() as required. The benefit of doing this is that the behaviour
of Curl_gethostname() is then defined as returning just the hostname and is
constant across all platforms rather than at present where it may return the
hostname, it may return the fully qualified hostname. The programmer who is
calling the function has no idea what the underlying stack is going to
return unless they perform a test on the string (as is the case of the
existing NTLM code).

If we decide not to modify Curl_resolv()'s underlying functions then I would
still recommend we modify the output of Curl_gethostname() so it returns a
defined value, but we will also need to think of a better way of passing the
fully qualified machine name in the EHLO and HELO commands when talking to
an SMTP server instead of using Curl_gethostname(). In my case, this would
just move the problem from Libcurl to where I am using it as I would still
need to perform an getaddrinfo() to get the fully qualified machine name ;-)

Best Regards

Steve

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


Re: Compiling libcurl staticly within DLL-module with mingw32

2011-08-21 Thread Alexander Tumin
After compiling libcurl with -DCURL_STATICLIB
(CPPFLAGS=-DCURL_STATICLIB ./configure
--prefix=/home/crosscompile/i686-mingw32/tree/ ... etc)
all worked! Big thanks to B4gder from #c...@freenode.irc for this hint!
---
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html