[sldev] [VIEWER] curl trouble

Infinity Linden infinity at lindenlab.com
Wed Sep 30 08:55:05 PDT 2009


that's freaky. i was recently playing with having the viewer ping
random web services and didn't get this behavior. what branch are you
on?

fwiw... it looks vaguely like a MIME message separator.

-cheers
-infinity

p.s. +1 for referencing a 1942 don ameche film, now i'm trying to
figure out how to craft a message about blocking IO titled 'the big
sleep'

On Tue, Sep 29, 2009 at 7:37 PM, Anna Gulaev <annagulaev at gmail.com> wrote:
> Yes, that's *curl* trouble. This post probably won't contain TMI :-)
>
> I used to be able to send data to a web server from the viewer using curl.
> Now all that's being received is thirty dashes followed by six hexidecimal
> numbers, like this:
>
> ------------------------------07ac4edfb36c
>
> The number is different each time. Doesn't matter what I send; this is
> what's received.
>
> Does anyone recognize this? It almost looks like the content separators on
> the response. When I say "used to be able to..." I mean a couple days ago.
> Not sure what I broke...
>
> Here's the curl code:
>
>     if ( CurlMultiHandle == NULL)
>         CurlMultiHandle = curl_multi_init();
>
>     if ( CurlMultiHandle)
>     {
>         CurlInfo *curl = (CurlInfo *) malloc( sizeof( CurlInfo));
>         curl->EasyHandle = curl_easy_init();
>
>         if ( curl->EasyHandle)
>         {
>             curl->formpost = NULL;
>             curl->lastptr = NULL;
>
>             serverLocData = serverLocData + "!\n" + AgentFirstName + " " +
> AgentLastName + "\n!\n"; // exclamation ends data block
>
>             curl_formadd( &(curl->formpost), &(curl->lastptr),
>                 CURLFORM_COPYNAME, "CopyNameGoesHere",
>                 CURLFORM_COPYCONTENTS, serverLocData.c_str(),
>                 CURLFORM_END);
> vAddChatHistory( "viewer", "sending:"+serverLocData);
> vLogFile << "LOC_SERVER_SENDING >" << serverLocData << "<" << endl << flush;
>             curl_formadd( &(curl->formpost), &(curl->lastptr),
>                 CURLFORM_COPYNAME, "submit",
>                 CURLFORM_COPYCONTENTS, "send",
>                 CURLFORM_END);
>
>             curl->chunk.memory = NULL;
>             curl->chunk.size = 0;
>
>             curl_easy_setopt( curl->EasyHandle, CURLOPT_URL,
> LOC_SERVER_UPDATE_URL);
>             //curl_easy_setopt( curl->EasyHandle, CURLOPT_VERBOSE, 1);
>             curl_easy_setopt( curl->EasyHandle, CURLOPT_WRITEFUNCTION,
> ReadWebpageCallback);
>             curl_easy_setopt( curl->EasyHandle, CURLOPT_WRITEDATA, (void
> *)&(curl->chunk));
>             curl_easy_setopt( curl->EasyHandle, CURLOPT_USERAGENT,
> "SLCustomViewer");
>             curl_easy_setopt( curl->EasyHandle, CURLOPT_HTTPPOST,
> curl->formpost);
>
>             curl_multi_add_handle( CurlMultiHandle, curl->EasyHandle);
>
>             CurlEasy.push_back( curl);
>
>             // suck in as much data as is ready
>             while( CURLM_CALL_MULTI_PERFORM == curl_multi_perform(
> CurlMultiHandle, &CurlStillRunning)); //note semicolon
>
>             if ( !CurlStillRunning)
>                 curlCleanup();
>         }
>         else
>         {
>             vLogFile << "LOC_SERVER_UPDATE_ERROR unable to send data to
> server - unable to obtain curl handle" << endl << flush;
>         }
>     }
>     else
>     {
>         vLogFile << "LOC_SERVER_UPDATE_ERROR unable to send data to server -
> unable to obtain curl multihandle" << endl << flush;
>     }
>
> Thanks,
> Anna
>
>
> _______________________________________________
> Policies and (un)subscribe information available here:
> http://wiki.secondlife.com/wiki/SLDev
> Please read the policies before posting to keep unmoderated posting
> privileges
>


More information about the SLDev mailing list