Re: Recommended setup for cross-platform development?

2016-02-26 Thread Daniel Stenberg

On Fri, 26 Feb 2016, Dave Nadler wrote:


What is the recommended setup technique for all the developers like us?


You run configure once on each platform and save that particular curlbuild.h 
and then you make your builds include that one for the correct platforms:


[platform 1]
./configure ...
mv curlbuild.h curlbuild-plat1.h

[platform 2]
./configure ...
mv curlbuild.h curlbuild-plat2.h

[platform 2]
./configure ...
mv curlbuild.h curlbuild-plat3.h

then you make a new curlbuild.h:

#ifdef plat1
#include "curlbuild-plat1.h"
#endif
#ifdef plat2
#include "curlbuild-plat2.h"
#endif
#ifdef plat3
#include "curlbuild-plat3.h"
#endif

--

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

Re: Gopher [Was ""]

2016-02-26 Thread bch
What I suspect that original code was going was parsing the content
from a gopher server (and in fact, taking some shortcuts that may have
happened to work for original use-case). The actual URI is the second
component of an appropriate gopher line, and to be used unadulterated.
What I think the previous code was supposed to do is take a raw line
from a gopher server and eliminate it's "status", and use the
user-visible component of the returned content as the URI. That sort
of parsing is better left for a higher-level client. This patch
removes the test of path length and stripping characters, but
preserves tab handling (arguably still removable) and escaping.

ref: rfc1436



Index: ./curl/lib/gopher.c
==
--- ./curl/lib/gopher.c
+++ ./curl/lib/gopher.c
@@ -84,36 +84,23 @@
   char *sel_org = NULL;
   ssize_t amount, k;
   int len;

   *done = TRUE; /* unconditionally */
+  size_t  j, i;

-  /* Create selector. Degenerate cases: / and /1 => convert to "" */
-  if(strlen(path) <= 2) {
-sel = (char *)"";
-len = (int)strlen(sel);
-  }
-  else {
-char *newp;
-size_t j, i;
+  /* ... then turn ? into TAB for search servers, Veronica, etc. ... */
+  j = strlen (path);
+  for (i = 0; i < j; i++)
+if (path[i] == '?')
+  path[i] = '\x09';

-/* Otherwise, drop / and the first character (i.e., item type) ... */
-newp = path;
-newp+=2;
-
-/* ... then turn ? into TAB for search servers, Veronica, etc. ... */
-j = strlen(newp);
-for(i=0; i wrote:
> On Fri, 26 Feb 2016, bch wrote:
>
>> You're probably right, re: "the number of people using gopher with
>> (lib)curl" --I was wondering if there was deep knowledge contained by you
>> (@bagder) or anybody else...
>
> I wrote the first gopher code before curl was even called curl, back in 1997
> or so, but I only used it for a short period of time and I really can't
> remember many specific details. Sorry.
>
>>  I may start hacking this for fun (not profit).
>
> We'll welcome your help!
>
> --
>
>   / daniel.haxx.se
> ---
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  https://curl.haxx.se/mail/etiquette.html
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Recommended setup for cross-platform development?

2016-02-26 Thread Dave Nadler

Hi, Sorry if this has been addressed, but I couldn't find it...

I'm (like many) working on a project that is developed and tested on a 
64-bit host
(Ubuntu in this case), and cross-compiled and deployed to many different 
targets,

(assorted arm, x86, MIPS), some of which are 32-bit. Trying to use curl.

I of course just got a failure in the curlrules.h checks...

I read: https://sourceforge.net/p/curl/bugs/1385/

What is the recommended setup technique for all the developers like us?

Thanks!
Best Regards, Dave

PS: Here's the installed Ubuntu configuration:
$ curl-config --configure
 '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' 
'--mandir=/usr/share/man' '--infodir=/usr/share/info' 
'--sysconfdir=/etc' '--localstatedir=/var' 
'--libdir=/usr/lib/x86_64-linux-gnu' 
'--libexecdir=/usr/lib/x86_64-linux-gnu' '--disable-maintainer-mode' 
'--disable-dependency-tracking' '--disable-symbol-hiding' 
'--enable-versioned-symbols' '--enable-threaded-resolver' 
'--with-lber-lib=lber' '--with-gssapi=/usr' 
'--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt' '--without-ssl' 
'--with-gnutls' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 
-fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro 
-Wl,--as-needed' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'


--
Dave Nadler, USA East Coast voice (978) 263-0097, d...@nadler.com, Skype
 Dave.Nadler1

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

Re: Gopher [Was ""]

2016-02-26 Thread Daniel Stenberg

On Fri, 26 Feb 2016, bch wrote:

You're probably right, re: "the number of people using gopher with 
(lib)curl" --I was wondering if there was deep knowledge contained by you 
(@bagder) or anybody else...


I wrote the first gopher code before curl was even called curl, back in 1997 
or so, but I only used it for a short period of time and I really can't 
remember many specific details. Sorry.



 I may start hacking this for fun (not profit).


We'll welcome your help!

--

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

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Ray Satiro via curl-library

On 2/26/2016 4:45 AM, Jules van der Toorn wrote:
Thanks for your answer on my previous question about how to only 
receive the subject of the most recent mail, it worked perfectly.
I build libCurl to a static library, but now i want to convert it to a 
static library.

I followed the guide of mtlynch on this page:
http://stackoverflow.com/questions/20171165/getting-libcurl-to-work-with-visual-studio-2013
When i build the simple code he gave in his guide, it works great. 
However if i use my (working with the dynamic library) mail receive 
program, MSVC gives an error: first it says "program.exe has triggered 
a breakpoint", and if i click continue it says: "Debug Assertion 
Failed!" "Expression: _CrtIsValidHeapPointer(pUserData)"
I already tried rebuilding with MACHINE=x64 (My pc is x64, but MSVC is 
x86).


I think Gisle is right, what you are seeing is likely because you are 
mixing debug and release static libraries. The directions you cite are 
for the release configuration not for the debug configuration. If you 
use those directions on a debug configuration then you will see a heap 
validation error. For more information please refer to 
https://github.com/curl/curl/issues/628#issuecomment-179079724


Also could you please not top post it's making the conversation hard to 
follow.

https://curl.haxx.se/mail/etiquette.html#Do_Not_Top_Post

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

Re: Gopher [Was ""]

2016-02-26 Thread bch
I'm reading more...:

The characters following the tab, up to the next tab form a selector
   string that the client software must send to the server to retrieve
   the document (or directory listing).  The selector string should mean
   nothing to the client software; it should never be modified by the
   client.  In practice, the selector string is often a pathname or
   other file selector used by the server to locate the item desired.
   The next two tab delimited fields denote the domain-name of the host
   that has this document (or directory), and the port at which to
   connect.  If there are yet other tab delimited fields, the basic
   Gopher client should ignore them.  A CR LF denotes the end of the
   item.


You're probably right, re: "the number of people using gopher with
(lib)curl" --I was wondering if there was deep knowledge contained by
you (@bagder) or anybody else... I may start hacking this for fun (not
profit).



Cheers :)


On 2/26/16, Daniel Stenberg  wrote:
> On Fri, 26 Feb 2016, bch wrote:
>
>> ...and I'm seeing what appears to be poor gopher URI handling:
>
> It just shows how many people are actually using gopher with (lib)curl
>
>> or am I misinterpetting what the URI really ought to be?
>
> Is there anyone around who still remembers how gopher URLs should be
> constructed? =) I certainly don't.
>
> Yet we have a few test cases that verify gopher functionality. So either
> that
> was a wrong URL or our tests are just too incomplete.
>
> --
>
>   / daniel.haxx.se
> ---
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  https://curl.haxx.se/mail/etiquette.html
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Re: Gopher [Was ""]

2016-02-26 Thread Daniel Stenberg

On Fri, 26 Feb 2016, bch wrote:


...and I'm seeing what appears to be poor gopher URI handling:


It just shows how many people are actually using gopher with (lib)curl


or am I misinterpetting what the URI really ought to be?


Is there anyone around who still remembers how gopher URLs should be 
constructed? =) I certainly don't.


Yet we have a few test cases that verify gopher functionality. So either that 
was a wrong URL or our tests are just too incomplete.


--

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

Re: Gopher [Was ""]

2016-02-26 Thread bch
I suspect what's going on is reflected by this text in RFC1436.


   The first character on each line tells whether the line describes a
   document, directory, or search service (characters '0', '1', '7';
   there are a handful more of these characters described later).  The
   succeeding characters up to the tab form a user display string to be
   shown to the user for use in selecting this document (or directory)
   for retrieval.  The first character of the line is really defining
   the type of item described on this line. In nearly every case, the
   Gopher client software will give the users some sort of idea about
   what type of item this is (by displaying an icon, a short text tag,
   or the like).



The _curl_ behaviour I'm seeing seems unintuitive, though; if the RFC
is saying that the first char is a status component (fair enough; a
statement of fact), is that part of the URI, or sort of the protocol?
If I'm passing something to libcurl or cURL, currently I'm expected to
put in a "garbage" character to be stripped. That behaviour seems out
of place. Comments ?

-bch

On 2/26/16, bch  wrote:
> ...and I'm seeing what appears to be poor gopher URI handling:
>
> $ curl gopher://gopher.metafilter.com/Music/Auld-Lang-Syne.html
> 3'/usic/Auld-Lang-Syne.html' does not exist (no handler found)
>  error.host  1
>
> or am I misinterpetting what the URI really ought to be?
>
> -bch
>
>
>
> On 2/26/16, bch  wrote:
>> After 15 year downtime...
>>
>> http://metatalk.metafilter.com/24019/Direct-your-gopher-client-to-gopher-gophermetafiltercom?utm_content=bufferaa556_medium=social_source=facebook.com_campaign=buffer
>>
>
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Gopher [Was ""]

2016-02-26 Thread bch
...and I'm seeing what appears to be poor gopher URI handling:

$ curl gopher://gopher.metafilter.com/Music/Auld-Lang-Syne.html
3'/usic/Auld-Lang-Syne.html' does not exist (no handler found)
 error.host  1

or am I misinterpetting what the URI really ought to be?

-bch



On 2/26/16, bch  wrote:
> After 15 year downtime...
>
> http://metatalk.metafilter.com/24019/Direct-your-gopher-client-to-gopher-gophermetafiltercom?utm_content=bufferaa556_medium=social_source=facebook.com_campaign=buffer
>
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

[no subject]

2016-02-26 Thread bch
After 15 year downtime...

http://metatalk.metafilter.com/24019/Direct-your-gopher-client-to-gopher-gophermetafiltercom?utm_content=bufferaa556_medium=social_source=facebook.com_campaign=buffer
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Re: Error "* Initializing NSS with certpath: sql:/etc/pki/nssdb"

2016-02-26 Thread cnm marketing
>>> But that is not the command I suggested you to use, is it?
Well, yes, you command is "openssl s_client", would you mind give me full
command to list all the cipher-suite for NSS.

On Fri, Feb 26, 2016 at 11:37 AM, cnm marketing 
wrote:

> >>> But that is not the command I suggested you to use, is it?
> Well, yes, you command is "openssl s_client", would you mind give me full
> command to list all the cipher-suite for NSS.
>
> On Fri, Feb 26, 2016 at 9:52 AM, cnm marketing 
> wrote:
>
>> >>> But that is not the command I suggested you to use, is it?
>> Well, yes, you command is "openssl s_client", would you mind give me
>> full command to list all the NSS.
>>
>> On Fri, Feb 26, 2016 at 9:37 AM, Kamil Dudka  wrote:
>>
>>> On Friday 26 February 2016 09:29:12 cnm marketing wrote:
>>> > The result of cipher-suite that I got from the server as following and
>>> none
>>> > of them shows up in the table -
>>> >
>>> > command used to get cipher-suite on the server: openssl ciphers
>>> 'ALL:eNULL'
>>>
>>> But that is not the command I suggested you to use, is it?
>>>
>>> It is not clear to me how such a list will help you to debug the issue.
>>>
>>> Kamil
>>>
>>> > {"ECDHE-RSA-AES256-GCM-SHA384",
>>> > "ECDHE-ECDSA-AES256-GCM-SHA384",
>>> > "ECDHE-RSA-AES256-SHA384",
>>> > "ECDHE-ECDSA-AES256-SHA384",
>>> > "ECDHE-RSA-AES256-SHA",
>>> > "ECDHE-ECDSA-AES256-SHA",
>>> > "DHE-DSS-AES256-GCM-SHA384",
>>> > "DHE-RSA-AES256-GCM-SHA384",
>>> > "DHE-RSA-AES256-SHA256",
>>> > "DHE-DSS-AES256-SHA256",
>>> > "DHE-RSA-AES256-SHA",
>>> > "DHE-DSS-AES256-SHA",
>>> > "DHE-RSA-CAMELLIA256-SHA",
>>> > "DHE-DSS-CAMELLIA256-SHA",
>>> > "AECDH-AES256-SHA",
>>> > "ADH-AES256-GCM-SHA384",
>>> > "ADH-AES256-SHA256",
>>> > "ADH-AES256-SHA",
>>> > "ADH-CAMELLIA256-SHA",
>>> > "ECDH-RSA-AES256-GCM-SHA384",
>>> > "ECDH-ECDSA-AES256-GCM-SHA384",
>>> > "ECDH-RSA-AES256-SHA384",
>>> > "ECDH-ECDSA-AES256-SHA384",
>>> > "ECDH-RSA-AES256-SHA",
>>> > "ECDH-ECDSA-AES256-SHA",
>>> > "AES256-GCM-SHA384",
>>> > "AES256-SHA256",
>>> > "AES256-SHA",
>>> > "CAMELLIA256-SHA",
>>> > "PSK-AES256-CBC-SHA",
>>> > "ECDHE-RSA-AES128-GCM-SHA256",
>>> > "ECDHE-ECDSA-AES128-GCM-SHA256",
>>> > "ECDHE-RSA-AES128-SHA256",
>>> > "ECDHE-ECDSA-AES128-SHA256",
>>> > "ECDHE-RSA-AES128-SHA",
>>> > "ECDHE-ECDSA-AES128-SHA",
>>> > "DHE-DSS-AES128-GCM-SHA256",
>>> > "DHE-RSA-AES128-GCM-SHA256",
>>> > "DHE-RSA-AES128-SHA256",
>>> > "DHE-DSS-AES128-SHA256",
>>> > "DHE-RSA-AES128-SHA",
>>> > "DHE-DSS-AES128-SHA",
>>> > "ECDHE-RSA-DES-CBC3-SHA",
>>> > "ECDHE-ECDSA-DES-CBC3-SHA",
>>> > "DHE-RSA-SEED-SHA",
>>> > "DHE-DSS-SEED-SHA",
>>> > "DHE-RSA-CAMELLIA128-SHA",
>>> > "DHE-DSS-CAMELLIA128-SHA",
>>> > "EDH-RSA-DES-CBC3-SHA",
>>> > "EDH-DSS-DES-CBC3-SHA",
>>> > "AECDH-AES128-SHA",
>>> > "ADH-AES128-GCM-SHA256",
>>> > "ADH-AES128-SHA256",
>>> > "ADH-AES128-SHA",
>>> > "AECDH-DES-CBC3-SHA",
>>> > "ADH-SEED-SHA",
>>> > "ADH-CAMELLIA128-SHA",
>>> > "ADH-DES-CBC3-SHA",
>>> > "ECDH-RSA-AES128-GCM-SHA256",
>>> > "ECDH-ECDSA-AES128-GCM-SHA256",
>>> > "ECDH-RSA-AES128-SHA256",
>>> > "ECDH-ECDSA-AES128-SHA256",
>>> > "ECDH-RSA-AES128-SHA",
>>> > "ECDH-ECDSA-AES128-SHA",
>>> > "ECDH-RSA-DES-CBC3-SHA",
>>> > "ECDH-ECDSA-DES-CBC3-SHA",
>>> > "AES128-GCM-SHA256",
>>> > "AES128-SHA256",
>>> > "AES128-SHA",
>>> > "SEED-SHA",
>>> > "CAMELLIA128-SHA",
>>> > "DES-CBC3-SHA",
>>> > "IDEA-CBC-SHA",
>>> > "DES-CBC3-MD5",
>>> > "IDEA-CBC-MD5",
>>> > "RC2-CBC-MD5",
>>> > "PSK-AES128-CBC-SHA",
>>> > "PSK-3DES-EDE-CBC-SHA",
>>> > "KRB5-IDEA-CBC-SHA",
>>> > "KRB5-DES-CBC3-SHA",
>>> > "KRB5-IDEA-CBC-MD5",
>>> > "KRB5-DES-CBC3-MD5",
>>> > "ECDHE-RSA-RC4-SHA",
>>> > "ECDHE-ECDSA-RC4-SHA",
>>> > "AECDH-RC4-SHA",
>>> > "ADH-RC4-MD5",
>>> > "ECDH-RSA-RC4-SHA",
>>> > "ECDH-ECDSA-RC4-SHA",
>>> > "RC4-SHA",
>>> > "RC4-MD5",
>>> > "RC4-MD5",
>>> > "PSK-RC4-SHA",
>>> > "KRB5-RC4-SHA",
>>> > "KRB5-RC4-MD5",
>>> > "EDH-RSA-DES-CBC-SHA",
>>> > "EDH-DSS-DES-CBC-SHA",
>>> > "ADH-DES-CBC-SHA",
>>> > "DES-CBC-SHA",
>>> > "DES-CBC-MD5",
>>> > "KRB5-DES-CBC-SHA",
>>> > "KRB5-DES-CBC-MD5",
>>> > "EXP-EDH-RSA-DES-CBC-SHA",
>>> > "EXP-EDH-DSS-DES-CBC-SHA",
>>> > "EXP-ADH-DES-CBC-SHA",
>>> > "EXP-DES-CBC-SHA",
>>> > "EXP-RC2-CBC-MD5",
>>> > "EXP-RC2-CBC-MD5",
>>> > "EXP-KRB5-RC2-CBC-SHA",
>>> > "EXP-KRB5-DES-CBC-SHA",
>>> > "EXP-KRB5-RC2-CBC-MD5",
>>> > "EXP-KRB5-DES-CBC-MD5",
>>> > "EXP-ADH-RC4-MD5",
>>> > "EXP-RC4-MD5",
>>> > "EXP-RC4-MD5",
>>> > "EXP-KRB5-RC4-SHA",
>>> > "EXP-KRB5-RC4-MD5",
>>> > "ECDHE-RSA-NULL-SHA",
>>> > "ECDHE-ECDSA-NULL-SHA",
>>> > "AECDH-NULL-SHA",
>>> > "ECDH-RSA-NULL-SHA",
>>> > "ECDH-ECDSA-NULL-SHA",
>>> > "NULL-SHA256",
>>> > "NULL-SHA",
>>> > "NULL-MD5"}
>>> >
>>> > On Thu, Feb 25, 2016 at 3:41 PM, Kamil Dudka 
>>> wrote:
>>> > > On Thursday, February 25, 2016 14:38:55 cnm marketing wrote:
>>> > > > Sorry, the server is inaccessible from outside.
>>> > > >
>>> > > > > Please check which cipher-suite exactly is 

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Jules van der Toorn
No the source code form the guide isn't an email receive program, it's just
a code to check if libcurl works.
This is the code:

#include "stdafx.h"
#include 
void main(int argc, char* argv[]){
CURL *curl = curl_easy_init();
if (curl) printf("curl_easy_init() succeeded!\n");
else fprintf(stderr, "Error calling curl_easy_init().\n");}

That one says url_easy_init() succeeded! when ran, so it's weird that the
curl_easy_perform function crashes. I received 3 answer from your support
(which is awesome), so first i will try to get the answer from their
responses.

2016-02-26 13:04 GMT+01:00 Daniel Stenberg :

> On Fri, 26 Feb 2016, Jules van der Toorn wrote:
>
> I personally think something went wrong with linking it, but then i don't
>> understand why the simple code from the guide does work and this one
>> doesn't.
>>
>
> Perhaps because this uses TLS and other one didn't?
>
> --
>
>  / daniel.haxx.se
> ---
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  https://curl.haxx.se/mail/etiquette.html
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Re: CURLOPT_SEEKFUNCTION with CURLFORM_STREAM

2016-02-26 Thread Daniel Stenberg

On Thu, 25 Feb 2016, Andrew Fouts wrote:

I'm using libcurl to POST form data using a FILE* with the CURLFORM_STREAM 
option of curl_formadd().  I've noticed that if the connection drops at just 
the right time, the POST is reattempted without the data from the file.  It 
seems like the file stream position isn't getting reset to the beginning of 
the file.  I found the CURLOPT_SEEKFUNCTION option and set that with a 
function that performs an fseek() on the FILE*.  However, setting that 
didn't seem to fix the issue or get called.


I searched the mailing lists and found 
https://curl.haxx.se/mail/lib-2013-09/0195.html, which sounds similar to my 
issue.  Did that issue ever get resolved?  If not, are there plans to 
implement a fix for that issue?


Oh well, look at that!

No, I can't recall that we ever did any such fix and it probably just slipped 
through and then drowned in the constant flood of other things.


Can you help us write up an as basic stand-alone program as possible that does 
basically the same operation you do, so that we can use that to create a test 
case that 1 - repeats the problem and then 2 - helps us verify a fix?


--

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

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Sergei Nikulov
26 февр. 2016 г. 2:59 PM пользователь "Jules van der Toorn" <
ju...@nuisdedag.nl> написал:
>
> Hi,
> Thanks for the quick answer!
...
> The code crashes at the curl_easy_perform(curl) function, but also later
at the curl_easy_cleanup(curl) function.
> I personally think something went wrong with linking it, but then i don't
understand why the simple code from the guide does work and this one
doesn't.
>
>

Sometimes such behaviour caused by wrong dll found in PATH.
Either libcurl, or openssl.
Could you please check it with console 'where' command?

>
>
> 2016-02-26 10:58 GMT+01:00 Daniel Stenberg :
>>
>> On Fri, 26 Feb 2016, Jules van der Toorn wrote:
>>
>>> When i build the simple code he gave in his guide, it works great.
However if i use my (working with the dynamic library) mail receive
program, MSVC gives an error: first it says "program.exe has triggered a
breakpoint", and if i click continue it says: "Debug Assertion Failed!"
"Expression: _CrtIsValidHeapPointer(pUserData)"
>>
>>
>> I'm afraid that is too little information for us to do anything with.
>>
>> Can you run it through a debugger and tell us more precisely where it
crashes and what the contents of the important local variables are?
>>
>> Honestly though, I would rather suspect a flaw in your build. Like not
using the correct memory model or something in one of the libs you use.
>>
>> --
>>
>>  / daniel.haxx.se
>> ---
>> List admin: https://cool.haxx.se/list/listinfo/curl-library
>> Etiquette:  https://curl.haxx.se/mail/etiquette.html
>
>
>
> ---
> List admin: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  https://curl.haxx.se/mail/etiquette.html
---
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Gisle Vanem
Jules van der Toorn wrote:

> Thanks for the quick answer! I don't think it's an error in my code, because 
> i literally copied the code from your site,
> the imap-fetch  code 
> (curl.haxx.se/libcurl/c/imap-fetch.html
> ), and that did work 
> previously when i had the dynamic libcurl library.

The important detail was:
  "Debug Assertion Failed! Expression: _CrtIsValidHeapPointer(pUserData)"

It usually means you're mixing code built with different C-RunTime libraries.
Like mixing debug (-MDd, -MTd) and release (-MD, -MT) objects. That could
happen easily when you go from a dynamic use of libcurl to a static build.
Since in a libcurl.dll it would malloc/free it's own memory. But when you
link all statically, the linker forces only 1 'free' and 1 'malloc' in the
resulting .exe (one can never have multiple symbols in the same PE-image).

To figure this out, make a more detailed .map-file; add '-verbose'
and see where malloc() and free() are really coming from.

Good luck.



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

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Daniel Stenberg

On Fri, 26 Feb 2016, Jules van der Toorn wrote:

I personally think something went wrong with linking it, but then i don't 
understand why the simple code from the guide does work and this one 
doesn't.


Perhaps because this uses TLS and other one didn't?

--

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

Re: Static Libcurl crashes on MSVC13

2016-02-26 Thread Daniel Stenberg

On Fri, 26 Feb 2016, Jules van der Toorn wrote:

When i build the simple code he gave in his guide, it works great. However 
if i use my (working with the dynamic library) mail receive program, MSVC 
gives an error: first it says "program.exe has triggered a breakpoint", and 
if i click continue it says: "Debug Assertion Failed!" "Expression: 
_CrtIsValidHeapPointer(pUserData)"


I'm afraid that is too little information for us to do anything with.

Can you run it through a debugger and tell us more precisely where it crashes 
and what the contents of the important local variables are?


Honestly though, I would rather suspect a flaw in your build. Like not using 
the correct memory model or something in one of the libs you use.


--

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