Closed m1h43l closed 3 months ago
The problem seems to be on the il_addRoute
function in api.c
, line 389.
If I add routes without the route id then everything is fine. If I add all routes with a route id then also everything is fine. But when I use a mix of routes with and without a route id then it seems to mess things up.
il_addRoute(config : %paddr(routeFirst) : IL_ANY : REGEX_START + '/first$' : *omit : 'first');
il_addRoute(config : %paddr(routeSecond) : IL_ANY : REGEX_START + '/second$');
il_addRoute(config : %paddr(routeThird) : IL_ANY : REGEX_START + '/third$');
In line 406 the function checks if a route id parameter has been passed. It checks on the number of passed parameters. In this case on the first call there are 6 parameters and on the second and third call only 4. But when being debugged it will always go into the if
branch as if there always have been passed 6 parameters, see attached screenshot.
I have looked at it - perhaps this is one for IBM? What do I miss?
On Thu, Sep 22, 2022 at 3:56 PM m1h43l @.***> wrote:
The problem seems to be on the il_addRoute function in api.c, line 389.
If I add routes without the route id then everything is fine. If I add all routes with a route id then also everything is fine. But when I use a mix of routes with and without a route id then it seems to mess things up.
il_addRoute(config : %paddr(routeFirst) : IL_ANY : REGEX_START + '/first$' : *omit : 'first'); il_addRoute(config : %paddr(routeSecond) : IL_ANY : REGEX_START + '/second$'); il_addRoute(config : %paddr(routeThird) : IL_ANY : REGEX_START + '/third$');
In line 406 the function checks if a route id parameter has been passed. It checks on the number of passed parameters. In this case on the first call there are 6 parameters and on the second and third call only 4. But when being debugged it will always go into the if branch as if there always have been passed 6 parameters, see attached screenshot.
[image: debugging api c] https://user-images.githubusercontent.com/10236415/191766376-16b1bb7f-bad4-41ed-a627-ed5ad78add58.png
— Reply to this email directly, view it on GitHub https://github.com/sitemule/ILEastic/issues/110#issuecomment-1255062444, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHU5WRLXZS7S2SVLZ5LV7RQRRANCNFSM6AAAAAAQS7GQEE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I will try to create a simple example program so that we (or IBM) can analyze the problem better.
I added a unit test but could not reproduced the problem with this test.
@NielsLiisberg perhaps you could check if the test is correct (as it also contains some C code) : commit 1818615
Perhaps the ParmNum is overwritten in the invocations stack. I can try theo create a temporary variable as the first thing .. This is my best guess.
On Thu, Sep 29, 2022 at 8:44 AM m1h43l @.***> wrote:
I added a unit test but could not reproduced the problem with this test.
@NielsLiisberg https://github.com/NielsLiisberg perhaps you could check if the test is correct (as it also contains some C code) : commit 1818615 https://github.com/sitemule/ILEastic/commit/1818615fd0e959881bd481dc41d62dd1d7bd1e94
— Reply to this email directly, view it on GitHub https://github.com/sitemule/ILEastic/issues/110#issuecomment-1261837880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHXDYQROWGXGZH5D6TDWAU3EDANCNFSM6AAAAAAQS7GQEE . You are receiving this because you were mentioned.Message ID: @.***>
Perhaps this is a connected to #114 .
Remember that I had to change it to be thread safe !! The routing was ( unfortunately) put in to the "global" part of the config - That is changed
On Fri, Jan 27, 2023 at 3:02 PM m1h43l @.***> wrote:
Perhaps this is a connected to #114 https://github.com/sitemule/ILEastic/issues/114 .
— Reply to this email directly, view it on GitHub https://github.com/sitemule/ILEastic/issues/110#issuecomment-1406547731, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHRZOQNQ7VVM5LH2F2LWUPIO5ANCNFSM6AAAAAAQS7GQEE . You are receiving this because you were mentioned.Message ID: @.***>
I haven't seen this problem for some time now. Closing this issue.
From time to time the wrong route id is set on in the request data structure on a request.