Просмотр исходного кода

Rename fish_data_t.timestamp -> key_created_at (#25)

Bryan Drewery 14 лет назад
Родитель
Сommit
28d8451288
4 измененных файлов с 5 добавлено и 5 удалено
  1. 1 1
      src/chanprog.c
  2. 2 2
      src/mod/server.mod/server.c
  3. 1 1
      src/mod/server.mod/server.h
  4. 1 1
      src/mod/server.mod/servmsg.c

+ 1 - 1
src/chanprog.c

@@ -930,7 +930,7 @@ void keyx(const bd::String &target) {
   notice(target, "DH1080_INIT " + myPublicKeyB64, DP_HELP);
   fishData->myPublicKeyB64 = myPublicKeyB64;
   fishData->myPrivateKey = myPrivateKey;
-  fishData->timestamp = now;
+  fishData->key_created_at = now;
   FishKeys[target] = fishData;
 }
 

+ 2 - 2
src/mod/server.mod/server.c

@@ -1057,10 +1057,10 @@ static void server_secondly()
         const bd::String target(fish_targets[i]);
         fish_data_t* fishData = FishKeys[target];
         bool should_delete = false;
-        if (fishData->timestamp && !fishData->sharedKey && ((now - 7) >= fishData->timestamp)) {
+        if (fishData->key_created_at && !fishData->sharedKey && ((now - 7) >= fishData->key_created_at)) {
           putlog(LOG_DEBUG, "*", "Deleting expired DH1080 FiSH exchange with %s", target.c_str());
           should_delete = true;
-        } else if (fishData->timestamp && fishData->sharedKey.length() && ((now - 3600) >= fishData->timestamp)) {
+        } else if (fishData->key_created_at && fishData->sharedKey.length() && ((now - 3600) >= fishData->key_created_at)) {
           putlog(LOG_DEBUG, "*", "Deleting expired (60 min) FiSH key with %s", target.c_str());
           should_delete = true;
         }

+ 1 - 1
src/mod/server.mod/server.h

@@ -51,7 +51,7 @@ typedef struct {
   bd::String sharedKey;
   bd::String myPrivateKey;
   bd::String myPublicKeyB64;
-  time_t timestamp;
+  time_t key_created_at;
 } fish_data_t;
 
 extern bind_table_t	*BT_ctcp, *BT_ctcr;

+ 1 - 1
src/mod/server.mod/servmsg.c

@@ -813,7 +813,7 @@ void handle_DH1080_init(const char* nick, const char* uhost, const char* from, s
   fishData->myPublicKeyB64 = myPublicKeyB64;
   fishData->myPrivateKey = myPrivateKey;
   fishData->sharedKey = sharedKey;
-  fishData->timestamp = now;
+  fishData->key_created_at = now;
   FishKeys[nick] = fishData;
   sdprintf("Set key for %s: %s", nick, sharedKey.c_str());
   return;