Index: htcommon/DocumentDB.cc =================================================================== RCS file: /opt/htdig/cvs/htdig3/htcommon/DocumentDB.cc,v retrieving revision 1.28.2.3 retrieving revision 1.28.2.4 diff -c -3 -p -r1.28.2.3 -r1.28.2.4 *** htcommon/DocumentDB.cc 2000/03/21 00:34:33 1.28.2.3 --- htcommon/DocumentDB.cc 2000/03/21 04:26:00 1.28.2.4 *************** *** 13,19 **** // or the GNU Public License version 2 or later // // ! // $Id: DocumentDB.cc,v 1.28.2.3 2000/03/21 00:34:33 ghutchis Exp $ // #include "DocumentDB.h" --- 13,19 ---- // or the GNU Public License version 2 or later // // ! // $Id: DocumentDB.cc,v 1.28.2.4 2000/03/21 04:26:00 ghutchis Exp $ // #include "DocumentDB.h" *************** int DocumentDB::Delete(int docID) *** 325,332 **** String url = ref->DocURL(); delete ref; ! if (i_dbf->Delete(HtURLCodec::instance()->encode(url)) == NOTOK) ! return 0; if (h_dbf == 0 || h_dbf->Delete(key) == NOTOK) return NOTOK; --- 325,341 ---- String url = ref->DocURL(); delete ref; ! // We have to be really careful about deleting by URL, we might ! // have a newer "edition" with the same URL and different DocID ! String docIDstr; ! String encodedURL = HtURLCodec::instance()->encode(url); ! if (i_dbf->Get(encodedURL, docIDstr) == NOTOK) ! return NOTOK; ! ! // Only delete if we have a match between what we want to delete ! // and what's in the database ! if (key == docIDstr && i_dbf->Delete(encodedURL) == NOTOK) ! return NOTOK; if (h_dbf == 0 || h_dbf->Delete(key) == NOTOK) return NOTOK;