Fraunhofer-IIS / libjapi

libjapi is a universal JSON to C API library. It receives newline-delimited JSON (NDJSON) messages via TCP and calls registered C functions. A JSON response is returned for each request. Furthermore, it is also possible to create push services, which asynchronously push JSON messages to the clients subscribed to them.
MIT License
3 stars 1 forks source link

introduced args and data JSON objects for user content - [merged] #86

Closed fraunhofer-iis-bot closed 1 year ago

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 1, 2019, 17:15

_Merges issue13 -> dev

In order to separate libjapi commands from user content two new top-level JSON objects were added. User content in japi requests must be placed into args while user content sent back to the client is part of the data object.

Fixes issue #13 Fixes issue #18

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 2, 2019, 12:29

Commented on doxydir/main.md line 117

Bitte einheitlich formatieren (d.h. die 2. Ebene einrücken und } in eine eigene Zeile).

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 2, 2019, 12:30

Commented on doxydir/main.md line 129

Formatierung (siehe vorherigen Kommentar).

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 2, 2019, 12:32

Commented on doxydir/main.md line 167

Auch hier passt die Einrückung nicht ganz (kommt weiter unten noch öfter vor. Ich markiere das ab jetzt nicht jedes Mal; bitte alle Beispiele korrigieren).

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 2, 2019, 14:45

Commented on src/japi.c line 100

Was passiert hier, wenn args nicht mitgeschickt wurde?

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 2, 2019, 15:08

Commented on src/japi.c line 100

jargs ist dann NULL

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 6, 2019, 12:29

Commented on doxydir/main.md line 258

Hier fehlt die }.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 6, 2019, 12:34

Commented on src/japi.c line 100

Das finde ich unschön, weil dann jede Handlerfunktion abfragen muss, ob NULL übergeben wurde (sonst crasht das Programm!). Vllt. wäre es schöner, immer ein leeres Objekt zu übergeben?

fraunhofer-iis-bot commented 5 years ago

In GitLab by @kolb on Aug 6, 2019, 12:40

Bei den Tests muss vermutlich auch noch einiges nachgezogen werden. Z.B. brauchen haben die Pushservice-Requests jetzt auch ein args-Feld.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 7, 2019, 11:05

Commented on src/japi.c line 100

Bei response NULL übergibt libjapi jetzt ein leeres data-JSON-Object.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 7, 2019, 12:40

Commented on doxydir/main.md line 258

changed this line in version 2 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 7, 2019, 12:40

added 1 commit

Compare with previous version

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 8, 2019, 11:12

Commented on src/japi.c line 100

changed this line in version 3 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 8, 2019, 11:12

added 1 commit

Compare with previous version

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:16

Commented on README.md line 181

Bitte hier die Ebenen auch so formatieren wie in der Doxygen Doku. Beziehst sich auf die ganze Datei.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:35

Commented on src/japi.c line 86

jargs erstellst du ja unten schon.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:35

Commented on src/japi.c line 131

Leerzeile zu viel

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:38

Commented on src/japi.c line 150

durch das Hinzufügen von jresp_data zu jresp hast du auch die Kontrolle über das Objekt an jresp abgegeben. Was du hier also machst ist ein invalid/double-free. Reportet dir valgrind übrigens auch so. :-)

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:41

Commented on src/japi.c line 157

jargs ist weiterhin Teil von jreq und laut Dokumentation wurde der Reference-Count auch hier nicht erhöht. Deshalb muss das hier auch weg.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:44

Commented on src/japi_pushsrv.c line 397

Reihenfolge bitte drehen, also das data unter japi_pushsrv steht.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:45

Commented on src/japi_pushsrv.c line 396

Nachdem du hier ein json_object_new_object machst, musst du das nach japi_get_jobj_as_ndstr auch wieder freigeben.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 12:50

Commented on src/japi_pushsrv.c line 396

Problematisch ist an dem Punkt, dass du damit jmesg_data auch freigibst, obwohl das für den User nicht ersichtlich ist.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on README.md line 181

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on src/japi.c line 86

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on src/japi.c line 131

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on src/japi.c line 150

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on src/japi.c line 157

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

Commented on src/japi_pushsrv.c line 397

changed this line in version 4 of the diff

fraunhofer-iis-bot commented 5 years ago

In GitLab by @fraunhofer-iis-anon on Aug 14, 2019, 14:45

added 1 commit

Compare with previous version

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 17:06

added 1 commit

Compare with previous version

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 17:17

Commented on src/japi_pushsrv.c line 396

Reference Count von jmesg_data wird vorab erhöht, damit das Object nach dem free'en von jmsg weiterhin zur Verfügung steht.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 17:29

Nachdem viele Funktionen direkt, d.h. ohne den kompletten japi_request Context getestet werden, passen die Tests derzeit alle.

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 14, 2019, 17:29

resolved all discussions

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 16, 2019, 15:46

merged

fraunhofer-iis-bot commented 5 years ago

In GitLab by @cstender on Aug 16, 2019, 15:46

mentioned in commit 9dac7b4ec25a8a99c6c8a8604d2b456e4fe77ad0