Comments (13)
In GitLab by @vornkat-iis on Jul 2, 2023, 21:06
@bmi How do you run "japi_pushsrv_destroy at runtime"? japi_start_server
is a blocking call, so usually push services cannot be modified while the server is running. Do you modify the context and then start it again? Or are you running it asynchron?
From inside japi_pushsrv_destroy
I cannot access ctx
which I would need to modify. What would you (as user and as SW architect) propose?
- Document, that users need to clean up the linked list in
ctx->push_services
themselves if removing a push service. No modification to code. - Change the API to add
ctx
to the parameters ofjapi_pushsrv_destroy
(could be a breaking change for some users) and clean up the list there - Add a wrapping function which handles the linked list and calls
japi_pushsrv_destroy
. Find a code proposal for that in 824dd8f
from libjapi.
In GitLab by @vornkat-iis on Jul 2, 2023, 21:36
added 1 commit
- 824dd8f - Add japi_pushsrv_deregister and tests
from libjapi.
In GitLab by @vornkat-iis on Jul 2, 2023, 21:57
requested review from @Michael-M-Baron
from libjapi.
In GitLab by @bmi on Jul 3, 2023, 08:46
i dont use it because it is not destroying the pointers.
At the moment i have my own destroy function to destroy the pointers correct.
I modify the context via a request function and my pointers are in a global context.
I am not starting or Stoping anything. And i also not run asynchron.
to your points:
1: never do this your library is creating the pointer you must be sure to clean up everything.
2: yes this is the the only way you can handle it(at my point of view at the moment). And i think this is not a breaking change for somebody because if you not do it the code is broken and it will not run further so it is important to clean the list.
(and nobody has report the problem bevor me, so i think nobody is using this at runtime)
- I do not understand what you want to achieve
from libjapi.
In GitLab by @vornkat-iis on Jul 3, 2023, 13:09
added 1 commit
- 295d04a - japi_pushsrv_destroy: remove from linked list
from libjapi.
In GitLab by @vornkat-iis on Jul 3, 2023, 13:15
Assumption: It is save to change the signature of the function. If another user would access this function, they would have found the error sooner.
from libjapi.
In GitLab by @vornkat-iis on Jul 4, 2023, 13:56
added 1 commit
- 95ec765 - Catch double free in japi_pushsrv_destroy
from libjapi.
In GitLab by @vornkat-iis on Jul 4, 2023, 14:01
marked this merge request as ready
from libjapi.
In GitLab by @vornkat-iis on Jul 4, 2023, 17:42
changed target branch from master
to dev
from libjapi.
In GitLab by @Michael-M-Baron on Jul 5, 2023, 10:52
added 8 commits
- 95ec765...5b83a42 - 7 commits from branch
dev
- c1aefa9 - Merge branch 'dev' of git01.iis.fhg.de:ks-ip-lib/software/libjapi into...
from libjapi.
In GitLab by @Michael-M-Baron on Jul 5, 2023, 10:57
I encountered this problem as well while developing the dynamic creating and removing of push services. See #47 for details.
The new approach with updating the ctx push service list in japi_pushsrv_destroy() right away looks good!
from libjapi.
In GitLab by @Michael-M-Baron on Jul 5, 2023, 11:06
approved this merge request
from libjapi.
In GitLab by @Michael-M-Baron on Jul 5, 2023, 11:06
mentioned in commit 0687def
from libjapi.
Related Issues (20)
- Include errors using <>/"" HOT 5
- Resolve "libjapi/doxydir example out of date" - [merged] HOT 12
- dynamic creation of push service during runtime HOT 1
- Add MIT license HOT 1
- Resolve "Add MIT license" - [merged] HOT 12
- server has to remove ungracefull disconnected zombie clients HOT 3
- Resolve "Include errors using <>/""" - [merged] HOT 8
- Resolve "Different behavior of push services in debug and release mode" - [merged] HOT 8
- Add clang-format HOT 1
- Move issues to Github HOT 10
- update sync-traning docu value written in EEPROM HOT 1
- Resolve "Add clang-format" - [merged] HOT 11
- Collect code coverage HOT 1
- Improve `make help`
- Provide more modern environments for CI
- Refactor `japi_register_request` and remove `ctx->init`
- CI: upload-artifact v3 deprecated
- increase line buffer size HOT 1
- split cmake of libjapi and test build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjapi.