On Wed, Aug 12, 2009 at 8:58 PM, tatebn <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/curlpp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to