Show
Ignore:
Timestamp:
30/07/10 16:11:07 (19 months ago)
Author:
westram
Message:
  • added GB_key_2_existing_quark (like GB_key_2_quark, but returns 0 for non-existing quarks)
  • use GB_key_2_existing_quark in gb_delete_main_entry (avoid creating GB_SYSTEM_FOLDER after failed client connect). This fixes crash of arb_message when no server was running! (introduced in [6648])
  • gb_pre_delete_entry
    • if no remote_hash exists, do not erase anything from there
  • rewrote GB_key_2_quark() and gb_key_2_quark() using gb_key_2_existing_quark()
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ARBDB/ad_core.cxx

    r6664 r6681  
    459459     */ 
    460460    if (!Main->local_mode && gbd->server_id) { 
    461         GBS_write_numhash(Main->remote_hash, gbd->server_id, 0); 
     461        if (Main->remote_hash) GBS_write_numhash(Main->remote_hash, gbd->server_id, 0); 
    462462    } 
    463463 
     
    521521    gb_assert(GB_TYPE(gb_main) == GB_DB); 
    522522 
    523     GBQUARK sys_quark = GB_key_2_quark((GBDATA*)gb_main, GB_SYSTEM_FOLDER); 
     523    GBQUARK sys_quark = gb_key_2_existing_quark(GB_MAIN((GBDATA*)gb_main), GB_SYSTEM_FOLDER); 
     524 
     525    // Note: sys_quark may be 0 (happens when destroying client db which never established a connection). 
     526    // In this case no system folder/quark has been created (and we do no longer try to create it) 
     527    // Nothing will happen in pass 2 below. 
    524528 
    525529    for (int pass = 1; pass <= 2; pass++) {