From 3d2a43f51271029be0b2fa55b5ead3fbfa35d248 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Fri, 27 Apr 2012 16:33:31 +0200 Subject: [PATCH] ownCloud: Fixed var initialization to avoid crash after thread terminated. --- modules/csync_owncloud.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 09f27c7562..53193f8e07 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -130,12 +130,12 @@ static const ne_propname ls_props[] = { */ struct dav_session_s dav_session; /* The DAV Session, initialised in dav_connect */ -int _connected; /* flag to indicate if a connection exists, ie. +int _connected = 0; /* flag to indicate if a connection exists, ie. the dav_session is valid */ csync_vio_file_stat_t _fs; csync_auth_callback _authcb; -void *_userdata; +void *_userdata = NULL; #define PUT_BUFFER_SIZE 1024*5 @@ -431,7 +431,7 @@ static void results(void *userdata, return; } - DEBUG_WEBDAV(("** propfind result found: %s\n", path )); + /* DEBUG_WEBDAV(("** propfind result found: %s\n", path )); */ if( ! fetchCtx->target ) { DEBUG_WEBDAV(("error: target must not be zero!\n" )); return; @@ -475,7 +475,7 @@ static void results(void *userdata, newres->next = fetchCtx->list; fetchCtx->list = newres; fetchCtx->result_count = fetchCtx->result_count + 1; - DEBUG_WEBDAV(( "results for URI %s: %d %d\n", newres->name, (int)newres->size, (int)newres->type )); + /* DEBUG_WEBDAV(( "results for URI %s: %d %d\n", newres->name, (int)newres->size, (int)newres->type )); */ } /* @@ -1447,6 +1447,9 @@ csync_vio_method_t *vio_module_init(const char *method_name, const char *args, (void) args; _authcb = cb; _userdata = userdata; + _connected = 0; /* triggers dav_connect to go through the whole neon setup */ + + /* DEBUG_WEBDAV(("********** vio_module_init \n")); */ return &_method; } @@ -1459,6 +1462,8 @@ void vio_module_shutdown(csync_vio_method_t *method) { if( dav_session.ctx ) ne_session_destroy( dav_session.ctx ); + /* DEBUG_WEBDAV(( "********** vio_module_shutdown\n" )); */ + }