Jeff Phillips | 1 Mar 01:49 2005
Picon

Binding for Visual Basic 6 and Office VBA

Hello all,

I've placed an initial binding that should work with
Visual Basic 6 and Office VBA (Excel, Word, etc.) at:

http://sourceforge.net/projects/libcurl-vb/

Here are a couple of quick notes:

1. The project requires the VB6 engine; earlier
versions won't work.

2. It's implemented as a function-call API rather than
a COM object. That said, there is a type library, so
you don't have to type "Declare Function" all over the
place.

3. There are some samples, but not much documentation
as of yet. Anyone using this will definitely want to
consult the samples, as they show how to implement the
raw callbacks for things like CURLOPT_WRITEFUNCTION,
etc.

4. The Share interface is not implemented, and I'm not
sure that I plan on doing this. Everything else should
be pretty solid.

Take care,
Jeff Phillips

(Continue reading)

Andrei Tarassov | 1 Mar 09:29 2005
Picon

Segfault with Purify when running an application that uses libcurl

Hi!

I am experiencing difficulties with checking my application, which uses
curl functionality, with the Rational Purify tool. The application
crashes with a segmentation fault in Curl_connect_host() function at
line:
	res = Curl_connect(data, conn, &async); (transfer.c:2045, curl
7.12.3)

The problem occurs on a RH72 box. Running the application without
Rational Purify does not cause any problems. 

Has anyone experienced the same problem or knows why this is happening
and how it could be avoided?

Thanks,

--
	Andrei Tarassov
	software engineer
	altiris, inc.
	T > +372- 6507154
	M > +372-53-403298
	www.altiris.com

hzhijun | 1 Mar 10:38 2005

Re: Segfault with Purify when running an application that uses libcurl


----- Original Message ----- 
From: "Andrei Tarassov" <andrei.tarassov <at> altiris.ee>
To: "libcurl development" <curl-library <at> cool.haxx.se>
Sent: Tuesday, March 01, 2005 4:29 PM
Subject: Segfault with Purify when running an application that uses libcurl

> Hi!
> 
> I am experiencing difficulties with checking my application, which uses
> curl functionality, with the Rational Purify tool. The application
> crashes with a segmentation fault in Curl_connect_host() function at
> line:
> res = Curl_connect(data, conn, &async); (transfer.c:2045, curl
> 7.12.3)
> 
> The problem occurs on a RH72 box. Running the application without
> Rational Purify does not cause any problems. 
> 
> Has anyone experienced the same problem or knows why this is happening
> and how it could be avoided?
> 

Does ur application a multi-thread program?
> Thanks,
> 
> --
> Andrei Tarassov
> software engineer
> altiris, inc.
(Continue reading)

Andrei Tarassov | 1 Mar 11:43 2005
Picon

RE: Segfault with Purify when running an application that useslibcurl

Yeap, that's a multi-threaded program.

-----Original Message-----
From: curl-library-bounces <at> cool.haxx.se
[mailto:curl-library-bounces <at> cool.haxx.se] On Behalf Of hzhijun
Sent: Tuesday, March 01, 2005 11:38
To: libcurl development
Subject: Re: Segfault with Purify when running an application that
useslibcurl

----- Original Message ----- 
From: "Andrei Tarassov" <andrei.tarassov <at> altiris.ee>
To: "libcurl development" <curl-library <at> cool.haxx.se>
Sent: Tuesday, March 01, 2005 4:29 PM
Subject: Segfault with Purify when running an application that uses
libcurl

> Hi!
> 
> I am experiencing difficulties with checking my application, which
uses
> curl functionality, with the Rational Purify tool. The application
> crashes with a segmentation fault in Curl_connect_host() function at
> line:
> res = Curl_connect(data, conn, &async); (transfer.c:2045, curl
> 7.12.3)
> 
> The problem occurs on a RH72 box. Running the application without
> Rational Purify does not cause any problems. 
> 
(Continue reading)

Anthony Desouza | 1 Mar 15:15 2005
Picon

Using LibCurlNet in a Windows Service

Hi,

 

I am trying to use LIBCURLNET (thank you Jeff Phillips) in a C# Windows Service Project but am experiencing difficulty.

 

Everything builds and installs great, but when I try to access it from a Windows Service I get an exception fired “Unable to load DLL (libcurl.dll)” logged in an event log, so my CURL operation never takes place. I am perplexed, because the same code works fine from a Windows application

 

I have set up a reference to libcurlnet.dll in the service project and made sure that libcurl.dll is in the service install directory and even stuck it in the windows/system32 directory.

I have also set my path to include a reference to /libcurlnet/bin/

I expected Libcurlnet.dll to work the same whether in a service project or application project and I appear to be referencing it the same way.

 

I am a very new .NET developer. Is there any thing stupid I might be omitting to do when building my Window Service, to make sure it can load libcurl.dll? 

 

Many thanks,

Anthony  :)

 

 

Here is an example of my slightly modified EasyGet based on Jeff Phillip’s sample.

 

using SeasideResearch;

using SeasideResearch.LibCurlNet;

 

      class EasyGet

      {

            public static string strGetData;

            public static string strErrorMessage;

 

            public EasyGet()

            {

                  EasyGet.strErrorMessage = "";

            }

 

            public EasyGet(string strURL)

            {

                  try

                  {

                        EasyGet.strErrorMessage = "";

                        EasyGet.strGetData = "";

                        Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);

 

                        Easy oCurlOP = new Easy();

                        Easy.WriteFunction wf = new Easy.WriteFunction(OnWriteData);

 

                        oCurlOP.SetOpt(CURLoption.CURLOPT_URL, strURL);

                        oCurlOP.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION, wf);

                        oCurlOP.Perform();

                        oCurlOP.Cleanup();

 

                        Curl.GlobalCleanup();

 

                  }

                  catch(Exception ex)

                  {

                        EasyGet.strErrorMessage = ex.Message;

                  }

            }

 

            public string GetTransferData()

            {

                  return EasyGet.strGetData;

            }

           

            public string GetTransferError()

            {

                  return EasyGet.strErrorMessage;

            }

 

            public static Int32 OnWriteData(Byte[] buf, Int32 size, Int32 nmemb, Object extraData)

            {

                  EasyGet.strGetData = System.Text.Encoding.UTF8.GetString(buf);

                  return size * nmemb;

            }

      }

 

 

This is how I use this object, to query a PHP file that returns database results.

 

EasyGet oCurlOp = new EasyGet(PATH_IDMS + "getMachinePingData.php");

 

Dan Fandrich | 1 Mar 16:33 2005

Re: NTLM buffer overflow

On Wed, Feb 23, 2005 at 09:21:32PM -0800, Dan Fandrich wrote:
> However, I just noticed a serious problem in the new version.

I've checked in to CVS a fix to this problem.

>>> Dan
--

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Jeff Phillips | 1 Mar 16:31 2005
Picon

Re: Using LibCurlNet in a Windows Service

Hello Anthony,

What version of libcurl.NET are you using? If it's a
version prior to 1.3, perhaps the problem is some kind
of security issue relating to the fact that the
earlier versions are signed assemblies. If not,
perhaps we can take the issue off-line, hopefully
resolve it, and then post an answer to this board.

Take care,
Jeff

--- Anthony Desouza <Anthony <at> dxsolutions.co.uk> wrote:

> Hi,
> 
>  
> 
> I am trying to use LIBCURLNET (thank you Jeff
> Phillips) in a C# Windows
> Service Project but am experiencing difficulty.
> 
>  
> 
> Everything builds and installs great, but when I try
> to access it from a
> Windows Service I get an exception fired "Unable to
> load DLL
> (libcurl.dll)" logged in an event log, so my CURL
> operation never takes
> place. I am perplexed, because the same code works
> fine from a Windows
> application
> 
>  
> 
> I have set up a reference to libcurlnet.dll in the
> service project and
> made sure that libcurl.dll is in the service install
> directory and even
> stuck it in the windows/system32 directory.
> 
> I have also set my path to include a reference to
> /libcurlnet/bin/
> 
> I expected Libcurlnet.dll to work the same whether
> in a service project
> or application project and I appear to be
> referencing it the same way.
> 
>  
> 
> I am a very new .NET developer. Is there any thing
> stupid I might be
> omitting to do when building my Window Service, to
> make sure it can load
> libcurl.dll?  
> 
>  
> 
> Many thanks,
> 
> Anthony  :)
> 
>  
> 
>  
> 
> Here is an example of my slightly modified EasyGet
> based on Jeff
> Phillip's sample.
> 
>  
> 
> using SeasideResearch;
> 
> using SeasideResearch.LibCurlNet;
> 
>  
> 
>       class EasyGet
> 
>       {
> 
>             public static string strGetData;
> 
>             public static string strErrorMessage;
> 
>  
> 
>             public EasyGet()
> 
>             {
> 
>                   EasyGet.strErrorMessage = "";
> 
>             }
> 
>  
> 
>             public EasyGet(string strURL)
> 
>             {
> 
>                   try 
> 
>                   {
> 
>                         EasyGet.strErrorMessage =
> "";
> 
>                         EasyGet.strGetData = "";
> 
>  
> Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);
> 
>  
> 
>                         Easy oCurlOP = new Easy();
> 
>                         Easy.WriteFunction wf = new
> Easy.WriteFunction(OnWriteData);
> 
>  
> 
>                        
> oCurlOP.SetOpt(CURLoption.CURLOPT_URL, strURL);
> 
>                        
> oCurlOP.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION,
> wf);
> 
>                         oCurlOP.Perform();
> 
>                         oCurlOP.Cleanup();
> 
>  
> 
>                         Curl.GlobalCleanup();
> 
>  
> 
>                   }
> 
>                   catch(Exception ex) 
> 
>                   {
> 
>                         EasyGet.strErrorMessage =
> ex.Message;
> 
>                   }
> 
>             }
> 
>  
> 
>             public string GetTransferData()
> 
>             {
> 
>                   return EasyGet.strGetData;
> 
>             }
> 
>             
> 
>             public string GetTransferError()
> 
>             {
> 
>                   return EasyGet.strErrorMessage;
> 
>             }
> 
>  
> 
>             public static Int32 OnWriteData(Byte[]
> buf, Int32 size,
> Int32 nmemb, Object extraData)
> 
>             {
> 
>                   EasyGet.strGetData =
> System.Text.Encoding.UTF8.GetString(buf);
> 
>                   return size * nmemb;
> 
>             }
> 
>       }
> 
>  
> 
>  
> 
> This is how I use this object, to query a PHP file
> that returns database
> results.
> 
>  
> 
> EasyGet oCurlOp = new EasyGet(PATH_IDMS +
> "getMachinePingData.php");
> 
>  
> 
> 

Anthony Desouza | 1 Mar 17:22 2005
Picon

RE: Using LibCurlNet in a Windows Service

Hi Jeff,

I am using version 1.3

Thanks for the great library ...it is very useful and saved me hours of
work.

I really would like to use CURL in my Windows Service project if at all
possible.

I would be happy to take the issue off-line.
Is it possible for me to email you off the message list?

Thanks,
Anthony

-----Original Message-----
From: Jeff Phillips [mailto:jeff <at> jeffp.net] 
Sent: 01 March 2005 15:32
To: libcurl development
Subject: Re: Using LibCurlNet in a Windows Service

Hello Anthony,

What version of libcurl.NET are you using? If it's a
version prior to 1.3, perhaps the problem is some kind
of security issue relating to the fact that the
earlier versions are signed assemblies. If not,
perhaps we can take the issue off-line, hopefully
resolve it, and then post an answer to this board.

Take care,
Jeff

--- Anthony Desouza <Anthony <at> dxsolutions.co.uk> wrote:

> Hi,
> 
>  
> 
> I am trying to use LIBCURLNET (thank you Jeff
> Phillips) in a C# Windows
> Service Project but am experiencing difficulty.
> 
>  
> 
> Everything builds and installs great, but when I try
> to access it from a
> Windows Service I get an exception fired "Unable to
> load DLL
> (libcurl.dll)" logged in an event log, so my CURL
> operation never takes
> place. I am perplexed, because the same code works
> fine from a Windows
> application
> 
>  
> 
> I have set up a reference to libcurlnet.dll in the
> service project and
> made sure that libcurl.dll is in the service install
> directory and even
> stuck it in the windows/system32 directory.
> 
> I have also set my path to include a reference to
> /libcurlnet/bin/
> 
> I expected Libcurlnet.dll to work the same whether
> in a service project
> or application project and I appear to be
> referencing it the same way.
> 
>  
> 
> I am a very new .NET developer. Is there any thing
> stupid I might be
> omitting to do when building my Window Service, to
> make sure it can load
> libcurl.dll?  
> 
>  
> 
> Many thanks,
> 
> Anthony  :)
> 
>  
> 
>  
> 
> Here is an example of my slightly modified EasyGet
> based on Jeff
> Phillip's sample.
> 
>  
> 
> using SeasideResearch;
> 
> using SeasideResearch.LibCurlNet;
> 
>  
> 
>       class EasyGet
> 
>       {
> 
>             public static string strGetData;
> 
>             public static string strErrorMessage;
> 
>  
> 
>             public EasyGet()
> 
>             {
> 
>                   EasyGet.strErrorMessage = "";
> 
>             }
> 
>  
> 
>             public EasyGet(string strURL)
> 
>             {
> 
>                   try 
> 
>                   {
> 
>                         EasyGet.strErrorMessage =
> "";
> 
>                         EasyGet.strGetData = "";
> 
>  
> Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);
> 
>  
> 
>                         Easy oCurlOP = new Easy();
> 
>                         Easy.WriteFunction wf = new
> Easy.WriteFunction(OnWriteData);
> 
>  
> 
>                        
> oCurlOP.SetOpt(CURLoption.CURLOPT_URL, strURL);
> 
>                        
> oCurlOP.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION,
> wf);
> 
>                         oCurlOP.Perform();
> 
>                         oCurlOP.Cleanup();
> 
>  
> 
>                         Curl.GlobalCleanup();
> 
>  
> 
>                   }
> 
>                   catch(Exception ex) 
> 
>                   {
> 
>                         EasyGet.strErrorMessage =
> ex.Message;
> 
>                   }
> 
>             }
> 
>  
> 
>             public string GetTransferData()
> 
>             {
> 
>                   return EasyGet.strGetData;
> 
>             }
> 
>             
> 
>             public string GetTransferError()
> 
>             {
> 
>                   return EasyGet.strErrorMessage;
> 
>             }
> 
>  
> 
>             public static Int32 OnWriteData(Byte[]
> buf, Int32 size,
> Int32 nmemb, Object extraData)
> 
>             {
> 
>                   EasyGet.strGetData =
> System.Text.Encoding.UTF8.GetString(buf);
> 
>                   return size * nmemb;
> 
>             }
> 
>       }
> 
>  
> 
>  
> 
> This is how I use this object, to query a PHP file
> that returns database
> results.
> 
>  
> 
> EasyGet oCurlOp = new EasyGet(PATH_IDMS +
> "getMachinePingData.php");
> 
>  
> 
> 

Dave Dribin | 2 Mar 01:05 2005

Enabling cookies without a file

Hello,

I'm using libcurl as a cross platform HTTP library (current targets are 
Windows, Linux and OS X).  We need to use cookies, but do not need to 
store them in a file.  They are only relevant for logging in, and we 
don't need to persist login sessions.  The only way I can figure out 
how to do this is to use CURLOPT_COOKIEFILE with an empty or 
nonexistent file.  But there is no good cross platform empty or 
nonexistent file.  "/dev/null" works on the Unix variants, but isn't so 
good for Windows.  So my first question: is there a way of enabling 
cookies without using CURLOPT_COOKIEFILE?  I haven't found a way to do 
this, so another alternative I've tried is to set the cookie file to an 
empty string, "".  And this actually works on all three platforms with 
one issue.  Windows complains (using a nasty error dialog box) with a 
debug assertion (obviously compiled against debug libraries), saying 
"*file != _T('\0')" in fopen.c, line 55.  It doesn't seem to like 
passing "" to fopen() (for good reason).

I was looking through cookie.c from version 7.13.0, and around 650, 
there is this code:

   if(file && strequal(file, "-")) {
     fp = stdin;
     fromfile=FALSE;
   }
   else
     fp = file?fopen(file, "r"):NULL;

I think if an explicit check for an empty string is added, then this 
will solve my issue.  I've tested the following code and it seems to 
work:

   if(file && strequal(file, "-")) {
     fp = stdin;
     fromfile=FALSE;
   }
   else if (file && strequal(file, "")
     fp = NULL;
   else
     fp = file?fopen(file, "r"):NULL;

It's worth pointing out that I cannot figure out any possible way for 
"file" to be null (you can't pass CURLOPT_COOKIEFILE a NULL).

-Dave

Dan Fandrich | 2 Mar 01:58 2005

Re: Enabling cookies without a file

On Tue, Mar 01, 2005 at 06:05:44PM -0600, Dave Dribin wrote:
> I'm using libcurl as a cross platform HTTP library (current targets are 
> Windows, Linux and OS X).  We need to use cookies, but do not need to 
> store them in a file.  

If you want to track cookies yourself, you can insert them in the request
using CURLOPT_COOKIE. A better cookie API is on the libcurl TODO list.
The latest thoughts on the subject are in the thread starting at
http://curl.haxx.se/mail/lib-2004-12/0195.html

>>> Dan
--

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved


Gmane