- memset(&ut, 0, sizeof(struct UseTable)); // zeroing it out makes it compress better
-
- if (cType != eWrite)
- {
- syslog(LOG_DEBUG, "Loading [%s]", ChrPtr(guid));
- cdbut = cdb_fetch(CDB_USETABLE, SKEY(guid));
- if ((cdbut != NULL) && (cdbut->ptr != NULL)) {
- memcpy(&ut, cdbut->ptr, ((cdbut->len > sizeof(struct UseTable)) ? sizeof(struct UseTable) : cdbut->len));
- InDBTimeStamp = now - ut.ut_timestamp;
-
- if (InDBTimeStamp < antiexpire)
- {
- syslog(LOG_DEBUG, "Found - Not expired %ld < %ld", InDBTimeStamp, antiexpire);
- cdb_free(cdbut);
- return InDBTimeStamp;
- }
- else
- {
- syslog(LOG_DEBUG, "Found - Expired. %ld >= %ld", InDBTimeStamp, antiexpire);
- cdb_free(cdbut);
- }
- }
- else
- {
- if (cdbut) cdb_free(cdbut);
-
- syslog(LOG_DEBUG, "not Found");
- if (cType == eCheckUpdate)
- return 0;
- }
-
- if (cType == eCheckExist)
- return InDBTimeStamp;
+ syslog(LOG_DEBUG, "db: CheckIfAlreadySeen(%s)", ChrPtr(guid));
+ cdbut = cdb_fetch(CDB_USETABLE, SKEY(guid));
+ if (cdbut != NULL) {
+ found = 1;
+ cdb_free(cdbut);