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

Handle multiple requests at once bug #32

Closed fraunhofer-iis-bot closed 1 year ago

fraunhofer-iis-bot commented 4 years ago

In GitLab by @Michael-M-Baron on Aug 11, 2020, 15:34

While developing, we discoverd a strange behavior of the libjapi Server. It seems, that the current version of the lipjapi sever has problems processing multiple requests. We send send multiple requests at once, separated by a '\n', and only the first request gets processed.

The detailed Problem is described in Issue.

I found the problem in the libjapi server code and have a solution/bugfix. The Solution is also described in the ticket above.

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Sep 24, 2020, 09:56

Thanks for the report. I'll look into it.

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Sep 24, 2020, 10:33

Good catch! The fix proposed in issue https://git01.iis.fhg.de/abt-hfs/interstellar/server_adc/-/issues/174 looks good. I'll integrate it in libjapi together with some error handling in case the client left while there is still data in the buffer.

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Sep 25, 2020, 13:51

mentioned in commit 8b9b48ddeae10faf43d6f167715f8db59bfb98ef

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Sep 25, 2020, 13:53

Merge request submitted: https://git01.iis.fhg.de/ks-ip-lib/software/libjapi/-/merge_requests/55

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Sep 25, 2020, 13:58

@Michael-M-Baron @fraunhofer-iis-anon Can you please try to reproduce the bug using the libjapi branch "reuse_creadline_buffer" and provide some feedback afterwards?

I found another issue which never showed up before because the creadline buffer wasn't used at all. If you use different clients at the same time a dedicated buffer is required for each client. Otherweise it could happen that unprocessed data from one client is combined with new data from another client. This issue was also solved in the branch.

if everything works fine I will accept the merge request.

fraunhofer-iis-bot commented 4 years ago

In GitLab by @Michael-M-Baron on Oct 1, 2020, 16:07

I tried to reproduce the bug and it seems that the bug is fixed now! It works fine now.

@fraunhofer-iis-anon is going to have look on the patch the next days.

fixed_server

fraunhofer-iis-bot commented 4 years ago

In GitLab by @fraunhofer-iis-anon on Oct 6, 2020, 11:36

I apologize for the late response.

I have just tested the fixed server image using my GUI as well as using Netcat and I did not notice any further issues. It seems to be working fine now.

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Oct 6, 2020, 11:36

Thank you very much!

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Oct 6, 2020, 11:39

Merged into dev branch (https://git01.iis.fhg.de/ks-ip-lib/software/libjapi/-/merge_requests/55)

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Oct 6, 2020, 11:55

libjapi 0.3.1 was released. Please update your git submodule.

Thanks again for reporting the issue and contributing to libjapi!

fraunhofer-iis-bot commented 4 years ago

In GitLab by @cstender on Oct 6, 2020, 11:55

closed