Rob Crittenden | 1 Jul 2008 05:41
Picon
Favicon

Re: Certificate database support in curl

Scoped Ptr wrote:
> Hi,
> 
> Does cURL supports the direct use of the Berkeley .db used by NSS ?
> Openssl works with .pem files whereas Berkeley db files are .db and NSS 
> assumes to have those for certificates and keys.
> How do I specify the location of the database files on the disk and, 
> does cURL work with .db files directly or there has to be some work done 
> before ?
> 
> I see that it first tries to get the SSL_DIR environment variable for 
> the cert db files and then assumes the location as /etc/pki/nssdb or in 
> worst case initializes NSS without a cert database. Should this SSL_DIR 
> location be the location of the cert.db, key.db files ?

Yes, use SSL_DIR to specify the directory that you NSS certificate and 
key databases resides in.

The NSS library in Fedora includes a PKCS#11 module that can read PEM 
files. This was submitted upstream to NSS but it hasn't been included 
(yet, if it will be at all). See bug 
https://bugzilla.mozilla.org/show_bug.cgi?id=402712

Additional patches may also be needed depending on your version of NSS. 
I haven't built it against a recent upstream pull of NSS for quite some 
time now but it needs to provide at least PK11_CreateGenericObject(). 
libcurl won't build in the proper support without it.

rob
(Continue reading)

Tor Arntsen | 1 Jul 2008 12:30
Picon
Favicon

Re: Problems with Http download under windows

On Mon, Jun 30, 2008 at 7:32 PM, Loic Quertenmont <loicus <at> gmail.com> wrote:
> I have just found the error
>
> FILE * fp = fopen(out_file, "w");
> -->
> FILE * fp = fopen(out_file, "wb");
>
> Because we are working with binary files and not txt file.
> the strange thing is that it works perfectly under linux (strange strange ;) )

That's because under Windows 'w' is used for text files while 'wb' is
used for binary files. On Linux (or any *nix) there's no difference
between a text file and a binary file, so w == wb.

Vijay | 1 Jul 2008 12:49
Picon

How to send a JPG file

How to send a Jpeg image File in URL using librcurl.
i want to send in this format
http://192.168.1.190:10000/sendmms?username=gsms&password=gsms&to=111&

--
VIJAY

Scoped Ptr | 1 Jul 2008 23:03
Picon

Undefined curl symbols while loading the library

I am trying to dynamically link libcurl.so to my program and had not been able to do that despite doing everything what is required.
I am using 7.18.2 version and using the -L/usr/local/lib -lcurl flag for linking. Also my /etc/ld.so.conf.d/libc.conf file has both /usr/local/lib and /usr/lib
in it. I am wondering what can be the possible issue? When I did ld on my app library, it gives me all undefined references for cURL functions.
I checked and there are libcurl.so links pointing to libcurl.so.4.1.0 in both the /usr/lib and /usr/local/lib. The application compiles successfully but its not able to load my program which links to libcurl.

I see so many people also faced the same situation but not sure about what all I can do to avoid it. Any suggestions?

Thanks




Jeff Pohlmeyer | 1 Jul 2008 23:33
Picon

Re: Undefined curl symbols while loading the library

On Tue, Jul 1, 2008 at 4:03 PM, Scoped Ptr <scoped.ptr <at> gmail.com> wrote:

> I am trying to dynamically link libcurl.so to my program and had not been
> able to do that despite doing everything what is required.

Everything?

> When I did ld on my app library, it gives me all undefined references for
> cURL functions.

Why would you run ld on a library? do you mean ldd?

> I checked and there are libcurl.so links pointing to libcurl.so.4.1.0 in
> both the /usr/lib and /usr/local/lib. The application compiles successfully
> but its not able to load my program which links to libcurl.

You should also have a symlink named libcurl.so.4

> I see so many people also faced the same situation

Really? I read this list fairly often and very rarely see reports of any
linkage problems (except maybe on Windows)

> Any suggestions?

Try running the "ldconfig" command (as root)

Also, check to see if you can execute the curl command line tool.

If so, compare the output of "ldd /path/to/curl" with
the output of "ldd /path/to/your-app"

Another thing you might want to consider is using either curl-config or
pkg-config to automatically set up the proper linker options, instead of
entering them manually.

 - Jeff

Daniel Stenberg | 1 Jul 2008 23:54
Picon
Favicon
Gravatar

Re: HAVE_SYS_SELECT_H, HAVE_STRDUP, and port to an RTOS

On Wed, 25 Jun 2008, Rolland Dudemaine wrote:

> Actually, this looks like this was a remaining of the port. I did a fresh 
> install from sources, applied the two other patches, and it compiles and 
> runs fine now. So, you can forget about this one.

Thanks, I've now committed the changes as I understood them so now CVS HEAD 
should be buildable "out of the box" for INTEGRITY.

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Dan Fandrich | 2 Jul 2008 05:05
Favicon

Re: SFTP commands

On Mon, Jun 30, 2008 at 02:37:47PM +0530, nagarajan.sreenivasan <at> wipro.com wrote:
> The permissions are getting changed (the user has permission to change)(FTP
> works fine with out throwing any errors)
> 
> But in sftp when  the file has 555 or 444 permissison and we try to change any
> other  permissions
> The permisison are changed but the following error occurs
> 
> * Re-using existing connection! (#0) with host <hsotname>
> * Connected to <hsotname> (<hsotname>) port 22 (#0)
> * Sending quote commands
> * Attempt to set SFTP stats failed: Permission denied---->what is this error
> * Connection #0 to host <hsotname> left intact
> * Quote command returned error
> The  value of the errorStatus  ::.ChmodFile  21(from curl_
> 
> should I have to set/configure some settings  for the sftp user do let me know 
> how to do it????

What OS is the remote server running?  What kind of filesystem is the remote
file on?  sftp sets all the attributes of a file at once and if one type of
attribute fails to be set, then it could return such an error. For example,
changing the mode or UID of a file on a DOS filesystem wouldn't work,
and could conceivably cause this kind of problem. Can you verify through
the remote server logs whether it is in fact sending a Permission denied
error code?

>>> Dan
--

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

lists | 2 Jul 2008 06:14

Trying to download and remove files from server via vb.net - need help

I want to loop through a list of files and download them and, if a flag is set, delete it the file from the server
after download...if one other flag is set then delete a slightly different file from the server.

I am able to download the files OK (have to add a small amount of sleep to get it to work without error -
strange).  When the delete flag is set it starts to fail on every file it tries to download.

Here is what I have (some variable names have been changed for simplicity, but other then that it is the real code):
===helper functions===
Public Function OnProgress(ByVal extraData As Object, _
    ByVal dlTotal As Double, ByVal dlNow As Double, _
    ByVal ulTotal As Double, ByVal ulNow As Double) As Int32
    'Console.WriteLine("Progress: {0} {1} {2} {3} {4}", dlTotal, dlNow, _
    'ulTotal, ulNow, extraData)
    'UpdateStatusBar(extraData)
    Return 0
End Function
' Called by libcURL.NET when it has data for your program
Public Function OnWriteData(ByVal buf() As Byte, _
    ByVal size As Int32, ByVal nmemb As Int32, _
    ByVal extraData As Object) As Int32
    'Console.Write(System.Text.Encoding.UTF8.GetString(buf))
    'Dim fs As New FileStream
    If bSTOP Then
        Return 0
    End If
    FTPfs.Write(buf, 0, nmemb)
    Return size * nmemb
End Function
Public Sub OnDebug(ByVal infoType As CURLINFOTYPE, _
    ByVal msg As String, ByVal extraData As Object)
    'Console.WriteLine(msg)
End Sub
======

===Code===
Curl.GlobalInit(CURLinitFlag.CURL_GLOBAL_ALL)

Dim CURLFTP As Easy
CURLFTP = New Easy
CURLFTP.SetOpt(CURLoption.CURLOPT_USERPWD, UID + ":" + PWD)

Dim pf As Easy.ProgressFunction
pf = New Easy.ProgressFunction(AddressOf OnProgress)
CURLFTP.SetOpt(CURLoption.CURLOPT_PROGRESSFUNCTION, pf)

Dim rf As Easy.WriteFunction
rf = New Easy.WriteFunction(AddressOf OnWriteData)
CURLFTP.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION, rf)
CURLFTP.SetOpt(CURLoption.CURLOPT_WRITEDATA, FTPfs)

Dim Slist As New Slist()

**FOR File_List (The start of a loop of 1 to X files)**

FTPfs = New FileStream(Filename, FileMode.Create, FileAccess.Write, FileShare.None)

CURLFTP.SetOpt(CURLoption.CURLOPT_URL, "ftp://" + Server + "/" & Path & "/" & Filename)

CURLFTP.Perform()
FTPfs.Close()
Sleep(150)

If DOWNLOADFILE = ZERO BYTES Then
  Sleep(250)
  FTPfs = New FileStream(LocalSSPathProfile & "\" & Filename, FileMode.Create, FileAccess.Write, FileShare.None)
  CURLFTP.SetOpt(CURLoption.CURLOPT_URL, "ftp://" + Server + "/" & Path & "/" & Filename)
  CURLFTP.Perform()
  FTPfs.Close()
End If

If DELETE_FLAG_SET Then
  'Remove the file from server
   CURLFTP.SetOpt(CURLoption.CURLOPT_URL, "ftp://" + objProfile.Server + "/dummy")
   Slist.Append("DELE " & SSList.Item(icnt).Path & "/" & Filename)
   CURLFTP.SetOpt(CURLoption.CURLOPT_QUOTE, Slist)
   CURLFTP.Perform()
   Slist.FreeAll()
   If SOMEOTHER_DELETE_FLAG_SET Then
      Slist.Append("DELE " & Path & "/" & NameOnly & "." & OtherMask)
      CURLFTP.SetOpt(CURLoption.CURLOPT_QUOTE, Slist)
      CURLFTP.Perform()
      Slist.FreeAll()
   End If
End If

**Next - LOOP THROUGH FILES**

CURLFTP.Cleanup()
Curl.GlobalCleanup()

======

Issues:
1) If I do not put the "Sleep(150)" there every 8-10 files it downloads it gets a hit on a ZERO byte file (all
files being download are > 0 size).  At 150 it does not happen...is it to fast for vb.net?

2) So downloading is actually working nice and fast with the sleep there, when the DELETE_FLAG_SET is true
it DOES remove the files from the server, but after the first download it then fails to download any more
files the ZERO check and then fails there too and leaves a ZERO size file and moves on.

So why do I need the sleep to get the downloads to work and why when I add the delete code does it all fall apart?

Any help would be appreciated - thanks!

-Wayne

Dan Fandrich | 2 Jul 2008 07:58
Favicon

Re: Trying to download and remove files from server via vb.net - need help

On Wed, Jul 02, 2008 at 12:14:29AM -0400, lists <at> waynesplace.com wrote:
> I want to loop through a list of files and download them and, if a flag is set, delete it the file from the
server after download...if one other flag is set then delete a slightly different file from the server.
> 
> I am able to download the files OK (have to add a small amount of sleep to get it to work without error -
strange).  When the delete flag is set it starts to fail on every file it tries to download.

I suggest you check the return code from the Perform() call. It will likely
give you a very specific reason for the failure.  Failing that, enable
debug logs and look through the protocol trace to track the source of the
problem.

>>> Dan
--

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

nagarajan.sreenivasan | 2 Jul 2008 08:23

RE: SFTP commands


>>>>>What OS is the remote server running?  What kind of filesystem is
the remote file on?  sftp sets all the attributes >>>>>>of a file at
once and if one type of attribute fails to be set, then it could return
such an error. For example, >>>>>>changing the mode or UID of a file on
a DOS filesystem wouldn't work, and could conceivably cause this kind of
>>>>>>problem. Can you verify through the remote server logs whether it
is in fact sending a Permission denied error code?

		Remote server am running on linux platform. Both gfs and
local file system gives me the same error. And regarding the  Error logs
I am not able to find any in the remote server in /var/log/secure or
/var/log/messages it has 
Only connection and disconenction realted errors.  

For now I have  a hack:like would first change the file to 777
permission (ignore the error) 

And then change the file to required permisison (what ever mentioned )
.I know it sounds weired :))) 

-----Original Message-----
From: curl-library-bounces <at> cool.haxx.se
[mailto:curl-library-bounces <at> cool.haxx.se] On Behalf Of Dan Fandrich
Sent: Wednesday, July 02, 2008 8:36 AM
To: curl-library <at> cool.haxx.se
Subject: Re: SFTP commands

On Mon, Jun 30, 2008 at 02:37:47PM +0530,
nagarajan.sreenivasan <at> wipro.com wrote:
> The permissions are getting changed (the user has permission to 
> change)(FTP works fine with out throwing any errors)
> 
> But in sftp when  the file has 555 or 444 permissison and we try to 
> change any other  permissions The permisison are changed but the 
> following error occurs
> 
> * Re-using existing connection! (#0) with host <hsotname>
> * Connected to <hsotname> (<hsotname>) port 22 (#0)
> * Sending quote commands
> * Attempt to set SFTP stats failed: Permission denied---->what is this

> error
> * Connection #0 to host <hsotname> left intact
> * Quote command returned error
> The  value of the errorStatus  ::.ChmodFile  21(from curl_
> 
> should I have to set/configure some settings  for the sftp user do let

> me know how to do it????

What OS is the remote server running?  What kind of filesystem is the
remote file on?  sftp sets all the attributes of a file at once and if
one type of attribute fails to be set, then it could return such an
error. For example, changing the mode or UID of a file on a DOS
filesystem wouldn't work, and could conceivably cause this kind of
problem. Can you verify through the remote server logs whether it is in
fact sending a Permission denied error code?

>>> Dan
--

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

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for
the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any
attachments for the presence of viruses. The company accepts no liability for any damage caused by any
virus transmitted by this email. 

www.wipro.com


Gmane