Re: Old Curl Project

2018-05-18 Thread Don Landsom
Sorry for more questions. Getting better at building and understanding many of 
the different versions of Curl including the latest, but far from having s good 
handle on any of this. 

After successfully building the Curl dll and lib files, we run into problems 
when rebuilding / linking vblibcurl, the wrapper for our VB app. 

Depending on which version of Curl being used, either the Curl ‘easy’ functions 
comes up as unresolved externals, or VB throws and error.

For Curl builds, are their options available to exclude / include the easy 
functions in the dll?

The VB issue says the vblibcurl wrapper can no longer be located, which we 
believe to be an erroneous message as the file most certainly does exist. It 
would seem more likely there’s a compatibility issue between vblibcurl and 
libcurl throwing an exception that’s improperly being reported as a file not 
found message.

  - Original Message - 
  From: Joel Winarske 
  To: libcurl development 
  Sent: Friday, May 18, 2018 9:52 AM
  Subject: Re: Old Curl Project


  Hi Don,


  Yeah it can be  risky.  I've been there :)


  The size will depend on what the build is configured for, as well as 
encryption libs, and how they're linked.  MBedTLS is smaller than OpenSSl, in 
addition I link to a static MBedTLs, and I have the build config pretty 
minimal; just enabling SMTP.  You may need to change the build options if you 
need LDAP, etc.


  I use this stack combo for an Alexa client.  In which case I only have HTTP2 
enabled.  It keeps the footprint down.


  Joel


  On Thu, May 17, 2018, 10:18 PM Don Landsom  wrote:

Thanks again Joel.

If there were a contest to see how many erogenous warning and errors that 
could be generated from developing on an old platform, we might be in the 
running. From missing declarations from the most basic such as WIN32 to others 
that have much more of an obscure nature to them. To problems occurring from 
subsystems like PDSK and LDAP that happen to be insufficient in their library 
versions, to completely missing libraries and header files. One can sit 
watching the compiler and or linker scroll volumes of errors for what seems 
like an eternity.
Then comes the order in which products must be installed as when attempting 
to correct issue with say the MS SDK and it’s inability to load while the C 
redistributable is installed. And don’t even want to get into the OS, and 
development tool service packs which at times appear to have a desire be loaded 
and then reloaded as other products are added. After a while you start to feel 
like a dog that’s chasing his own tail.

While it did mean leavening all of this behind, thank goodness, moving to 
the new version was definitely the way to go, thanks for getting us headed in 
the right direction.

This is neither here nor there, but I’ve noticed when checking file sizes 
for Curl dll’s and library files, they seem to be all over the place. Up for 
some and down in others, which is to be expected as the product grows, but it 
seems unusual for later releases to be smaller then previous ones. Is this 
possibly coming from the particular features the Curl version was built with?

Thanks

  - Original Message - 
  From: Joel Winarske 
  To: libcurl development 
  Sent: Thursday, May 17, 2018 12:48 PM
  Subject: Re: Old Curl Project


  Either should work fine.  I just used the most current release for my 
CMake file. 


  Whichever VS version you do use, ensure you have the proper tool chain 
installed to support XP prior to using CMake.


  On Thu, May 17, 2018 at 9:16 AM, Don Landsom  
wrote:

Thanks for the help and links. We have no problem going after a build 
with the latest and greatest. We already have 7.59, but noticed that 7.60 was 
just recently released. Should we go ahead and grab 60 and work with it instead 
of 59?

  - Original Message - 
  From: Joel Winarske 
  To: libcurl development 
  Sent: Thursday, May 17, 2018 11:31 AM
  Subject: Re: Old Curl Project


  I just tested the follow work via CMake and VS2015: 
  
https://gist.github.com/INRIX-joel-winarske/beb8a4a1192d5737fd789f05b22590ca



  Copy CMakeLists.txt to a folder, create a subfolder called build.  cd 
into that, and issue the solution generator command:



  cmake -G"Visual Studio 14 2015" ..



  This does need to be run on the build machine, and note it will have 
hard coded paths to the build machine.  


  Swap out the below string depending on which VS variant you want:
Visual Studio 14 2015

Visual Studio 12 2013
Visual Studio 11 2012
Visual Studio 10 2010
Visual Studio 9 2008
Visual Studio 8 2005


  After that open your selected VS as admin (to allow installation), 
and open the 

Re: SMB: unable to upload file to a subfolder: remote file not found

2018-05-18 Thread René Berber
On 5/18/2018 6:34 AM, Ivan Pilipenko wrote:

> I have an implementation of a tool that uses libcurl 7.60.0 to upload
> report files to an FTP server, creating subdirectories as needed. So
> far this has been working fine, but now we also got a request to do
> the same using SMB.
> 
> The implementation I got so far manages to upload a file to a share's
> root folder, i.e. "smb://myserver/share/test.txt", but fails when
> attempting to upload the file to an _existing_ subfolder, i.e.
> "smb://myserver/share/testfolder/test.txt".
[snip]
> 
> Executing results in "CURL error: Remote file not found", errorBuffer
> is empty. I am not quite sure why this error message is returned by
> libcurl. Obviously, the remote file might not exist when I'm
> attempting to upload one?

Usually the problem is with permissions.  At least for me when working
with a Linux server that is running Samba/CIFS.

And I don't mean the permissions as seen on the Windows side, those are
not always useful.  The main thing is ownership and permissions, and how
Samba (if involved) might map them (or not).
-- 
R. Berber
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Asiohiper example program delay

2018-05-18 Thread Sean Miller
> I think you've stepped on a libcurl bug!

Uh oh. I'll have to clean off my shoe.

> Are you doing HTTPS through a HTTP proxy by any chance? That's what the 
> PROTOCONNECT state is for basically.

Yes, almost everything I do in this large private cloud goes through proxies.

> Does it seem like that could be what happens in your case? If so, I'll write 
> up a patch you can test...

I'd be happy to test a patch. I've been poking around in the code a little 
myself, but I'm unfamiliar with it.

I've reproduced this on libcurl-7.19.7 (RHEL6... I know...) and libcurl-7.55.1, 
the latter of which I build myself.

Regards,
Sean M.
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Old Curl Project

2018-05-18 Thread Joel Winarske
Hi Don,

Yeah it can be  risky.  I've been there :)

The size will depend on what the build is configured for, as well as
encryption libs, and how they're linked.  MBedTLS is smaller than OpenSSl,
in addition I link to a static MBedTLs, and I have the build config pretty
minimal; just enabling SMTP.  You may need to change the build options if
you need LDAP, etc.

I use this stack combo for an Alexa client.  In which case I only have
HTTP2 enabled.  It keeps the footprint down.

Joel

On Thu, May 17, 2018, 10:18 PM Don Landsom  wrote:

> Thanks again Joel.
>
> If there were a contest to see how many erogenous warning and errors that
> could be generated from developing on an old platform, we might be in the
> running. From missing declarations from the most basic such as WIN32 to
> others that have much more of an obscure nature to them. To problems
> occurring from subsystems like PDSK and LDAP that happen to be insufficient
> in their library versions, to completely missing libraries and header
> files. One can sit watching the compiler and or linker scroll volumes of
> errors for what seems like an eternity.
>
> Then comes the order in which products must be installed as when
> attempting to correct issue with say the MS SDK and it’s inability to load
> while the C redistributable is installed. And don’t even want to get into
> the OS, and development tool service packs which at times appear to have a
> desire be loaded and then reloaded as other products are added. After a
> while you start to feel like a dog that’s chasing his own tail.
>
> While it did mean leavening all of this behind, thank goodness, moving to
> the new version was definitely the way to go, thanks for getting us headed
> in the right direction.
>
> This is neither here nor there, but I’ve noticed when checking file sizes
> for Curl dll’s and library files, they seem to be all over the place. Up
> for some and down in others, which is to be expected as the product grows,
> but it seems unusual for later releases to be smaller then previous ones.
> Is this possibly coming from the particular features the Curl version was
> built with?
>
> Thanks
>
> - Original Message -
> *From:* Joel Winarske 
> *To:* libcurl development 
> *Sent:* Thursday, May 17, 2018 12:48 PM
> *Subject:* Re: Old Curl Project
>
> Either should work fine.  I just used the most current release for my
> CMake file.
>
> Whichever VS version you do use, ensure you have the proper tool chain
> installed to support XP prior to using CMake.
>
> On Thu, May 17, 2018 at 9:16 AM, Don Landsom 
> wrote:
>
>> Thanks for the help and links. We have no problem going after a build
>> with the latest and greatest. We already have 7.59, but noticed that 7.60
>> was just recently released. Should we go ahead and grab 60 and work with it
>> instead of 59?
>>
>> - Original Message -
>> *From:* Joel Winarske 
>> *To:* libcurl development 
>> *Sent:* Thursday, May 17, 2018 11:31 AM
>> *Subject:* Re: Old Curl Project
>>
>> I just tested the follow work via CMake and VS2015:
>>
>> https://gist.github.com/INRIX-joel-winarske/beb8a4a1192d5737fd789f05b22590ca
>>
>> Copy CMakeLists.txt to a folder, create a subfolder called build.  cd
>> into that, and issue the solution generator command:
>>
>> cmake -G"Visual Studio 14 2015" ..
>>
>> This does need to be run on the build machine, and note it will have hard
>> coded paths to the build machine.
>>
>> Swap out the below string depending on which VS variant you want:
>>   Visual Studio 14 2015
>>   Visual Studio 12 2013
>>   Visual Studio 11 2012
>>   Visual Studio 10 2010
>>   Visual Studio 9 2008
>>   Visual Studio 8 2005
>>
>> After that open your selected VS as admin (to allow installation), and
>> open the solution.
>> Ensure your target for each project is as you want, then build
>> "BUILD_ALL".
>>
>> You may need to right-click solution, and select retarget picking the
>> proper sdk/toolchain for XP.
>>
>> Note I am running the generator cmd in a generic windows cmd prompt.
>> Just ensure CMake is in your path.
>>
>>
>> Joel
>>
>> On Thu, May 17, 2018 at 6:09 AM, Don Landsom 
>> wrote:
>>
>>> Joel, Thanks for the XP and VS2015 link, much appreciated.
>>>
>>> As for any preferences towards OpenSSL or any other libraries, we have
>>> none with our primary goal being to simply get our interim fix up and
>>> running. If Mbedtls makes for an easy drop in replacement for OpenSSL then
>>> there would be no objection.
>>>
>>> - Original Message -
>>> *From:* Joel Winarske 
>>> *To:* libcurl development 
>>> *Sent:* Thursday, May 17, 2018 8:48 AM
>>> *Subject:* Re: Old Curl Project
>>>
>>> Hi Don,
>>>
>>> You can Target XP with visual studio 2015.  Clues found here:
>>> 

SMB: unable to upload file to a subfolder: remote file not found

2018-05-18 Thread Ivan Pilipenko
Greetings,

I have an implementation of a tool that uses libcurl 7.60.0 to upload report 
files to an FTP server, creating subdirectories as needed. So far this has been 
working fine, but now we also got a request to do the same using SMB. 

The implementation I got so far manages to upload a file to a share's root 
folder, i.e. "smb://myserver/share/test.txt", but fails when attempting to 
upload the file to an _existing_ subfolder, i.e. 
"smb://myserver/share/testfolder/test.txt".

This is my code so far (relevant excerpt):

// reset all parameters
curl_easy_reset(curl);

// set username and password
string userPwd = user + ":" + password;
setCurlOption(CURLOPT_USERPWD, userPwd);
setCurlOption(CURLOPT_NOPROGRESS, 1);

// we want to use our own read function
setCurlOption(CurlOption(CURLOPT_READFUNCTION, readCallbackFunction));

// enable uploading
setCurlOption(CurlOption(CURLOPT_UPLOAD, 1L));

// iterate over all NamedDataElements
for(const auto& namedData : namedDataElements) {
// create pair with read position for this NamedData
if(namedData == nullptr) {
continue;
}

pair namedDataReadPos = make_pair(namedData.get(), 0);

// now specify which namedData to upload
setCurlOption(CurlOption(CURLOPT_READDATA, ));

// set the size of the namedData
curl_off_t dataLength = static_cast(namedData->getLength());
setCurlOption(CurlOption(CURLOPT_INFILESIZE_LARGE, dataLength));

string filename = "smb://server/share/testfolder/test.txt";
setCurlOption(CurlOption(CURLOPT_URL, filename));

// provide a buffer to store errors in and set the error buffer to empty 
before performing a request
std::fill_n(errorBuffer, CURL_ERROR_SIZE + 1, '\0');
try {
setCurlOption(CURLOPT_ERRORBUFFER, errorBuffer);
}
catch(const MvException&) {
if(doThrow) {
// rethrow
throw;
}
}

auto result = curl_easy_perform(curl);
if(CURLE_OK != result && doThrow == true) {
throwCurlStatus(result, __FUNCTION__, __LINE__, errorBuffer);
}
}

Executing results in "CURL error: Remote file not found", errorBuffer is empty. 
I am not quite sure why this error message is returned by libcurl. Obviously, 
the remote file might not exist when I'm attempting to upload one?

Any help is appreciated.

Regards,
Ivan
-
Upcoming Events:
19.-22. June: AUTOMATICA, Munich, Germany
06.-08. November: VISION, Stuttgart, Germany 
-

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Uwe Furtner
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Fixes/patch for curl-7.60.0 (fwd)

2018-05-18 Thread Daniel Stenberg

Hey all,

Here's Stefan's suggested patch for a few windows build issues.

At least the "add the manifest" part has already been discussed and left 
without action [1].


I personally am not a windows developer; I need guidance and feedback from 
those of you who are and have opinions on this patch. Either for or against.


[1] = https://github.com/curl/curl/issues/2326

(Stefan is not subscribed, keep him CC'ed when replying)

--

 / daniel.haxx.se

-- Forwarded message --
From: Stefan Kanthak

Hi all,

the attached patch adds an icon (copy 
as curl.ico into the top level directory of the source tree) to the
Windows executables, plus an application manifest to prevent DLL
hijacking, and fixes some minor bugs in winbuild\MakefileBuild.vc:
some time ago Steve (?) added the macro RC = rc.exe, but replaced
only the first occurence of rc[.exe], not the second at the end of
Makefile.vc
Also builds with the compilers distributed with the Platform SDK
for Windows Server 2003 (which is named in winbuild\BUILD.WINDOWS.txt)
work now.

regards
Stefan Kanthak

curl-7.60.0.patch
Description: Binary data
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html