diff options
author | Phil <phil.buschmann@tum.de> | 2018-08-12 23:11:10 +0200 |
---|---|---|
committer | Phil <phil.buschmann@tum.de> | 2018-08-12 23:11:10 +0200 |
commit | 4df7069dcd17ac39c786ee6f21455c96e6a6dbf4 (patch) | |
tree | 80fe63630f82dd79f73f24cbb954c0703cd873f3 /src/json/json_generator.c | |
parent | 89485145a0f33984a70bffdf0f766667b4a3e75e (diff) | |
download | gnunet-4df7069dcd17ac39c786ee6f21455c96e6a6dbf4.tar.gz gnunet-4df7069dcd17ac39c786ee6f21455c96e6a6dbf4.zip |
Changed Namestore API, changed error handling, changed gns record json
Diffstat (limited to 'src/json/json_generator.c')
-rw-r--r-- | src/json/json_generator.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/json/json_generator.c b/src/json/json_generator.c index d8c82bc86..0ffe5c643 100644 --- a/src/json/json_generator.c +++ b/src/json/json_generator.c | |||
@@ -182,12 +182,32 @@ GNUNET_JSON_from_gns_record (const char* rname, | |||
182 | record_type_str = GNUNET_GNSRECORD_number_to_typename(rd->record_type); | 182 | record_type_str = GNUNET_GNSRECORD_number_to_typename(rd->record_type); |
183 | 183 | ||
184 | // ? for possible NULL values | 184 | // ? for possible NULL values |
185 | ret = json_pack("{s:s?,s:s?,s:s?,s:i,s:s?}", | 185 | if (NULL != rname) |
186 | "value", value_str, | 186 | { |
187 | "type", record_type_str, | 187 | ret = json_pack ("{s:s?,s:s?,s:s?,s:i,s:s?}", |
188 | "expiration_time", expiration_time_str, | 188 | "value", |
189 | "flag", flags, | 189 | value_str, |
190 | "label", rname); | 190 | "record_type", |
191 | record_type_str, | ||
192 | "expiration_time", | ||
193 | expiration_time_str, | ||
194 | "flag", | ||
195 | flags, | ||
196 | "label", | ||
197 | rname); | ||
198 | } | ||
199 | else | ||
200 | { | ||
201 | ret = json_pack ("{s:s?,s:s?,s:s?,s:i}", | ||
202 | "value", | ||
203 | value_str, | ||
204 | "record_type", | ||
205 | record_type_str, | ||
206 | "expiration_time", | ||
207 | expiration_time_str, | ||
208 | "flag", | ||
209 | flags); | ||
210 | } | ||
191 | GNUNET_free_non_null(value_str); | 211 | GNUNET_free_non_null(value_str); |
192 | return ret; | 212 | return ret; |
193 | } | 213 | } |