curlpp  

Re: perform() is crashing

Jean-Philippe Barette-LaPierre
Thu, 13 Aug 2009 07:43:33 -0700

On Thu, Aug 13, 2009 at 10:36 AM, tatebn <brandonnt...@gmail.com> wrote:

>
> > Try to remove the ostringstream usage, it will just print on the stdout.
> > Then, we'll be able to
> > know if it's the WriteStream which is the offender or something else.
>
> I just get a plain white screen.  Nothing printed.
>
> > Can you tell which version
> > of libcurl and cURLpp you're using?
>
> cURLpp:  Latest stable version as of about 2 weeks ago
> libcurl:  Not entirely sure.
>
> I got these warnings when compiling though.  Not sure if this could be
> the issue or not.  Nor would I know how to fix it.  I'm not a unix
> noobie, but I'm not a guru either.
>
> /usr/bin/ld: warning: libssl.so.2, needed by /usr/lib/gcc-lib/i386-
> redhat-linux/3.2.2/../../../libcurl.so, may conflict with libssl.so.4
> /usr/bin/ld: warning: libcrypto.so.2, needed by /usr/lib/gcc-lib/i386-
> redhat-linux/3.2.2/../../../libcurl.so, may conflict with libcrypto.so.
> 4


Honestly I wouldn't even try to debug the cURLpp code without fixing those
issues first. This has a very high probability to be the source of your
problems.

 You can send an email to libcurl mailing-list (they got a way much larger
audience). However, you should send here and there the description of
your libraries setup. Why do you have two libssl.so libraries installed?
Where are they installed? Have you checked which versions are needed
by libcurl? If you need a specific one, you can give to configure an option
to select a specific one.

libcurl mailing-list: http://cool.haxx.se/mailman/listinfo/curl-library


>
>
> On Aug 13, 10:11 am, Jean-Philippe Barette-LaPierre
> <jpbarre...@gmail.com> wrote:
> > On Thu, Aug 13, 2009 at 9:44 AM, tatebn <brandonnt...@gmail.com> wrote:
> >
> > > > As far as using ostringstream
> > > > goes, as soon as that response comes back from reform it's converted
> > > > to a TString which won't accept a string.'
> >
> > > the reponse come back from perform() not reform.  Sorry.
> >
> > Try to remove the ostringstream usage, it will just print on the stdout.
> > Then, we'll be able to
> > know if it's the WriteStream which is the offender or something else. Can
> > you tell which version
> > of libcurl and cURLpp you're using?
> >
> >
> >
> > > On Aug 13, 9:42 am, tatebn <brandonnt...@gmail.com> wrote:
> > > > How complete an example? I think this is all the curl related stuff,
> > > > would you need to whole file?
> >
> > > > > > //Using credit card number and time in seconds to create unique
> id
> > > > > >                char uniqueID[64];
> > > > > >                strcpy(uniqueID, creditCardNumber);
> > > > > >                sprintf(uniqueID, "%s%ld", uniqueID, time(NULL));
> >
> > > > > Since you used ostringstream already below, why don't you use it
> here?
> >
> > > > I used this method because there was an issue in that
> creditCardNumber
> > > > is a TString which is a custom class that I did not create nor know
> > > > where to find.  I didn't build this system, I just have to take care
> > > > of this part of it.  TString was causing all sorts of type issues and
> > > > this is how it ended up working out.  As far as using ostringstream
> > > > goes, as soon as that response comes back from reform it's converted
> > > > to a TString which won't accept a string.  So this keeps everything
> > > > more conformed.
> >
> > > > I'll remove the cleanup class, but this is dying at perform().  I
> > > > traced it out with log statements that I didn't include here.  So let
> > > > me know what you need from me, complete function? complete file? and
> > > > I'll get it up here later today.
> >
> > > > Thanks a lot.  I'm on a tight deadline here and I'm stumped.
> >
> > > > On Aug 13, 9:11 am, Jean-Philippe Barette-LaPierre
> >
> > > > <jpbarre...@gmail.com> wrote:
> > > > > On Wed, Aug 12, 2009 at 8:58 PM, tatebn <brandonnt...@gmail.com>
> > > wrote:
> >
> > > > > > I'm using curlpp to communicate with paypal.  I'm having an issue
> > > > > > where when the perform() function is called my cgi dies.  No
> error,
> > > > > > nothing.
> >
> > > > > > I'm really under the gun here.  Any help would be greatly
> > > appreciated.
> >
> > > > > The best thing would be to have a complete example which would be a
> > > small
> > > > > as possible that you could send. Then we would be more able to
> > > reproduce
> > > > > and test. However I can point to possible mistakes
> >
> > > > > > Here's what I'm doing:
> >
> > > > > > //Using credit card number and time in seconds to create unique
> id
> > > > > >                char uniqueID[64];
> > > > > >                strcpy(uniqueID, creditCardNumber);
> > > > > >                sprintf(uniqueID, "%s%ld", uniqueID, time(NULL));
> >
> > > > > Since you used ostringstream already below, why don't you use it
> here?
> >
> > > > > >                //set the headers.
> > > > > >                std::list<std::string> headers;
> > > > > >                headers.push_back("Content-Type: text/namevalue");
> > > > > >                headers.push_back("Content-Length: " +
> > > > > > verisignArgs.GetLength());
> > > > > >                headers.push_back("X-VPS-Timeout: 45");
> > > > > >                headers.push_back("X-VPS-Request_ID:" +
> std::string
> > > > > > (uniqueID));
> >
> > > > > >                cURLpp::Cleanup myCleanup;
> >
> > > > > Don't use cleanup class. That is meant to be removed from API
> >
> > > > > >                cURLpp::Easy myRequest;
> > > > > >                myRequest.setOpt(new cURLpp::Options::Url
> > > > > > (kVerisignHost));
> > > > > >                myRequest.setOpt(new cURLpp::Options::Port
> > > > > > (kVerisignPort));
> > > > > >                myRequest.setOpt(new cURLpp::Options::Timeout
> > > > > > (kVerisignTimeout));
> > > > > >                myRequest.setOpt(new cURLpp::Options::Header(1));
> > > > > >                myRequest.setOpt(new
> cURLpp::Options::FollowLocation
> > > > > > (0));
> > > > > >                myRequest.setOpt(new
> cURLpp::Options::SslVerifyPeer
> > > > > > (0));
> > > > > >                myRequest.setOpt(new
> cURLpp::Options::SslVerifyHost
> > > > > > (2));
> > > > > >                myRequest.setOpt(new cURLpp::Options::ForbidReuse
> > > > > > (true));
> > > > > >                myRequest.setOpt(new cURLpp::Options::Post(1));
> > > > > >                myRequest.setOpt(new cURLpp::Options::HttpHeader
> > > > > > (headers));
> > > > > >                myRequest.setOpt(new cURLpp::Options::PostFields
> > > > > > (std::string(verisignArgs)));
> > > > > >                myRequest.setOpt(new cURLpp::Options::UserAgent
> > > > > > ("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6)
> Gecko/
> > > > > > 20070725 Firefox/2.0.0.6"));
> >
> > > > > >                std::ostringstream responseBuffer;
> >
> > > > > >                cURLpp::Options::WriteStream ws(&responseBuffer);
> > > > > >                myRequest.setOpt(ws);
> >
> > > > > >                myRequest.perform();
> >
> > > > > Send a complete example and I'll be able to help you more.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"curlpp" group.
To post to this group, send email to curlpp@googlegroups.com
To unsubscribe from this group, send email to 
curlpp+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/curlpp?hl=en
-~----------~----~----~----~------~----~------~--~---