Re: using libcurl/fastcgi

"Gordon Colburn" <gordon-ph3hwQsbQ5ZWk0Htik3J/[email protected]> Tue, 25 Jan 2011 23:49:34 -0500
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <E88A270A9913472DA072F7CF0F68AC6E@gordon641e39fb>
I frequently use libcurl from fastcgi on Linux from a C-language application
and it works well. I use Apache httpd rather than lighttpd, however. You
should check the following:

 

1.	Does your libcurl application work stand-alone? Test a version of
your program from the command line and make sure that it works.
2.	Is the appropriate libcurl.so in your classpath when your fastcgi
application executes from lighttpd? 
3.	Unlike traditional CGI applications, fast CGI applications do not
exit after each request. Ensure that you are not destroying global variables
or relying on initialization of static variables prior to each request.
4.	Check threading issues. Is your fastcgi application single or multi
threaded? If multi, is you libcurl code thread-safe? Libcurl is thread-safe,
I believe, but is your code that calls libcurl thread safe?

If none of that helps, add a lot of writes to stderr in your application to
figure out where it is aborting (or use a debugger).

 

Best of luck,

Gordon

 

 

  _____  

From: fastcgi-developers-bounces+gordon=group309.com-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
[mailto:fastcgi-developers-bounces+gordon=group309.com-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org]
On Behalf Of CHENG LIANG
Sent: Saturday, January 22, 2011 5:53 PM
To: fastcgi
Subject: [FASTCGI] using libcurl/fastcgi

 

Hi
 
I am creating a server using fastcgi and lighttpd based on linux. I am using
c.
inside the server, I need send out a http request and store response to a
string. I write a function int curl_to_string(char *s_http_req, char*
s_http_res) which follow the code in the example  getinmemory.c and I got
many many 500(Internal server error) errors. If fastcgi does not call this
function curl_to_string(), things goes well. 
 
 
any help thanks.
 


Cheng Liang

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers