|
|
@ -266,9 +266,14 @@ static void SaveValue(void* arg, const Slice& ikey, const Slice& v) { |
|
|
|
s->state = kCorrupt; |
|
|
|
} else { |
|
|
|
if (s->ucmp->Compare(parsed_key.user_key, s->user_key) == 0) { |
|
|
|
if(parsed_key.type == kTypeValue){ |
|
|
|
time_t now = time(nullptr); |
|
|
|
uint64_t ttl=*(uint64_t*)(v.data()+v.size()-sizeof(uint64_t)); |
|
|
|
if(ttl < static_cast<uint64_t>(now))return; |
|
|
|
} |
|
|
|
s->state = (parsed_key.type == kTypeValue) ? kFound : kDeleted; |
|
|
|
if (s->state == kFound) { |
|
|
|
s->value->assign(v.data(), v.size()); |
|
|
|
s->value->assign(v.data(), v.size()-sizeof(uint64_t)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|