Changeset 7866


Ignore:
Timestamp:
Feb 10, 2009, 6:03:55 PM (13 years ago)
Author:
charles
Message:

(trunk libT) yet another possible fix for the libcurl/libevent/kqueue issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/web.c

    r7838 r7866  
    282282
    283283            mcode = curl_multi_remove_handle( g->multi, easy );
    284             tr_assert( mcode == CURLM_OK, "curl_multi_socket_action() failed: %d (%s)", mcode, curl_multi_strerror( mcode ) );
     284            tr_assert( mcode == CURLM_OK, "curl_multi_remove_handle() failed: %d (%s)", mcode, curl_multi_strerror( mcode ) );
    285285
    286286            curl_easy_cleanup( easy );
     
    337337   after calling this function */
    338338static void
    339 tr_multi_socket_action( tr_web * g, int fd )
     339tr_multi_perform( tr_web * g )
    340340{
    341341    int closed = FALSE;
     
    347347    /* invoke libcurl's processing */
    348348    do {
    349         mcode = curl_multi_socket_action( g->multi, fd, 0, &g->still_running );
    350         dbgmsg( "event_cb(): fd %d, still_running is %d", fd, g->still_running );
     349        dbgmsg( "calling curl_multi_perform..." );
     350        mcode = curl_multi_perform( g->multi, &g->still_running );
     351        dbgmsg( "done calling curl_multi_perform..." );
    351352    } while( mcode == CURLM_CALL_MULTI_PERFORM );
    352     if( ( mcode == CURLM_BAD_SOCKET ) && ( fd != CURL_SOCKET_TIMEOUT ) )
    353         purgeSockinfo( g, fd );
    354     else {
    355         tr_assert( mcode == CURLM_OK, "curl_multi_socket_action() failed on fd %d: %d (%s)", fd, mcode, curl_multi_strerror( mcode ) );
    356         if( mcode != CURLM_OK )
    357             tr_err( "%s", curl_multi_strerror( mcode ) );
    358     }
     353    tr_assert( mcode == CURLM_OK, "curl_multi_perform() failed: %d (%s)", mcode, curl_multi_strerror( mcode ) );
     354    if( mcode != CURLM_OK )
     355        tr_err( "%s", curl_multi_strerror( mcode ) );
    359356
    360357    remove_finished_tasks( g );
     
    375372/* libevent says that sock is ready to be processed, so wake up libcurl */
    376373static void
    377 event_cb( int fd, short kind UNUSED, void * g )
    378 {
    379     tr_multi_socket_action( g, fd );
     374event_cb( int fd UNUSED, short kind UNUSED, void * g )
     375{
     376    tr_multi_perform( g );
    380377}
    381378
     
    385382{
    386383    dbgmsg( "libevent timer is done" );
    387     tr_multi_socket_action( g, CURL_SOCKET_TIMEOUT );
     384    tr_multi_perform( g );
    388385}
    389386
Note: See TracChangeset for help on using the changeset viewer.