Changeset 3314

Show
Ignore:
Timestamp:
05/04/08 21:52:43 (5 months ago)
Author:
dgollub
Message:

Avoid deadlocks and execute callback with local error, even in error
conditions. Improved error tracing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/opensync/client/opensync_client_proxy.c

    r3062 r3314  
    258258         
    259259error: 
    260         g_free(ctx); 
    261         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     260        ctx->init_callback(proxy, ctx->init_callback_data, locerror); 
     261        g_free(ctx); 
     262        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    262263        osync_error_unref(&locerror); 
    263264        return; 
     
    290291         
    291292error: 
    292         g_free(ctx); 
    293         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     293        ctx->fin_callback(proxy, ctx->fin_callback_data, locerror); 
     294        g_free(ctx); 
     295        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    294296        osync_error_unref(&locerror); 
    295297        return; 
     
    430432                osync_version_unref(version); 
    431433error: 
    432         g_free(ctx); 
    433         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     434        ctx->discover_callback(proxy, ctx->discover_callback_data, locerror); 
     435        g_free(ctx); 
     436        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    434437        osync_error_unref(&locerror); 
    435438        return; 
     
    464467         
    465468error: 
    466         g_free(ctx); 
    467         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     469        ctx->connect_callback(proxy, ctx->connect_callback_data, FALSE, locerror); 
     470        g_free(ctx); 
     471        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    468472        osync_error_unref(&locerror); 
    469473        return; 
     
    496500         
    497501error: 
    498         g_free(ctx); 
    499         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     502        ctx->disconnect_callback(proxy, ctx->disconnect_callback_data, locerror); 
     503        g_free(ctx); 
     504        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    500505        osync_error_unref(&locerror); 
    501506        return; 
     
    528533         
    529534error: 
    530         g_free(ctx); 
    531         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     535        ctx->read_callback(proxy, ctx->read_callback_data, locerror); 
     536        g_free(ctx); 
     537        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    532538        osync_error_unref(&locerror); 
    533539        return; 
     
    560566         
    561567error: 
    562         g_free(ctx); 
    563         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     568        ctx->get_changes_callback(proxy, ctx->get_changes_callback_data, locerror); 
     569        g_free(ctx); 
     570        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    564571        osync_error_unref(&locerror); 
    565572        return; 
     
    595602         
    596603error: 
    597         g_free(ctx); 
    598         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     604        ctx->commit_change_callback(proxy, ctx->commit_change_callback_data, NULL, locerror); 
     605        g_free(ctx); 
     606        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    599607        osync_error_unref(&locerror); 
    600608        return; 
     
    627635         
    628636error: 
    629         g_free(ctx); 
    630         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     637        ctx->committed_all_callback(proxy, ctx->committed_all_callback_data, locerror); 
     638        g_free(ctx); 
     639        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    631640        osync_error_unref(&locerror); 
    632641        return; 
     
    659668         
    660669error: 
    661         g_free(ctx); 
    662         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&locerror)); 
     670        ctx->sync_done_callback(proxy, ctx->sync_done_callback_data, locerror); 
     671        g_free(ctx); 
     672        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&locerror)); 
    663673        osync_error_unref(&locerror); 
    664674        return; 
     
    695705 
    696706error: 
    697         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(&error)); 
     707        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); 
    698708        osync_error_unref(&error); 
    699709} 
     
    720730         
    721731error: 
    722         osync_trace(TRACE_EXIT_ERROR, "%s: %p", __func__, osync_error_print(error)); 
     732        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); 
    723733        return NULL; 
    724734}