src/app-framework-binder.git
4 years agoFix client disconnection close 82/22182/1 8.0.1 8.0.2 halibut/8.0.1 halibut/8.0.2 halibut_8.0.1 halibut_8.0.2
José Bollo [Tue, 20 Aug 2019 10:32:02 +0000 (12:32 +0200)]
Fix client disconnection close

Before that change, the client disconection made a loop
on read but wasn't closing the link.

Bug-AGL: SPEC-2759

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: Iecfbb95cb1b7079e695ff5c08155b2310bf4b8d8

4 years agoFix detection of error in call synchronous 23/22023/1 8.0.0 halibut/8.0.0 halibut_8.0.0
Jose Bollo [Mon, 29 Jul 2019 09:48:00 +0000 (11:48 +0200)]
Fix detection of error in call synchronous

There fixes a bug with an inversion between info
and error in implementation of synchronous calls,
leading to bad detection of errors.

Bug-AGL: SPEC-2697

Change-Id: I30a8cd9c45a91b442f6c501dd3b0c32cd3ea632d
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agoUpdate .gitreview for halibut branch 79/21979/1
José Bollo [Thu, 25 Jul 2019 18:00:40 +0000 (20:00 +0200)]
Update .gitreview for halibut branch

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: I2c97b52e24bcc4bbda1143b6a88f491149d7e169

4 years agoFix bad memory access at client disconnection 02/21902/1
José Bollo [Tue, 9 Jul 2019 22:06:36 +0000 (00:06 +0200)]
Fix bad memory access at client disconnection

The management of structures handling a client
connection to a exported --ws-server was accessing
freed memory. Tha commit fixes that issue.

Bug-AGL: SPEC-2651

Change-Id: I511218afc907308347bc422a8aead32ca00bdae6
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agoTag broadcasted events with UUID and hop 00/21900/2
José Bollo [Tue, 16 Jul 2019 21:39:27 +0000 (23:39 +0200)]
Tag broadcasted events with UUID and hop

When API have mutual dependencies, leading to
loops in dependecies, broadcasting an event
never ends because of the loop (see SPEC-2625).

To avoid that weird flood of events, a unic
identifier (UUID) is attached to broadcasted
event and a tiny memory records previously
broadcasted events to avoid re-sending an
already sent event.

The size of the memory can be set using the
macro variable EVENT_BROADCAST_MEMORY_COUNT
whose default value is 8. It can be reduced
to 0.

An other mecanism is added to limit the count
of hops that a broadcasted event can do. That
count can be set using the macro variable
EVENT_BROADCAST_HOP_MAX whose default value
is 10.

Bug-AGL: SPEC-2625

Change-Id: I29550a8a5c8f5e2ffb20edc3330357a1e870c0e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agoafb-evt: Refactor processing of broadcasted events 99/21899/2
José Bollo [Tue, 16 Jul 2019 12:12:35 +0000 (14:12 +0200)]
afb-evt: Refactor processing of broadcasted events

Solving the bug SPEC-2625 needs to rework the broadcasting
of events. It appeared that the numerical event identifier
passed for broadcast wasn't used by called function except
for hooking. Suppressing it introduces a clear distinction
between the push and the broadcast paths.

The file afb-ws-json1 is changed to avoid casting of
functions.

Bug-AGL: SPEC-2625

Change-Id: I9fe75adc8086812b21b70ce28baffcf77bd5e1cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agouuid: Add module for UUID generation 98/21898/2
José Bollo [Tue, 16 Jul 2019 13:27:29 +0000 (15:27 +0200)]
uuid: Add module for UUID generation

This commit allow modules of afb-daemon to request UUID.

This introduce an abstraction above libuuid for 3 reasons:

 1. Using uuid had bad side effect inthe past because it
    required enought entropy at start time, leading to hanging
    initialisations in wait for enough entropy.

 2. Solving bug SPEC-2625 will require use of UUID.

 3. Porting to systems that haven't libuuid is made more
    easy after that.

Bug-AGL: SPEC-2625

Change-Id: I27d8b611946686dea6fab250697afe9b89aac869
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agoafb-client-demo: Allow pipe of messages 66/21866/2 7.99.3 halibut/7.99.3 halibut_7.99.3
Jose Bollo [Wed, 10 Jul 2019 15:23:31 +0000 (17:23 +0200)]
afb-client-demo: Allow pipe of messages

The tool afb-client-demo implements a synchronous
mode (option -s) that allows to wait for a reply
before to send the next request.

It is interesting for the purpose of testing to allow
afb-client-demo it to send a controlled count of
requests, ensuring that there is a controlled count
of pending requests.

Bug-AGL: SPEC-2638

Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Change-Id: Ic854d68aaeb82c17b4640c5c9de46181ad3a7e5e

4 years agoafb-xreq: Forbids (un)subscribes after reply 65/21865/2
Jose Bollo [Wed, 10 Jul 2019 13:18:02 +0000 (15:18 +0200)]
afb-xreq: Forbids (un)subscribes after reply

Allowing to subscribe to a request that was replied
was possible and lead to problem revealed by issues
SPEC-2542 and SPEC-2599 (these issues are more related
to processing unordered incoming messages).

The choice was
 - fix the bug and authorize (un)subscribe after reply
 - forbids to (un)subscribe after reply

Second solution was chosen for its simplicity and
its networking efficiency.

Bug-AGL: SPEC-2542
Bug-AGL: SPEC-2599

Change-Id: I09f48b760b1fd6f70d42b80df3c8053696c45966
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agoRevert "afb-stub-ws: Allow unordered process of messages" 64/21864/1
José Bollo [Fri, 12 Jul 2019 13:41:32 +0000 (15:41 +0200)]
Revert "afb-stub-ws: Allow unordered process of messages"

This reverts commit 5425e054fbf87fe6d024103f46e53f2a28e074f2.

The change introduced in the reverted commit
is no more necessary since events are sent asynchronousely.

Bug-AGL: SPEC-2215
Bug-AGL: SPEC-2219
Bug-AGL: SPEC-2542
Bug-AGL: SPEC-2599

Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Change-Id: I4fd8d1516c97e2f95caaa244e28491f71b15bba7

4 years agoafb-evt: send events in separate job 63/21863/1
Jose Bollo [Thu, 11 Jul 2019 16:20:23 +0000 (18:20 +0200)]
afb-evt: send events in separate job

Sending events in the context of the calling process
had the consequence that the ordering of the messages
had to be removed (see SPEC-2215 & SPEC-2219). This
was not good by nature and lead to issues SPEC-2542
and SPEC-2599.

Sending events in the context of the calling process
also implies to delay the calling process.

For this reasons, sending events is now done in an
other jobs. For that reason, the count of allowed
pending jobs is increased to 100 (was 50).

Bug-AGL: SPEC-2215
Bug-AGL: SPEC-2219
Bug-AGL: SPEC-2542
Bug-AGL: SPEC-2599

Change-Id: I5b56d952cc187b65ad6eb9344ad74e5e8d3b7540
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agoafb-evt: Improve compatibility to guppy 62/21862/1
José Bollo [Fri, 12 Jul 2019 09:30:49 +0000 (11:30 +0200)]
afb-evt: Improve compatibility to guppy

The commit "a2cf84e: hooks: Allow to remove hooking"
re-order fragment of code. But this is an issue when
backporting changes to guppy.

That commit improve the situation for the file
afb-evt.c in the process of fixing the issue
SPEC-2599

Bug-AGL: SPEC-2599

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: I4e56cbeee7d3a89770e37a3045f652f39fc07410

4 years agoafb-args: Fix output of --version 40/21840/1
José Bollo [Tue, 9 Jul 2019 16:05:31 +0000 (18:05 +0200)]
afb-args: Fix output of --version

The legacy V1 and V2 versions of bindings are no
more printed if absent.

The support of dynamic bindings is fixed.

Bug-AGL: SPEC-2617

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: I429c0e2cdfcbfba6e0f1e639dbcbc2ca90a345ed

4 years agoFix syntax error in a constexpr function 32/21832/2
Loïc Collignon [Mon, 8 Jul 2019 12:47:30 +0000 (14:47 +0200)]
Fix syntax error in a constexpr function

The function declaration contains a syntax error that was somehow
ignored but raise an error about an illegal cast in a constexpr
function.
Fixed this error and clean up a bit surrounding code to be more concise.

Bug-AGL: SPEC-2615

Change-Id: I931b086c96b093b3de4465c51dfc3e865f7ece3b
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
4 years agoFix invalid TRACE setting in print version 37/21837/2
Sebastien Douheret [Tue, 9 Jul 2019 06:16:20 +0000 (08:16 +0200)]
Fix invalid TRACE setting in print version

Bug-AGL: SPEC-2617

Change-Id: Ia935aab3b0b508e7a916e334237c639efb1feb15
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
4 years agoFix warning when compiling with clang 86/21786/4
Loïc Collignon [Fri, 28 Jun 2019 07:50:46 +0000 (09:50 +0200)]
Fix warning when compiling with clang

The 'maybe-uninitialized' warning option is a GCC's only flag. The
equivalent one for Clang is 'possible-uninitialized'.
Added the right flag based on the compiler.

Bug-AGL: SPEC-2584

Change-Id: I09ce434dfda21996cefbf0b527b43d666a042e0e
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
4 years agoBuild af-binder-devtools-native using GCC-9.1.1 87/21487/3 7.99.2 halibut/7.99.2 halibut_7.99.2
Bechir Mghirbi [Tue, 4 Jun 2019 08:16:03 +0000 (10:16 +0200)]
Build af-binder-devtools-native using GCC-9.1.1

GCC-9.1.1 complains about variable ‘buf[0]’ that it may be used uninitialized
in the function 'make_info()'. This patchset initialize the variable.

Bug-AGL: SPEC-2482
Signed-off-by: Bechir Mghirbi <bechir.mghirbi@grammer.com>
Change-Id: I38d0c6f47fed462f4ea48990c4cb63f21fb2ee16

4 years agoafb-daemon: Add /tmp has fallback for uploads 76/21376/2 7.99.1 halibut/7.99.1 halibut_7.99.1
José Bollo [Thu, 23 May 2019 08:21:43 +0000 (10:21 +0200)]
afb-daemon: Add /tmp has fallback for uploads

During its start, when implementing HTTP server,
afb-daemon checked that the upload directory was
accessible and writable and afb-daemon refused to
start when it was not the case.

When trying to use systemd's DynamicUser for platform
services, it had the effect to forbid service to run.

That commit add the directory /tmp as a fallback
upload directory.

Bug-AGL: SPEC-2446

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: Ib4ee456d71cb1aefa19e8eed6774ef5f77919366

4 years agojobs: Fix infinite wait lock 38/21438/2
José Bollo [Tue, 28 May 2019 07:37:11 +0000 (09:37 +0200)]
jobs: Fix infinite wait lock

The binder was sometime locked until an external
event comes. This was discovered during stressing
startup test that don't expect external inputs and
that then waits for always without terminating.

The issue came from a little hole in the management
of the state of evmgr object. By design the evmgr
has to be synchronised against concurrent accesses
not by itself but by the integration. However, the
state of "running" wasn't set in the code protected
against concurent accesses. The new function allows
the integrator to correctly set the state before
releasing protection.

Bug-AGL: SPEC-2459

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Change-Id: Id75fd97c06d69666ced912a0a61380573dab31af

4 years agoFix afb document typo. 77/21277/3
Li Xiaoming [Thu, 9 May 2019 07:23:28 +0000 (15:23 +0800)]
Fix afb document typo.

Bug-AGL: SPEC-2391

Change-Id: I73efab27d09fce7ca16edabe14fe19d1092162db
Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
4 years agoafb-export: Fix requirement on multiple apis 45/21245/1
José Bollo [Fri, 3 May 2019 13:08:10 +0000 (15:08 +0200)]
afb-export: Fix requirement on multiple apis

The test 'test-apiv3' was failing because the required
api list "albert armel" wasn't splitted but set as-is.

At the same time, test suite is improved.

Bug-AGL: SPEC-1130
Bug-AGL: SPEC-2377

Change-Id: Ia4ab23bf666b5b4b1db3e1da2654d9387c2c01e5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agocoverage: Add test of AFB_DEBUG_WAIT 16/21216/1
José Bollo [Tue, 30 Apr 2019 20:39:33 +0000 (22:39 +0200)]
coverage: Add test of AFB_DEBUG_WAIT

Bug-AGL: SPEC-1130

Change-Id: I349c141015e3851ddecd4a6df7497d8ef4cceaa6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agocoverage: Allow to run coverage everywhere 15/21215/1
José Bollo [Tue, 30 Apr 2019 20:38:28 +0000 (22:38 +0200)]
coverage: Allow to run coverage everywhere

Coverage presumed that an available afb-daemon without
coverage instrumentation was available in the PATH.

This fix that problem by compiling that requirement.

Bug-AGL: SPEC-1130

Change-Id: Ic3435d73e830d630bef63dfb8e9b2ff9f1bf043c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agoAllow to tune installation directories 14/21214/1
José Bollo [Tue, 30 Apr 2019 20:18:08 +0000 (22:18 +0200)]
Allow to tune installation directories

The location of intrinsic bindings and samples could not be tuned
but was fixed to be ${CMAKE_INSTALL_FULL_LIBDIR}/afb and
${CMAKE_INSTALL_FULL_DATADIR}/af-binder

These default locations are not bad but it is important to be able
to tune that location.

Bug-AGL: SPEC-2367

Change-Id: I4d4f9e9490d61e3278ef35ac42f2143a752a7c37
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
4 years agodoc: Improve comment on asynchronous calls 25/21125/2
Jose Bollo [Mon, 25 Feb 2019 10:27:48 +0000 (11:27 +0100)]
doc: Improve comment on asynchronous calls

Following the remarks of fellow developers, the status
of the object received by the callback function
needs to be explained better.

Change-Id: I0e6bcd51849bbc5af92af08675949a901bfd683e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agobinding-wrap: Rework of context handling 09/21009/4
Jose Bollo [Fri, 12 Apr 2019 09:18:46 +0000 (11:18 +0200)]
binding-wrap: Rework of context handling

The C++ wrapper for handling contexts has
to be improved. This is a proposition of
improvement.

Change-Id: I7df36383f427d109356bdf4df573cba4b6e6ec05
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
4 years agosamples: wrong parameter for get_new_board() 71/21071/2
Phong Tran [Wed, 17 Apr 2019 15:58:40 +0000 (22:58 +0700)]
samples: wrong parameter for get_new_board()

for fixing
warning: too many arguments in call to 'get_new_board'

Change-Id: I7b3d175310156ea3d2efed29e344f01c9904d534
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
4 years agoMerge changes Id24d9bb0,I6807ed25
José Bollo [Tue, 23 Apr 2019 09:06:24 +0000 (09:06 +0000)]
Merge changes Id24d9bb0,I6807ed25

* changes:
  change style initialization of struct afb_auth
  missing full initialization for struct afb_verb_v3

5 years agochange style initialization of struct afb_auth 69/21069/1
Phong Tran [Wed, 17 Apr 2019 15:57:17 +0000 (22:57 +0700)]
change style initialization of struct afb_auth

This is for fixing
warning: suggest braces around initialization of subobject
[-Wmissing-braces]

Change-Id: Id24d9bb09e46d59df7d043ed931e00bb5ec9469a
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
5 years agomissing full initialization for struct afb_verb_v3 68/21068/1
Phong Tran [Wed, 17 Apr 2019 15:56:37 +0000 (22:56 +0700)]
missing full initialization for struct afb_verb_v3

This is for fixing
warning: missing field 'callback' initializer
[-Wmissing-field-initializers]

Change-Id: I6807ed25bff96c96f347ec1e87f1b12cf0759498
Signed-off-by: Phong Tran <tranmanphong@gmail.com>
5 years agoMerge "afb-migration-to-binding-v3: fix broken links"
Jan-Simon Moeller [Tue, 16 Apr 2019 17:04:22 +0000 (17:04 +0000)]
Merge "afb-migration-to-binding-v3: fix broken links"

5 years agoafb-migration-to-binding-v3: fix broken links 56/21056/1
Clément Bénier [Tue, 16 Apr 2019 14:47:40 +0000 (16:47 +0200)]
afb-migration-to-binding-v3: fix broken links

- fix broken link to the same section

Change-Id: I5e104c5527fae29ff51b6208f43ed0eb3c5f8c04
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
5 years agoFix small issues 06/21006/2
Jose Bollo [Fri, 12 Apr 2019 07:39:34 +0000 (09:39 +0200)]
Fix small issues

These issues was discovered by static analysis tool.

Change-Id: Iea75151c9b1f5e4cb139d2dc4e8a5c8bae5bb303
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Update Makefile 95/20995/5
José Bollo [Thu, 11 Apr 2019 11:06:04 +0000 (13:06 +0200)]
coverage: Update Makefile

Add new definitions according to new compile flags.

Change-Id: I49f19c8bb4dc2a5a142c03e2e415eaa725d4c0af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoReordering of sample and tutorial bindings 94/20994/5
José Bollo [Thu, 11 Apr 2019 11:09:56 +0000 (13:09 +0200)]
Reordering of sample and tutorial bindings

The main idea here is to install the sample and
tutorial bindings in specific directory.

This will at the end help to package parts
of the binder.

It also includes a simplification of CMakeLists
files.

Also fix an error in packaging rpm.

Bug-AGL: SPEC-2165

Change-Id: I494cc753796848cde849de1c3596893c78fa228f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix rpm packaging following review 20926 54/20954/1
Frederic Marec [Tue, 9 Apr 2019 07:35:08 +0000 (09:35 +0200)]
Fix rpm packaging following review 20926

Change-Id: Iec9de4201e966ef53e3f1edf9d0a6a81ae2899fc
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
5 years agoChange agl-app-framework-binder.sh 26/20926/1
Frederic Marec [Fri, 5 Apr 2019 07:35:29 +0000 (09:35 +0200)]
Change agl-app-framework-binder.sh

Aligned the two different names from the two ways of packaging
From AGL-agl-app-framework-binder.sh to agl-app-framework-binder.sh for .rpm
From AGL-app-framework-binder.sh to agl-app-framework-binder.sh for .deb

Change-Id: Ie324ce159a55ccae7c051c97be5116d975e0da85
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
5 years agoafb-export: Fix heap corruption 05/20905/1
José Bollo [Thu, 4 Apr 2019 13:28:03 +0000 (15:28 +0200)]
afb-export: Fix heap corruption

The allocated size wasn't correct when 'path'
was used. The effect be unseen depending on
size and alignment of heap chunks.

Change-Id: Id9f85a0078028319491b51bc3e11cd51e4bc3755
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix false ***buffer overflow*** detection 82/20882/1
José Bollo [Tue, 2 Apr 2019 14:49:09 +0000 (16:49 +0200)]
Fix false ***buffer overflow*** detection

The compiling option __FORTIFY_SOURCE=2 introduced
a false ***buffer overflow*** detection when the
flexible array 'pattern' was initilized in globset.

The compiler is only complaining when the array is
in a struct that is in a struct like

 struct { ...; struct { ...; char name[1]; }}

To avoid these false detections, it is enougth
to ellipsese the dimension of the array. Seems
to be the now standard way of declaring flexible
arrays when it was before an extension. So now:

 struct { ...; struct { ...; char name[]; }}

works even when __FORTIFY_SOURCE=2.

Bug-AGL: SPEC-2292

Change-Id: I4b4a5df505a5357f92b9ab1657175911198ca582
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoAdd conditionnal support of dynamic bindings 73/20873/1
Jose Bollo [Mon, 18 Feb 2019 14:04:38 +0000 (15:04 +0100)]
Add conditionnal support of dynamic bindings

The load of dynamic bindings becomes removable.
This is a step in direction of a tiny binder library.

Also refactor AGL_DEVEL

Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Change-Id: If283f431fd8a831429e717b2770464cb54476dc7

5 years agoAdd conditionnal support of bindings version 2 72/20872/1
Jose Bollo [Mon, 18 Feb 2019 13:31:25 +0000 (14:31 +0100)]
Add conditionnal support of bindings version 2

Bindings version 2 will become legacy soon.
This patch allows their removal

Change-Id: Iecad3abd0ddd714e5d55c0b935be756a29d1ca37
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoImprove setting of options 71/20871/1
Jose Bollo [Mon, 18 Feb 2019 12:13:56 +0000 (13:13 +0100)]
Improve setting of options

Change-Id: Idbadb9b7b801cb61d527addb5d3137aeb4cf6311
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agojobs: Refactor exiting jobs 70/20870/1
José Bollo [Fri, 15 Feb 2019 19:49:54 +0000 (20:49 +0100)]
jobs: Refactor exiting jobs

The new termination function can allow the restart
because it doesn't abort the waiting jobs.

So after calling 'jobs_exit', all threads stop.
The function 'job_start' returns.

The threads that are in blocking state, i.e. in
a call to 'jobs_enter' or 'jobs_call' are stopped.
An error status -1 with errno=EINTR is returned in
that case.

But before returning, that function calls the exit
handler if any.

Change-Id: I85a4b1976b09b18804eb681af940531ae5ace6c3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoWorkaround an exit issue 69/20869/1
José Bollo [Fri, 15 Feb 2019 16:40:04 +0000 (17:40 +0100)]
Workaround an exit issue

When running gcov the running script is
sometime blocking.

GDB tells:

 Thread 1 (Thread 0x7ff14e783b40 (LWP 1318)):
 #0  0x00007ff14ccf334c in __lll_lock_wait_private () from /lib64/libc.so.6
 #1  0x00007ff14cc70598 in malloc () from /lib64/libc.so.6
 #2  0x000000000046523a in gcov_do_dump ()
 #3  0x00000000004653f4 in __gcov_exit ()
 #4  0x00000000004632df in _GLOBAL__sub_D_00100_1_wrap_json_get_error_position () at ../../src/wrap-json.c:1250
 #5  0x00007ff14e5b5916 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
 #6  0x00007ff14cc255ec in __run_exit_handlers () from /lib64/libc.so.6
 #7  0x00007ff14cc2571c in exit () from /lib64/libc.so.6
 #8  0x00000000004069fc in on_sigchld (signum=17, info=0x7ffc3f43fa70, uctx=0x7ffc3f43f940) at ../../src/main-afb-daemon.c:411
 #9  <signal handler called>
 #10 0x00007ff14cc6e527 in _int_malloc () from /lib64/libc.so.6
 #11 0x00007ff14cc710a2 in calloc () from /lib64/libc.so.6
 #12 0x00007ff14d454ff7 in json_object_new_int () from /lib64/libjson-c.so.4
 ...

It means that allocating memory in exit handlers
can block!

The work around here is to force the daemon to exit
properly, i.e., not in a signal handler, by calling hello/exit
from test script -at the very end-.

Change-Id: Iee289fb1af8479628df895aac7eb021cedda4f2c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoevmgr: Fix a "maybe uninitialized" issue 67/20867/1
José Bollo [Tue, 2 Apr 2019 07:48:50 +0000 (09:48 +0200)]
evmgr: Fix a "maybe uninitialized" issue

The warning maybe-uninitialized is emited only
when the optimisation level is greater than 0.
For this reason, the error was not discovered
development process. The build config is tuned
to detect that error and the error is fixed.

Change-Id: I14c8ffe6daa3d498268cfadeab20300895b3360e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoRename afb-config to afb-args 60/20860/1
José Bollo [Fri, 15 Feb 2019 16:13:38 +0000 (17:13 +0100)]
Rename afb-config to afb-args

With the introduction of more compilation flags,
it becomes interesting to use a configuration
file.

The configuration file is usually "config.h".
So that renaming avoids future ambiguity.
It also reflects better what the module does.

Change-Id: I952adc1e1bf469132dc224900bd9140ccc51c58b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agohooks: Allow to remove hooking (and/or trace) 59/20859/1
Jose Bollo [Fri, 15 Feb 2019 12:41:38 +0000 (13:41 +0100)]
hooks: Allow to remove hooking (and/or trace)

This change allows to downsize the binder by
removing its internal hooking and tracing features.

Change-Id: Ifb080a7426216f6c6b1c8f8e5bf8ddd52df40a3e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agosig-monitor: Add compiling switches 58/20858/1
José Bollo [Thu, 14 Feb 2019 18:43:29 +0000 (19:43 +0100)]
sig-monitor: Add compiling switches

The following new switches are added:
 - USE_SIG_MONITOR_DUMPSTACK  activate dump stack on error
 - USE_SIG_MONITOR_SIGNALS    activate handling of signals
 - USE_SIG_MONITOR_FOR_CALL   activate monitoring of calls
 - USE_SIG_MONITOR_TIMERS     activate monitoring of call expiration

All enabled by default

Change-Id: I2231e5f2a8db469b7258ce14530f72b4c5f38b00
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-args: Use secure_getenv 57/20857/1
José Bollo [Thu, 28 Mar 2019 17:59:55 +0000 (18:59 +0100)]
afb-args: Use secure_getenv

Improves security of the binder by using
secure_getenv instead of getenv.

Change-Id: Iffd56ca65251763aacb0b9dbbaa768619cd92dd4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoevmgr: Isolate the event loop from jobs 45/20845/1
José Bollo [Wed, 13 Feb 2019 19:14:52 +0000 (20:14 +0100)]
evmgr: Isolate the event loop from jobs

The event loop is renamed evmgr for "event manager"
with the intention (1) still use evloop in jobs (2)
to provide an abstract event manager/handler/loop
abstraction.

Change-Id: Ib1955f661f98df80e1c7be99e9fe26a1e06d78f6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agosystem & jobs: Reverse link and acquiring events 44/20844/1
José Bollo [Thu, 14 Feb 2019 08:37:26 +0000 (09:37 +0100)]
system & jobs: Reverse link and acquiring events

- The new version of 'systemd_get_event_loop' dont depends
anymore on jobs but returns a unique systemd event loop
for any threads.

- The event loop of jobs now use system.h function instead
of the opposite.

- The function 'jobs_get_sd_event' is removed

- The function 'jobs_acquire_event_manager' is introduced.
It is designed to that the current thread can manipulate
the single event manager

Change-Id: I31fe48dfe0f2cfa4d468e49338d36fea6e7e8081
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoRename afb-systemd to systemd 43/20843/1
José Bollo [Thu, 14 Feb 2019 09:15:40 +0000 (10:15 +0100)]
Rename afb-systemd to systemd

Files "afb-systemd.[ch]" are renamed "systemd.[ch]"
and their functions "afb_systemd_*" are renamed "systemd_*"

Change-Id: I8362a2ca8b71945b54c6ab9a7ead51d9c50bc8e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agowatchdog: Isolate the watchdog from jobs 19/20819/1
José Bollo [Wed, 13 Feb 2019 16:09:05 +0000 (17:09 +0100)]
watchdog: Isolate the watchdog from jobs

Change-Id: Iaa7f71dc7e5d8d525463619b4da980c827722909
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Clean unneeded code 18/20818/1
José Bollo [Wed, 13 Feb 2019 13:50:34 +0000 (14:50 +0100)]
jobs: Clean unneeded code

Minor cleanup

Change-Id: Iddcaf85cdc30f74e54016ce300380b33662fbc04
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agocoverage: Allow removal of valgrind 17/20817/1
José Bollo [Thu, 14 Feb 2019 10:41:21 +0000 (11:41 +0100)]
coverage: Allow removal of valgrind

It can be usefull for debugging with gdb to
avoid the use of valgrind in the test.

This can be done by setting the environment
NOVALGRIND to any not empty value.

Also add more temporary files to ignore.

Change-Id: I853eb566607aa7ec87c356ee3acd9b1fa658b659
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoPrevent false positive during check source 92/20792/2
Frederic Marec [Sun, 24 Mar 2019 10:57:51 +0000 (11:57 +0100)]
Prevent false positive during check source

At runtime CFLAG _FORTIFY_SOURCE can provide false positive during its
checking. Change _FORTIFY_SOURCE level to 1 to avoid wrong comportement
of the package.

Change-Id: Ice4b386c253c87903e58f82a446416831cb4c6bf
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
5 years agojobs: Ensure validy of event loop 75/20775/2
Frederic Marec [Fri, 22 Mar 2019 10:03:44 +0000 (11:03 +0100)]
jobs: Ensure validy of event loop

In rare circumstances during intialization threads should wait instead
of using a null event loop. This is because no one has needed event loop at
this stage of initialization.

Change-Id: I05b6ddbc05bec50958d0981213219b1d641401a5
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
5 years agojson2c: Fix a fatal warning 63/20563/1
José Bollo [Tue, 12 Mar 2019 12:41:48 +0000 (13:41 +0100)]
json2c: Fix a fatal warning

At the end, the case is never reached because
json_object_to_json_string_ext only produces
valid JSON strings and a string terminated by
'\' isn't a valid JSON string.

Change-Id: I58a6dc4d9c014487ff2dc85f7eb3dbf33ffea6b1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoc++: Add tutorial tuto-5 for C++ class base_api_t 47/20547/1
Loïc Collignon [Wed, 27 Feb 2019 16:44:37 +0000 (17:44 +0100)]
c++: Add tutorial tuto-5 for C++ class base_api_t

Added the tuto-5 that show how to benefit from the
new 'binding-object' header and its new class 'base_api_t'.

Change-Id: I81e6fd8dc5899b8e93d75530d902c0e12fba72a9
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Inherit of class afb::api 45/20545/1
Loïc Collignon [Mon, 21 Jan 2019 09:40:50 +0000 (10:40 +0100)]
c++: Inherit of class afb::api

Base the class afb::base_api_t on the raw wrapper
class afb::api

Change-Id: Idbc4786d548ffcb0062a85b686c196758e49823c
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Add the wrapper class 'afb::api' 43/20543/1
Loïc Collignon [Fri, 4 Jan 2019 15:50:06 +0000 (16:50 +0100)]
c++: Add the wrapper class 'afb::api'

New 'api' wrapper for 'afb_api_t' related functions.

Change-Id: I695b65ff3d27b0ecc0f95f660a13b7a98fd92223
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Reworked the event class 41/20541/1
Loïc Collignon [Fri, 4 Jan 2019 15:05:10 +0000 (16:05 +0100)]
c++: Reworked the event class

Added move semantic and remove invalidation method as it's not used anymore
since we drop the support of APIv2.

Change-Id: If53840010d6f24d410712915051386190f55b504
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Fix multiple definition and cast 39/20539/1
Loïc Collignon [Fri, 4 Jan 2019 14:49:18 +0000 (15:49 +0100)]
c++: Fix multiple definition and cast

The function was defined as many time as the header was included.
Making it a weak function fix the issue.
Also, a plain old C cast is required to make this constexpr valid.

Change-Id: I278f376e00ec6728272df4fde8ca8984195dd533
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Add verb initialisation for C++ 37/20537/1
Jose Bollo [Wed, 2 Jan 2019 16:38:00 +0000 (17:38 +0100)]
c++: Add verb initialisation for C++

This new constexpr initialisation method accepts
a callback receiving a afb::req instead of a
afb_req_t.

Change-Id: I752e670b5545a9d7956987984e725b468196a6e9
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoc++: Fix a wrong callback version 35/20535/1
Loïc Collignon [Fri, 4 Jan 2019 14:31:02 +0000 (15:31 +0100)]
c++: Fix a wrong callback version

It used the legacy callback definition of apiv2 instead
of the apiv3 one.

Change-Id: Iab281131a923ae59cfbbb50cf72fd4a5c3f11d65
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Drop support of binding APIv2 33/20533/1
Loïc Collignon [Fri, 4 Jan 2019 14:25:31 +0000 (15:25 +0100)]
c++: Drop support of binding APIv2

The C++ interface is currently used only in APIv3.

Change-Id: Id1a3bca5dc8e69c1af229871e7f33192395230e7
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: Avoid relative path when including headers 31/20531/1
Loïc Collignon [Fri, 4 Jan 2019 14:22:27 +0000 (15:22 +0100)]
c++: Avoid relative path when including headers

Prefer the system path to include headers.

Change-Id: I08a64e8d27808084ea4592988f36b7e5099a7fc6
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoc++: New C++ API for bindings 29/20529/1
Loïc Collignon [Wed, 2 Jan 2019 16:44:27 +0000 (17:44 +0100)]
c++: New C++ API for bindings

You can implement a C++ binding API by inheriting
the templated base class 'base_api_t' and overriding
the methods you want.

At the same time, the c++ files are now located in
in their own subdirectory: afb/c++

Change-Id: Ie02535961ec6b4b5ae21390cb520acb1fdc44c9e
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
5 years agoafb-stub-ws: Allow unordered process of messages 91/20491/1
José Bollo [Thu, 7 Mar 2019 16:25:12 +0000 (17:25 +0100)]
afb-stub-ws: Allow unordered process of messages

Requests are already sequenced on need (noconcurrency
flag of bindings). Sequencing messages until their
completion has a side effect when dealing with events
and synchronous calls: event -> call -> reply locked
until event completion (see SPEC-2219).

This change could be reverted if events are converted
to jobs (see SPEC-2215).

Bug-AGL: SPEC-2219

Change-Id: Ia577bc54ba38291817fd5ed3e3dda1b67b2818b7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix build dep on OBS 87/20487/1
ronan [Thu, 28 Feb 2019 16:05:15 +0000 (17:05 +0100)]
Fix build dep on OBS

Change-Id: I95fa03c430b9f488b3b5b9a9bdfc50a1ff0f0421
Signed-off-by: ronan <ronan.lemartret@iot.bzh>
5 years agoUpgrade dependency to libmicrohttpd version 0.9.60 85/20485/1
José Bollo [Thu, 14 Feb 2019 14:25:22 +0000 (15:25 +0100)]
Upgrade dependency to libmicrohttpd version 0.9.60

The version of libmicrohttpd required is 0.9.60
at least.

Change-Id: Ia0784f5433d63d4de50654dd7577a8767578c069
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agostress: Improve the stress test scripts 19/20019/1
José Bollo [Fri, 8 Feb 2019 17:11:28 +0000 (18:11 +0100)]
stress: Improve the stress test scripts

The improvement was able to track the bug
SPEC-2163 by launching:
 - ./stress-server.sh --ws --valgrind
 - ./stress-clients.sh --null --count 20

Bug-AGL: SPEC-2163

Change-Id: I04634f0e98ab7a28df7c1d34ecc0d9c1faf43d57
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-stub-ws: Fix concurrent memory issues 17/20017/1
José Bollo [Fri, 8 Feb 2019 12:09:39 +0000 (13:09 +0100)]
afb-stub-ws: Fix concurrent memory issues

This changes takes care to increment the
the count of reference before using it.

Bug-AGL: SPEC-2163

Change-Id: Ia7882427eeae933eeb5030aad025ebb1da129d6f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoUpdate copyright date 69/19969/1 7.90.0 halibut/7.90.0 halibut_7.90.0
José Bollo [Tue, 5 Feb 2019 08:02:02 +0000 (09:02 +0100)]
Update copyright date

Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoSet next version of binder 67/19967/1
José Bollo [Tue, 5 Feb 2019 07:45:47 +0000 (08:45 +0100)]
Set next version of binder

Change-Id: I53c43380902f96b7a46a6a131a956965d7cf6fbc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Ensure releasing event loop 61/19961/1
Jose Bollo [Wed, 6 Feb 2019 16:16:09 +0000 (17:16 +0100)]
jobs: Ensure releasing event loop

The internal functions blocking threads
for implementing call_sync were not releasing
the event loop, leading to deafness of the
binder.

Include a tuto-4 that reproduce the issue
on a binder with the bug and that also shows
interesting usages of the binder.

Bug-AGL: SPEC-2161

Change-Id: I83ad4d55d721a6046e798a5e06967df4dd5a7284
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoMerge changes from topic 'spec-2089' 6.99.4 guppy/6.99.4 guppy_6.99.4
Jan-Simon Moeller [Fri, 18 Jan 2019 18:28:56 +0000 (18:28 +0000)]
Merge changes from topic 'spec-2089'

* changes:
  hello3: Fix warning unused variable
  afb-hsrv: Avoid call to getnameinfo
  jobs: Remove conditionnal REMOVE_SYSTEMD_EVENT
  jobs: Separate internal threads from others
  jobs: Refactor event loop handling
  afb-proto-ws: Serialize incoming message

5 years agohello3: Fix warning unused variable 53/19653/2
Jose Bollo [Mon, 14 Jan 2019 13:40:04 +0000 (14:40 +0100)]
hello3: Fix warning unused variable

The variable 'calling' was not used anymore.

Change-Id: I3a041cee57b2682374084003415d13a77a554fba
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-hsrv: Avoid call to getnameinfo 25/19525/3
José Bollo [Sat, 5 Jan 2019 20:15:40 +0000 (21:15 +0100)]
afb-hsrv: Avoid call to getnameinfo

Calling getnameinfo may block the program
a long time (5s) when address is zero.

Bug-AGL: SPEC-2133

Change-Id: Id52b2989c5e996363fd4b6f39049f059a6ee97a2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Remove conditionnal REMOVE_SYSTEMD_EVENT 51/19651/1
Jose Bollo [Wed, 16 Jan 2019 16:23:40 +0000 (17:23 +0100)]
jobs: Remove conditionnal REMOVE_SYSTEMD_EVENT

The removal of the systemd event loop will be made
in later changes.

Change-Id: Ia6c52feb4969f360c31cbfc50ae991f1767f007d
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agojobs: Separate internal threads from others 49/19649/1
José Bollo [Wed, 16 Jan 2019 10:57:38 +0000 (11:57 +0100)]
jobs: Separate internal threads from others

Foreign threads, that are not started by jobs,
are allowed to use synchronous jobs_call/job_leave
(directly or indirectly).

This commit ensure that those foreign thread will
neither acquire the eventloop nor execute jobs.

Includes a tiny cleanup of remain usage.

Bug-AGL: SPEC-2089

Change-Id: I2ad7fcfe2c276e34bdc4ec0c2aa3a4207bea1854
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agojobs: Refactor event loop handling 27/19527/2
José Bollo [Sun, 6 Jan 2019 09:34:12 +0000 (10:34 +0100)]
jobs: Refactor event loop handling

This improves the arbitration of the single event
loop across threads.

Before introduction of using 'evenfd' there was
several event loop. At the current time, there
is only one. At the end, there will probably
remain only one.

Bug-AGL: SPEC-2089

Change-Id: Iac9db7cbe15b4c9c76e6e9a8f6e641ed2a9039e0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-proto-ws: Serialize incoming message 23/19523/2
José Bollo [Sat, 5 Jan 2019 20:08:33 +0000 (21:08 +0100)]
afb-proto-ws: Serialize incoming message

Enforce serialisation for a connection

Bug-AGL: SPEC-2089

Change-Id: Id9f261b7cc02fda78922dc511856c34b7c5bf56d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agopackaging: update dependency on libmicrohttpd version 25/19625/3
Ronan Le Martret [Wed, 16 Jan 2019 08:29:53 +0000 (09:29 +0100)]
packaging: update dependency on libmicrohttpd version

app-framework-binder dependency on libmicrohttpd version
has been set at least to 0.9.62

Change-Id: If6af70611a5cd6236068781437e4bcbd28f368b7
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
5 years agoMerge "afb-api-v3: Fix potential buffer overflow"
Stéphane Desneux [Sat, 5 Jan 2019 22:38:33 +0000 (22:38 +0000)]
Merge "afb-api-v3: Fix potential buffer overflow"

5 years agoafb-api-v3: Fix potential buffer overflow 71/19471/1
Jose Bollo [Fri, 4 Jan 2019 13:30:04 +0000 (14:30 +0100)]
afb-api-v3: Fix potential buffer overflow

Change-Id: I170e127ebf96d2accfdd6d6a4ec322afeaa2782f
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-binding-v3: Fix issues in includes 69/19469/1
José Bollo [Wed, 2 Jan 2019 19:01:44 +0000 (20:01 +0100)]
afb-binding-v3: Fix issues in includes

Fix 1: afb_api_v3_verbose doesn't exist

Fix 2: afb_api_vverbose isn't declared

Fix 3: Ensure implicit cast of "api" and "req"

  Using presupposed knowledge of internals of afb_api_t
  and afb_req_t is bad when dealing with implicit
  conversion in C++ and is generally not the way to
  go.

Change-Id: I2630faa5ea0ae315ca95e4fd6ed6ae1a0beb01a5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agopackaging: Remove hard dependency to samples 35/19435/1
Jose Bollo [Thu, 3 Jan 2019 12:53:16 +0000 (13:53 +0100)]
packaging: Remove hard dependency to samples

Fixing names and number of samples in packaging
could be avoided.

Change-Id: I57355e68be45e1a4fdd6d76bcd44dea57ca63813
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agohello3: Add verb 'after' 03/19403/2
Jose Bollo [Mon, 31 Dec 2018 10:15:19 +0000 (11:15 +0100)]
hello3: Add verb 'after'

The verb 'after' launches a new thread
that after a delay will call a verb (like
call). The type of call can be set to 'call',
'callsync', 'subcall' or 'subcallsync'.

This allows to add test for asynchronous issues
in multithreaded environment.

Change-Id: Ic59a27b7b7fbd3716d34fdaa35c42aa9ecb7f201
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agobindings/samples: Cleanup and tiny comment 01/19401/2
Jose Bollo [Mon, 31 Dec 2018 08:59:16 +0000 (09:59 +0100)]
bindings/samples: Cleanup and tiny comment

The count of samples was too large and with
duplications. Hopefuly, removing duplications
and adding a tiny README file lowers fuzzy.

Change-Id: I55ed8f40a4f1e6e28e2a36f2819e25505246ecdd
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agojobs: Fix a lock of call sync 95/19395/4
Jose Bollo [Mon, 31 Dec 2018 08:33:01 +0000 (09:33 +0100)]
jobs: Fix a lock of call sync

Sometime the function jobs_leave missed to
wake up the process that expected the result.
It happened when that waiting thread was locked
in the epoll. That commit unlock it.

Bug-AGL: SPEC-2089

Change-Id: I6ab6a60a8c9ea3639143f282f90c7b77ed16853a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
5 years agoRemove useless %lang% prefix in yaml book file 65/19165/1 6.99.3 guppy/6.99.3 guppy_6.99.3
Sebastien Douheret [Wed, 19 Dec 2018 22:19:32 +0000 (23:19 +0100)]
Remove useless %lang% prefix in yaml book file

Change-Id: I25c5efebc281f774324851372d2d074e31988847
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
5 years agowrap-json: Upgrade to latest version 27/18927/1
José Bollo [Fri, 14 Dec 2018 17:37:14 +0000 (18:37 +0100)]
wrap-json: Upgrade to latest version

Change-Id: I3eb4e922cb5106bcf8a1ccc5e1b010bd0a60bf34
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-hsrv: Prepare selection of listening interfaces 47/18747/2
Jose Bollo [Tue, 30 Oct 2018 13:31:33 +0000 (14:31 +0100)]
afb-hsrv: Prepare selection of listening interfaces

The listening socket will no more be the default one
but will be the selected ones, with ability to select
more than just one listening interface.

Nevertheless, the behavior is not changed at the moment.
The default interface (0.0.0.0) is still used. A further
change will add the ability to select the listening
interfaces.

That evolution depends on a fix of libmicrohttpd to
enable at the same time epoll and no-listen-fd.

Bug-AGL: SPEC-1833
Bug-AGL: SPEC-1016

Change-Id: Ia78671cbee90a243ba7b2c724b6155cffbde6920
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoafb-trace: Make real timestamps 45/18745/2
José Bollo [Wed, 12 Dec 2018 16:13:14 +0000 (17:13 +0100)]
afb-trace: Make real timestamps

The optimisation that represent the timestamp as
a fake double is not accurate in local context.

Bug-AGL: SPEC-2051

Change-Id: I285837251507a69ad210823020d0cf69ad5999f3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agodocs: add yaml book 35/18735/2
Clément Bénier [Wed, 12 Dec 2018 08:40:02 +0000 (09:40 +0100)]
docs: add yaml book

SPEC-1988

Change-Id: Ida94e5cf39b8c23efca9620d62ec2db55746d2b3
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
5 years agoafb-proto-ws: Add error report 85/18585/1
Jose Bollo [Mon, 3 Dec 2018 14:16:30 +0000 (15:16 +0100)]
afb-proto-ws: Add error report

Change-Id: I58c88f8bcaf4cfb8a53b58eeefd7fa3415bf894a
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
5 years agoafb-hook: Improve reentrancy of hooking 83/18583/1
José Bollo [Tue, 4 Dec 2018 11:05:01 +0000 (12:05 +0100)]
afb-hook: Improve reentrancy of hooking

Work on testing showed that a deadlock
was occuring in management of hooks.

Change-Id: Ib51eb4f0b9ffc5d9dfe2770f2c3f8f47f262b60f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
5 years agoFix deprecation warnings for older GCC versions 77/18377/1 6.99.2 guppy/6.99.2 guppy_6.99.2
Johann CAHIER [Wed, 28 Nov 2018 14:29:45 +0000 (15:29 +0100)]
Fix deprecation warnings for older GCC versions

For some reason, SDK doesn't display warning when AFB_BINDING_VERSION
is defined as 2.
Using #warning instead of #pragma GCC warning fixes the display.

Change-Id: I3c96b3630e0d1eac63b2fde72bdec3c7f3d1714a
Signed-off-by: Johann CAHIER <johann.cahier@iot.bzh>
5 years agoglobset: Introduce globset for event handling 73/18173/1 6.99.1 guppy/6.99.1 guppy_6.99.1
Jose Bollo [Thu, 22 Nov 2018 08:03:33 +0000 (09:03 +0100)]
globset: Introduce globset for event handling

It optimises the event handling that was slow.

It also fix few bugs:
 - at most one event handler is called now
 - the handler call has the most specific pattern

Change-Id: Ic13a0258b5743579ab15e0e953ec62206d982850
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>