failure when running from other thread.(SOUP_STATUS_CANT_CONNECT)



 

Hi

 

I have a problem when running a function from another thread i get SOUP_STATUS_CANT_CONNECT

When I call my function from the main thread it works fine (returns STATUS_OK)

 

What could be wrong ? I am using libsoup 2.32.2 ( on  ARM )

 

Here is my code :

 

void xmloverhttptestget(void)

{

             SoupMessage *msg;

             SoupSession *session=NULL;

             guint status;

             char encoded[1024] ;

 

             g_thread_init (NULL);

             g_type_init ();

 

             printf("SUPPORTED %i\n",g_thread_supported ());

 

             session=soup_session_sync_new();

             if (session==NULL)

             {

                          printf("Could not soup_session_sync_new\n");

                          return;

             }

 

             char request[] ="<clickAPI><sendMsg><api_id>3179973</api_id><user>zzzz</user><password>xxxx</password><to>32479504265</to><text>test</text><from>ApexSyst</from></sendMsg></clickAPI>";

             char * uriencoded=soup_uri_encode(request,NULL);

             sprintf(encoded,"http://api.clickatell.com/xml/xml?data="">,uriencoded);

             msg = soup_message_new ("GET",encoded);

 

             printf("get request done=\n");

             status = soup_session_send_message (session, msg);

             printf("status returned=%i\n",status);

             printf("body returned=%s\n",msg->response_body->data);

             printf("header returned=%p\n",msg->response_headers);

             free(uriencoded);

}

 

 

Sagaert Johan

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]