cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl on QNX 6

From: <David.Bentham_at_poole.siemens.co.uk>
Date: Thu, 20 Dec 2001 10:36:17 -0000

Hi,

We're investigating libcurl 7.9.2 to implement basic FTP transfers between
an embedded application running QNX 6/Neutrino 2.11 operating system and a
Windows NT maintenance PC (running Microsoft's FTP Server). So far I've only
considered FTP GET, but every time it runs, it crashes with SIGSEGV in the
curl_easy_perform(..) function.

I have successfully built/run the equivalent under an NT simulation
environment.

The code excerpt follows. srcFile and dstFile are char strings of the file's
remote source and local destination. destination is a char string of the
internet address of the NT PC (numeric dot format). As far as I can see, its
a very simple thing to do. debugPrintf is a simple debug print function for
our embeddded environment, i.e ignore it...

ftp_get_function (char *srcFile, char *dstFile, char *destination)
{
   FILE *ftp;
   char url[128], *c;
   int i;
   CURL *curl;
   CURLcode res;
 
   // open the local (destination) file
   ftp = fopen(dstFile,"wb");

   debugPrintf(1,"CURL->easy init...");
   curl = curl_easy_init();
   if(curl)
      {
      sprintf(url,"ftp://%s%s", destination, srcFile);
      debugPrintf(1,"OK\nCURL->url = %s\n",url);
      curl_easy_setopt(curl, CURLOPT_URL, url);
      curl_easy_setopt(curl, CURLOPT_FILE, ftp);
      curl_easy_setopt(curl, CURLOPT_NETRC, 1);

      debugPrintf(1,"CURL->perform...");
      res = curl_easy_perform(curl);
      debugPrintf(1,"%i\n",res);

      curl_easy_cleanup(curl);
      }
   else
      debugPrintf(1,"FAILED\n");

   fclose(ftp);
}

An example call to this would be

   ftp_get_function("/pmu/database.db", "/database/localdb.db",
"100.0.0.2");

Regarding the build process under QNX 6, I've built it as a static library.
Also, I had to disable the configuration checks for gethostbyname() in
socket and nsl libraries. Other than that, libcurl built with no worries,
and linked quite happily into our application.

Any ideas?

Thanks,

Dave Bentham
Senior Software Engineer
_______________________________________

SIEMENS
Siemens Transportation Systems Limited

Tel. +44 1202 84 6103
Fax. +44 1202 78 2893
Email david.bentham_at_poole.siemens.co.uk

Visit us at http://www.siemens.co.uk/transportation
_______________________________________

This communication contains information which is confidential, and is for
the exclusive use of the addressee(s). If you are not a named addressee
please contact the sender immediately, and also delete the communication
from your system.

Any views or opinions presented are solely those of the author and do not
necessarily represent those of Siemens plc unless otherwise specifically
stated.
Received on 2001-12-20