aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-07-08 14:55:01 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-07-08 14:55:01 +0200
commit6a60c7d436f5c4c47752ee54a0980583f0c3fe37 (patch)
treecf23e7b4e3bb243181a961debd3e54ae4d52ca3c
parent78cba4124a993ba97923ff0543f2a5942f297cdc (diff)
downloadgnunet-6a60c7d436f5c4c47752ee54a0980583f0c3fe37.tar.gz
gnunet-6a60c7d436f5c4c47752ee54a0980583f0c3fe37.zip
relative time is in nanoseconds, kill redundant _ms variant
-rw-r--r--src/json/json_generator.c19
-rw-r--r--src/json/json_helper.c26
2 files changed, 0 insertions, 45 deletions
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index acfbcfe63..eb275712c 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -122,15 +122,6 @@ GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp)
122 json_decref (j); 122 json_decref (j);
123 return NULL; 123 return NULL;
124 } 124 }
125 if (0 !=
126 json_object_set_new (j,
127 "d_ms",
128 json_string ("forever")))
129 {
130 GNUNET_break (0);
131 json_decref (j);
132 return NULL;
133 }
134 return j; 125 return j;
135 } 126 }
136 if (stamp.rel_value_us >= (1LLU << 53)) 127 if (stamp.rel_value_us >= (1LLU << 53))
@@ -149,16 +140,6 @@ GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp)
149 json_decref (j); 140 json_decref (j);
150 return NULL; 141 return NULL;
151 } 142 }
152 if (0 !=
153 json_object_set_new (
154 j,
155 "d_ms",
156 json_integer (((json_int_t) stamp.rel_value_us)/1000LL)))
157 {
158 GNUNET_break (0);
159 json_decref (j);
160 return NULL;
161 }
162 return j; 143 return j;
163} 144}
164 145
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index 27bb9f41c..a15dc74c0 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -715,7 +715,6 @@ parse_rel_time (void *cls,
715{ 715{
716 struct GNUNET_TIME_Relative *rel = spec->ptr; 716 struct GNUNET_TIME_Relative *rel = spec->ptr;
717 json_t *json_d_us; 717 json_t *json_d_us;
718 json_t *json_d_ms;
719 unsigned long long int tval; 718 unsigned long long int tval;
720 719
721 if (! json_is_object (root)) 720 if (! json_is_object (root))
@@ -751,31 +750,6 @@ parse_rel_time (void *cls,
751 GNUNET_break_op (0); 750 GNUNET_break_op (0);
752 return GNUNET_SYSERR; 751 return GNUNET_SYSERR;
753 } 752 }
754
755 json_d_ms = json_object_get (root,
756 "d_ms");
757 if (json_is_integer (json_d_ms))
758 {
759 tval = json_integer_value (json_d_ms);
760 *rel = GNUNET_TIME_relative_multiply (
761 GNUNET_TIME_UNIT_MILLISECONDS,
762 tval);
763 return GNUNET_OK;
764 }
765 if (json_is_string (json_d_ms))
766 {
767 const char *val;
768
769 val = json_string_value (json_d_ms);
770 if ((0 == strcasecmp (val,
771 "forever")))
772 {
773 *rel = GNUNET_TIME_UNIT_FOREVER_REL;
774 return GNUNET_OK;
775 }
776 GNUNET_break_op (0);
777 return GNUNET_SYSERR;
778 }
779 GNUNET_break_op (0); 753 GNUNET_break_op (0);
780 return GNUNET_SYSERR; 754 return GNUNET_SYSERR;
781} 755}