aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_helper.c
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 /src/json/json_helper.c
parent78cba4124a993ba97923ff0543f2a5942f297cdc (diff)
downloadgnunet-6a60c7d436f5c4c47752ee54a0980583f0c3fe37.tar.gz
gnunet-6a60c7d436f5c4c47752ee54a0980583f0c3fe37.zip
relative time is in nanoseconds, kill redundant _ms variant
Diffstat (limited to 'src/json/json_helper.c')
-rw-r--r--src/json/json_helper.c26
1 files changed, 0 insertions, 26 deletions
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}