gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: enable v10 backwards compatibility


From: gnunet
Subject: [gnunet] branch master updated: enable v10 backwards compatibility
Date: Wed, 15 Dec 2021 17:02:03 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 8faf7660d enable v10 backwards compatibility
8faf7660d is described below

commit 8faf7660d98bfd6177d89c5b74c5391e6f606284
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Wed Dec 15 13:18:24 2021 +0100

    enable v10 backwards compatibility
---
 src/json/json_generator.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index eb275712c..5421b9527 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -71,6 +71,15 @@ GNUNET_JSON_from_timestamp (struct GNUNET_TIME_Timestamp 
stamp)
       json_decref (j);
       return NULL;
     }
+    if (0 !=
+        json_object_set_new (j,
+                             "t_ms",
+                             json_string ("never")))
+    {
+      GNUNET_break (0);
+      json_decref (j);
+      return NULL;
+    }
     return j;
   }
   GNUNET_assert (
@@ -89,6 +98,18 @@ GNUNET_JSON_from_timestamp (struct GNUNET_TIME_Timestamp 
stamp)
     json_decref (j);
     return NULL;
   }
+  if (0 !=
+      json_object_set_new (
+        j,
+        "t_ms",
+        json_integer (
+          (json_int_t) (stamp.abs_time.abs_value_us
+                        / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us))))
+  {
+    GNUNET_break (0);
+    json_decref (j);
+    return NULL;
+  }
   return j;
 }
 
@@ -122,6 +143,15 @@ GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative 
stamp)
       json_decref (j);
       return NULL;
     }
+    if (0 !=
+        json_object_set_new (j,
+                             "d_ms",
+                             json_string ("forever")))
+    {
+      GNUNET_break (0);
+      json_decref (j);
+      return NULL;
+    }
     return j;
   }
   if (stamp.rel_value_us >= (1LLU << 53))
@@ -140,6 +170,16 @@ GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative 
stamp)
     json_decref (j);
     return NULL;
   }
+  if (0 !=
+      json_object_set_new (
+        j,
+        "d_ms",
+        json_integer (((json_int_t) stamp.rel_value_us)/1000LL)))
+  {
+    GNUNET_break (0);
+    json_decref (j);
+    return NULL;
+  }
   return j;
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]