src/app-framework-binder.git
6 years agoafb-hsrv: remove dependency to systemd 19/14319/1
José Bollo [Fri, 23 Mar 2018 10:41:48 +0000 (11:41 +0100)]
afb-hsrv: remove dependency to systemd

Change-Id: I42428e7e57cb104b8575b60b1c7985782e9f779f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMake DBUS transparency optional (off by default) 17/14317/1
José Bollo [Fri, 23 Mar 2018 10:16:32 +0000 (11:16 +0100)]
Make DBUS transparency optional (off by default)

The implementation of API transparency through
DBUS is not used at the moment.

To improve independancy to systemd (it relies on
systemd library) removing it should be possible.

Change-Id: I5750a92527dc3e9cf7dcd27625dce6a020797a3d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hswitch: Improve HTTP scanning of API/VERB 15/14315/1
José Bollo [Wed, 21 Mar 2018 08:40:41 +0000 (09:40 +0100)]
afb-hswitch: Improve HTTP scanning of API/VERB

The previous version wasn't accepting verbs containing
slashes (/) but the websocket did.

Some interesting use-cases are allowed by accepting to
include slashes in verbs.

Change-Id: I2786b5ed0e2686c3e68bb9b74923064d8953243c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Fix typo 13/14313/1
José Bollo [Wed, 21 Mar 2018 13:55:24 +0000 (14:55 +0100)]
afs-supervisor: Fix typo

Change-Id: Icc3c15f577f04117cdfaf2bcbcc4d15a99d02138
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoConvert pc.in from UTF-8 to US-ASCII 65/13865/2
Ronan Le Martret [Fri, 4 May 2018 16:42:26 +0000 (18:42 +0200)]
Convert pc.in from UTF-8 to US-ASCII

Change-Id: I14fd54002c6df3b3e566a9f5a61bc89b595f4e3d
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agoCMakeLists: Fix c++ build 57/13857/3
Ronan Le Martret [Thu, 3 May 2018 14:50:55 +0000 (16:50 +0200)]
CMakeLists: Fix c++ build

On debian, for example, we need to specify C14 compatibility

Change-Id: I4fd4d6dbca03d085def61e373617ab5336ebcb0b
Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agofdev: Improve readability
José Bollo [Fri, 16 Mar 2018 10:37:01 +0000 (11:37 +0100)]
fdev: Improve readability

Change-Id: If81cdf43703b6ff3128ea79940ce240f56918b9d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix a double free
José Bollo [Thu, 15 Mar 2018 14:34:59 +0000 (15:34 +0100)]
afb-websock: Fix a double free

The commit 0ebdff94d461abd4328cf45a6281c15139a045eb of
libmicrohttpd fixed a bug but introduced a double free
of hreq resource attached to the connection. That commit
is between versions 0.9.59 and 0.9.60 of libmicrohttpd.

Now, hreq is freed in 'end_handler' of afb-hsrv.c

Change-Id: Ia865d65c5f9ef5ce787eb6545802ac8ea37ae468
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-websock: Fix double close
José Bollo [Fri, 16 Mar 2018 10:39:07 +0000 (11:39 +0100)]
afb-websock: Fix double close

Integration with newer versions of libmicrohttpd
was closing two times the file descriptor:
 - one time by the websocket within afb
 - one time by the upgrade close of libmicrohttpd

Thanks to 'autoclose' feature of 'fdev', the solution
is quiet easily.

Bug-AGL: SPEC-1345

Change-Id: Ifb691b3f69c095b5ff44bfd7f7267ea24d52df6d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate date of copyright notices
José Bollo [Tue, 27 Feb 2018 13:52:35 +0000 (14:52 +0100)]
Update date of copyright notices

Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Enforce session check (for token)
José Bollo [Tue, 27 Feb 2018 08:13:59 +0000 (09:13 +0100)]
afs-supervisor: Enforce session check (for token)

Change-Id: I6fdc419923944183d12c9c931e90e276f3dc8ac6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Force reply
José Bollo [Tue, 27 Feb 2018 07:48:14 +0000 (08:48 +0100)]
afs-supervisor: Force reply

Change-Id: Iba3a80e327b4324c1bdb4f8a0e7b73021d6e4ad6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix typo
José Bollo [Tue, 27 Feb 2018 07:43:35 +0000 (08:43 +0100)]
afb-supervision: Fix typo

Change-Id: Iaff0340d64b02ee24f45caadd01d74314afabacd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Fix supervisor deafness
José Bollo [Mon, 26 Feb 2018 19:40:12 +0000 (20:40 +0100)]
afs-supervisor: Fix supervisor deafness

Change-Id: I68fc2799d1789cbcf5516539ab2af3ecd9b61e56
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add systemd service and config
José Bollo [Mon, 26 Feb 2018 17:57:24 +0000 (18:57 +0100)]
afs-supervisor: Add systemd service and config

Change-Id: I64bf8de01dbb8cf9581ed0be358d81fa84106520
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Remove dependency to systemd
José Bollo [Mon, 26 Feb 2018 17:56:47 +0000 (18:56 +0100)]
afs-supervisor: Remove dependency to systemd

Change-Id: I74b455f569f9bf1a6e6970163fb50a946875e42d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervisor: Make it a HTTP server
José Bollo [Mon, 26 Feb 2018 17:09:49 +0000 (18:09 +0100)]
supervisor: Make it a HTTP server

The supervisor now run as an HTTP server by default.

Change-Id: Ia0a654cd97c941f15b212c5364d739e2196662e4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix bugs
José Bollo [Mon, 26 Feb 2018 13:35:00 +0000 (14:35 +0100)]
afb-session: Fix bugs

Change-Id: Ib45e2db47827b4527435a40c4b79d02fb3ab488a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: cosmetic improvements
José Bollo [Mon, 26 Feb 2018 13:32:44 +0000 (14:32 +0100)]
afb-stub-ws: cosmetic improvements

Change-Id: Ib6adf0ca4bdfee9d3da07055430bfe1974ac28bc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Add traceses for tracing sessions
José Bollo [Mon, 26 Feb 2018 12:35:43 +0000 (13:35 +0100)]
afb-config: Add traceses for tracing sessions

Change-Id: I9d36eb9eb4991066f94b1340262ad27467fc591e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomemo-supervisor: added a memo for supervisor
José Bollo [Thu, 22 Feb 2018 15:33:28 +0000 (16:33 +0100)]
memo-supervisor: added a memo for supervisor

Change-Id: I2bf91ef9b1407d1a72eea3708782836c625ebdc0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-supervision: Fix error on 'trace'
José Bollo [Thu, 22 Feb 2018 13:55:24 +0000 (14:55 +0100)]
afb-supervision: Fix error on 'trace'

Change-Id: I81c89e6c9406df583087845d6b38a19fff8ab0eb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoxreq: export a function to get req
José Bollo [Thu, 22 Feb 2018 13:54:47 +0000 (14:54 +0100)]
xreq: export a function to get req

Change-Id: Ie7eac225f514349926341b7db61ea0eb9029c5d8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agofdev: Introduce fdev for file event handling
José Bollo [Thu, 22 Feb 2018 12:22:48 +0000 (13:22 +0100)]
fdev: Introduce fdev for file event handling

This is an effort to keep cutting dependency to systemd.

Change-Id: I9a0c032a1095e297c7f3ac5b67827fda3658b8d9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Integrate sd-fds features
José Bollo [Wed, 21 Feb 2018 15:07:56 +0000 (16:07 +0100)]
afb-systemd: Integrate sd-fds features

Change-Id: I59d194ba675912a42922f0905933b1cea796c78a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-systemd: Isolate systemd main entries
José Bollo [Wed, 21 Feb 2018 10:38:59 +0000 (11:38 +0100)]
afb-systemd: Isolate systemd main entries

This change prepares the possibilty to remove the dependency
to systemd/libsystemd.

Change-Id: Ife4181d6c7195230a11a32e527b8973af6a096e1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoBump version to 5.99-FFRC0
José Bollo [Wed, 21 Feb 2018 10:12:10 +0000 (11:12 +0100)]
Bump version to 5.99-FFRC0

Change-Id: I58829d86b871260538ce40d4be8480849d7f4b80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-monitor: Add session and rework permissions
José Bollo [Thu, 15 Feb 2018 16:17:37 +0000 (17:17 +0100)]
afb-monitor: Add session and rework permissions

The new verb session is available to get session info and
to renew the token. See examples below.

The permission required is now just to being check
meaning having the token.

Example:

afb-client-demo -H localhost:5555/api?token=456
monitor session
ON-REPLY 1:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"",
    "timeout":32000000,
    "remain":31999985
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938"
  }
}
monitor session {"refresh-token":true}
ON-REPLY 5:monitor/session: OK
{
  "response":{
    "uuid":"5a30c118-319c-43a2-82d5-fc2198d01938",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc",
    "timeout":32000000,
    "remain":32000000
  },
  "jtype":"afb-reply",
  "request":{
    "status":"success",
    "token":"2f60faf8-ad04-457e-9f56-5c0c20b5f1fc"
  }
}

Change-Id: Ic93bae80616e5dad1640e73ac9f472b7b385104f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Verbs for timeout and remining time
José Bollo [Thu, 15 Feb 2018 15:51:25 +0000 (16:51 +0100)]
afb-session: Verbs for timeout and remining time

Change-Id: Ia1922187aa78d8633835c4a77e8aa533fa5d5f7d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-context: Early token change
José Bollo [Thu, 15 Feb 2018 15:50:31 +0000 (16:50 +0100)]
afb-context: Early token change

Change-Id: If27d84a702513b92f08c97ef91bf8cf89b5af238
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Fully exclude config monitoring
José Bollo [Thu, 15 Feb 2018 15:41:54 +0000 (16:41 +0100)]
afb-config: Fully exclude config monitoring

Change-Id: I93b3d49f46d4dec607b08cc439b6cb06cf68ec32
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Increase the default timeout of sessions
José Bollo [Thu, 15 Feb 2018 15:54:47 +0000 (16:54 +0100)]
afb-config: Increase the default timeout of sessions

The management of sessions is not very well understood
actually. People are using it without refreshing the token.
This has the effect that the binder closes sessions
after one hour.

So no demo can run more than one hour!

Increasing the timeout to more than one year will
solve the demo problem but will not fully solve the
overall problem.

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: Icb9adb4939a138c19be36280bf1e6643d04489ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Use clock insensitive to time changes
José Bollo [Thu, 15 Feb 2018 15:23:54 +0000 (16:23 +0100)]
afb-session: Use clock insensitive to time changes

Bug-AGL: SPEC-1296
Bug-AGL: SPEC-1293

Change-Id: I1838175b48dff8fbf1fd65bd304f9cfe917ced80
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add verb for running discovery
José Bollo [Wed, 14 Feb 2018 14:18:34 +0000 (15:18 +0100)]
afs-supervisor: Add verb for running discovery

Change-Id: Iea9e54fa7a1c93ba3927c836d6ca5bcded77ca66
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Add discovery mechanic
José Bollo [Wed, 14 Feb 2018 14:12:30 +0000 (15:12 +0100)]
afs-supervisor: Add discovery mechanic

Change-Id: Icfcdcc16d0433454c9bb0785d0690f7f173980ae
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafs-supervisor: Improve name of supervisor api
José Bollo [Tue, 13 Feb 2018 11:18:49 +0000 (12:18 +0100)]
afs-supervisor: Improve name of supervisor api

Change-Id: Id0b43cecb91fa0a405c07f63d4f8c2f026c8a70c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add retrieval of config
José Bollo [Tue, 13 Feb 2018 10:51:14 +0000 (11:51 +0100)]
supervision: Add retrieval of config

Change-Id: Id7bb91c267037cbd36c6cafef62d3c39a67e77db
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: export config to json
José Bollo [Tue, 13 Feb 2018 10:49:02 +0000 (11:49 +0100)]
afb-config: export config to json

Change-Id: I8918733753ec791e77eb8a71032ccdb35fa68d71
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosupervision: Add supervision and supervisor
José Bollo [Thu, 29 Jun 2017 20:09:47 +0000 (22:09 +0200)]
supervision: Add supervision and supervisor

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix segfault on diconection
José Bollo [Tue, 13 Feb 2018 09:26:26 +0000 (10:26 +0100)]
afb-stub-ws: Fix segfault on diconection

Change-Id: I7826b86e4d4cc921b2daaca5c8dda0fd27faae10
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Protect against self-destruction
José Bollo [Mon, 12 Feb 2018 17:03:38 +0000 (18:03 +0100)]
afb-stub-ws: Protect against self-destruction

Change-Id: I43b15b8f675173a693816a0b8efd05fd024278f0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Add tracing of sessions
José Bollo [Mon, 12 Feb 2018 14:57:55 +0000 (15:57 +0100)]
afb-trace: Add tracing of sessions

Change-Id: Ieba4032bed526ca158dc69558177a038df95988b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Add function to enumerate sessions
José Bollo [Mon, 12 Feb 2018 13:27:46 +0000 (14:27 +0100)]
afb-session: Add function to enumerate sessions

Change-Id: Ifaa1aa02d0562c40763ac03b7c05df7f9f9c8127
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agotest-session: Add check of hooking
José Bollo [Mon, 12 Feb 2018 09:27:59 +0000 (10:27 +0100)]
test-session: Add check of hooking

Change-Id: I3ac86b41537651e360e7ea21ad425f2e1bffb852
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Insert call to hooking
José Bollo [Mon, 12 Feb 2018 08:12:47 +0000 (09:12 +0100)]
afb-session: Insert call to hooking

Change-Id: I7d91b133761c7c751300bf1344321e295cce1bc3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Add hooks for session
José Bollo [Wed, 7 Feb 2018 16:45:37 +0000 (17:45 +0100)]
afb-hook: Add hooks for session

Change-Id: I4fbd6bf57958abb366a742b12afb92bfc03ad299

6 years agoafb-session: Refactor and test unit
José Bollo [Wed, 7 Feb 2018 16:44:20 +0000 (17:44 +0100)]
afb-session: Refactor and test unit

The session are refactored and now to include a test unit.

Change-Id: Ia8c4b707191f3af95c0549b333d14b384a81eaa7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Fix a session leak bug
José Bollo [Wed, 7 Feb 2018 11:38:20 +0000 (12:38 +0100)]
afb-stub-ws: Fix a session leak bug

Change-Id: I55b72d7a4e7ca18e61addb3b0efa2ec75729060b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Improve doc of option --token
José Bollo [Wed, 7 Feb 2018 10:30:08 +0000 (11:30 +0100)]
afb-config: Improve doc of option --token

Change-Id: I196c7f2b216e031f52b208e19c6c2df8593d27c5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomain: Isolate HTTP initialization
José Bollo [Wed, 7 Feb 2018 10:27:52 +0000 (11:27 +0100)]
main: Isolate HTTP initialization

Initializations linked to HTTP are deferred
until starting the HTTP server.

Change-Id: I917c4c5db3c3ae894ee60fd16b9e09d4185fcdb4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Return an initialization status
José Bollo [Wed, 7 Feb 2018 10:25:37 +0000 (11:25 +0100)]
afb-session: Return an initialization status

Avoid exiting anywhere

Change-Id: Ic24a2c7435645632d609fb16849d33b204062397
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: Fix a typo
José Bollo [Wed, 7 Feb 2018 08:31:29 +0000 (09:31 +0100)]
afb-session: Fix a typo

Change-Id: Ia834cfd203ab1471efa21ce650fcd7895370dc63
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Add argument to start
José Bollo [Tue, 6 Feb 2018 15:19:17 +0000 (16:19 +0100)]
jobs: Add argument to start

Change-Id: I89a75a036c60097fb898ab8723007ca6ebfc7f39
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-xreq: Export afb_request facilities
José Bollo [Tue, 6 Feb 2018 10:29:32 +0000 (11:29 +0100)]
afb-xreq: Export afb_request facilities

Internally, the binder can need to convert
afb_request to xreq and conversely.
Exporting this facilities is good.

Change-Id: I5bb01d701eee0ac30ad6ce490609f6124a9d5860
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-trace: Replace daemon by api name
José Bollo [Wed, 31 Jan 2018 16:16:18 +0000 (17:16 +0100)]
afb-trace: Replace daemon by api name

This replacement greatly improves the code.

Change-Id: If3fd6e6080eda2268ccf551998f99af01799be29
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-evt: Add event creation with prefix
José Bollo [Wed, 31 Jan 2018 16:15:27 +0000 (17:15 +0100)]
afb-evt: Add event creation with prefix

Change-Id: I2fd35e8ed59c28f4283be698a2586cdae5f7c8cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api: Enforce api names to be hookable
José Bollo [Wed, 31 Jan 2018 13:52:08 +0000 (14:52 +0100)]
afb-api: Enforce api names to be hookable

Change-Id: Ic1d5cb208c636d3261e1a96c4a81b488cb84a60e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hook: Allow to unhook some apis
José Bollo [Fri, 11 Aug 2017 15:00:08 +0000 (17:00 +0200)]
afb-hook: Allow to unhook some apis

The apis starting with a $ (dollar) will not be
tracked by hooks

Change-Id: I3b83458c288ef1eb27993d4c71785b32e5a72deb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Integrate systemd watchdog by default
José Bollo [Thu, 18 Jan 2018 10:17:25 +0000 (11:17 +0100)]
jobs: Integrate systemd watchdog by default

Change-Id: Iaa3ce3ee9188e3ddaf6ee70964963d29df78689f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Split jobs_get_sd_event
José Bollo [Thu, 18 Jan 2018 10:16:57 +0000 (11:16 +0100)]
jobs: Split jobs_get_sd_event

Provide a mutex locked internal function for getting
the event loop: get_sd_event_locked

Change-Id: I2635f901b3ec0fcf2c52f569f4c57cfd046601af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-common: Cleanup
José Bollo [Thu, 18 Jan 2018 09:50:41 +0000 (10:50 +0100)]
afb-common: Cleanup

Change-Id: Ifc5adbdc92c3d034c92dd432c72057f3267c4964
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Dichotomic mimetype search
José Bollo [Thu, 18 Jan 2018 09:44:24 +0000 (10:44 +0100)]
afb-hreq: Dichotomic mimetype search

Change-Id: I6d906c31cdcf07c5404f1eb81cd44683976465f7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Sort mimetypes
José Bollo [Thu, 18 Jan 2018 09:16:13 +0000 (10:16 +0100)]
afb-hreq: Sort mimetypes

Change-Id: I45ae5a702b83dabe081b625b4bcaf5de33ffa1e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Add json to known mimetypes
Loïc Collignon [Thu, 30 Nov 2017 10:47:15 +0000 (11:47 +0100)]
afb-hreq: Add json to known mimetypes

Change-Id: Ic11ebf7e569160dd25e66a1273904dfcd82bdeb8
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
6 years agoafb-client-demo: Fix memory leak
José Bollo [Fri, 5 Jan 2018 16:02:19 +0000 (17:02 +0100)]
afb-client-demo: Fix memory leak

Change-Id: I636b95459715f3b272509eb76e304a49593fb527
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-so: Exclude directories starting with .
José Bollo [Fri, 5 Jan 2018 15:33:20 +0000 (16:33 +0100)]
afb-api-so: Exclude directories starting with .

Exclude from the search of bindings any
directory starting with a dot (.) by default.

It is possible to reactivate the prvious behaviour
by defining the following preprocessor variables

 - AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS

   When this variable is defined, the directories
   starting with a dot are searched except
   if their name is "." or ".." or ".debug"

 - AFB_API_SO_ACCEPT_DOT_DEBUG_DIRS

   When this variable is defined and the variable
   AFB_API_SO_ACCEPT_DOT_PREFIXED_DIRS is also defined
   scans any directory not being "." or "..".

The previous behaviour was like difining the 2 variables,
meaning that only . and .. were excluded from the search.

This change is intended to definitely solve the issue
SPEC-662. Yocto installed the debugging symbols in the
subdirectory .debug. For example the binding.so also
had a .debug/binding.so file attached. Opening that
debug file made dlopen crashing.
See https://sourceware.org/bugzilla/show_bug.cgi?id=22101

Bug-AGL: SPEC-662

Change-Id: Ic38a83aaa5f16d938e504aba66597bb9a219c193
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-binding.hpp: Fix constexpr of 'binding'
José Bollo [Tue, 2 Jan 2018 12:28:42 +0000 (13:28 +0100)]
afb-binding.hpp: Fix constexpr of 'binding'

Change-Id: Icdee4029f11dcb6c0f75e945e0b411ea63654afe
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenskel: Add afb:: namespace prefix
José Bollo [Thu, 21 Dec 2017 15:56:31 +0000 (16:56 +0100)]
genskel: Add afb:: namespace prefix

Change-Id: I0cd2d09f97fac7a1976d2bfcd5ab616472bf970a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agogenskel: Add option for C++ output
José Bollo [Thu, 21 Dec 2017 13:26:57 +0000 (14:26 +0100)]
genskel: Add option for C++ output

The option --cpp or -x tell to produce a C++ output
that uses the 'constexpr' c++ feature.

Change-Id: I4eda4d21260573acbb01057ed95476bd4fc7ebe5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosig-monitor: Handle signals in exit
José Bollo [Thu, 21 Dec 2017 11:36:16 +0000 (12:36 +0100)]
sig-monitor: Handle signals in exit

Change signal treatment when exit is called
internally by sig-monitor.

Change-Id: Ieb6261b2143811d7abcbc49b134e919c8c5626dc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agosig-monitor: Make signal list global
José Bollo [Thu, 21 Dec 2017 11:33:32 +0000 (12:33 +0100)]
sig-monitor: Make signal list global

Change-Id: I456a08dccf65d1a188e7bb7e0a6ab905ae823a25
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-hreq: Add predefined mime-types
José Bollo [Mon, 18 Dec 2017 13:24:34 +0000 (14:24 +0100)]
afb-hreq: Add predefined mime-types

Add mimetypes for common extensions for conformance to
https://www.w3.org/TR/widgets/#rule-for-identifying-the-media-type-of-a-file

Change-Id: I3ae51afbbc2916b7237e4fa546392ec7ec5ea42a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-ws: Make weak ws-client by default (to be fixed)
José Bollo [Tue, 5 Dec 2017 16:29:24 +0000 (17:29 +0100)]
afb-api-ws: Make weak ws-client by default (to be fixed)

The case of unicens service that can be here or not creates
problem to the binding 4a when the service is not here.
This commits makes the requirement of ws-client
socket optional. This unblocks the situation but need to
be fixed later.

Bug-AGL: SPEC-1151

Change-Id: I569fa781c003492a4c6a7ad84c5b140ecdb05b65
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRemove unused and confusing files
José Bollo [Mon, 4 Dec 2017 16:19:12 +0000 (17:19 +0100)]
Remove unused and confusing files

Change-Id: I8362d8d7bf0f11a41ef2275614e9ef2bcf0fee29
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Fix locks in event loops
José Bollo [Fri, 1 Dec 2017 11:32:07 +0000 (12:32 +0100)]
jobs: Fix locks in event loops

Change-Id: Ie07a9bc4f930a0ecd2102a94e7f5f7b0daa705ef
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Fix possible race condition
José Bollo [Thu, 30 Nov 2017 06:17:31 +0000 (07:17 +0100)]
jobs: Fix possible race condition

Sending the signal while not being sure that is is
expected could be a race condition. Taking the mutex
avoids it.

In the same time, switch to broadcasting.

Change-Id: I3f43d0d860cccc61ec140ceef223f572f806872c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-config: Check environment variables
José Bollo [Wed, 29 Nov 2017 17:13:58 +0000 (18:13 +0100)]
afb-config: Check environment variables

The following environment variables allows several
setting by the environment:

 * AFB_TRACEREQ, AFB_TRACEDITF, AFB_TRACESVC, AFB_TRACEEVT

    These variables allows setting of options --tracereq,
    --traceditf, --tracesvc, --traceevt

 * AFB_LDPATHS

    Set the option --ldpaths

Change-Id: I22700c658ce3fa1ceb15eab8f67adaaf41627b8f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: rewrite of the event loop handling
José Bollo [Wed, 29 Nov 2017 17:02:23 +0000 (18:02 +0100)]
jobs: rewrite of the event loop handling

This new version use an eventfd to unlock the
event loop when needed. This reduce the count
of sd_event needed.

Bug-AGL: SPEC-1091

Change-Id: I9bc273e89ab1a70ccc2187c2571e68c9c771ee25
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-ws & websocket: Fix writing very long data
José Bollo [Tue, 28 Nov 2017 10:13:27 +0000 (11:13 +0100)]
afb-ws & websocket: Fix writing very long data

This version loops to write very long data on
websockets.

Bug-AGL: SPEC-1091

Change-Id: I8f17e75e4ef483be29fa8cae2c0af159783ec2c6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCMAKE: refactor options 4.99.3 eel/4.99.3 eel_4.99.3
José Bollo [Mon, 20 Nov 2017 14:22:40 +0000 (15:22 +0100)]
CMAKE: refactor options

The option ALLOW_NO_BINDER is removed and the option
ONLY_DEVTOOLS is introduced.

Change-Id: Ia19eb977ee25a3871582605028fdef75e552363f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoMerge "Fix build for native package"
José Bollo [Mon, 20 Nov 2017 14:00:08 +0000 (14:00 +0000)]
Merge "Fix build for native package"

6 years agoFix build for native package 51/12051/1
Ronan Le Martret [Mon, 20 Nov 2017 13:31:46 +0000 (14:31 +0100)]
Fix build for native package

 * If the package is natively compile, the gcc used is the
   host gcc, and host gcc version must be >4.9. This is unneeded
   for the mode ALLOW_NO_BINDER (like in native).

Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
6 years agofix build error
José Bollo [Fri, 17 Nov 2017 17:02:50 +0000 (18:02 +0100)]
fix build error

Change-Id: I6ff16055597d36290f50b40d6dfe960aea691652
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: Fix autolock in proto-ws
José Bollo [Fri, 17 Nov 2017 15:51:02 +0000 (16:51 +0100)]
afb-proto-ws: Fix autolock in proto-ws

Because a systemd event loop can not be reentered
while evaluating an event callback, the event loop
was removed from the threads. It had the effect to
enter in deadlock when calling a synchronous call
while in an event callback.

Queueing a job solves the issue.

But because using queued job has implications on
libafbws, a fake job manager is added for libafbws.

Change-Id: Id793bea55743790082eaab48cd4cc87f7993772a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoCMAKE: allow to compile afb-genskel only
José Bollo [Fri, 17 Nov 2017 10:10:43 +0000 (11:10 +0100)]
CMAKE: allow to compile afb-genskel only

When missing components are detected, allows to not compile
the binder if ALLOW_NO_BINDER is ON

Change-Id: I0fb27844e3f36d4dd643bdf250f05b4f6769bc53
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-export: Ensure monitoring of events
José Bollo [Mon, 13 Nov 2017 14:07:04 +0000 (15:07 +0100)]
afb-export: Ensure monitoring of events

Change-Id: Id82c624f695a229023447c16652bcc912b6d6fed
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agomonitoring: Set default token to HELLO
José Bollo [Sat, 11 Nov 2017 23:56:17 +0000 (00:56 +0100)]
monitoring: Set default token to HELLO

Change-Id: I3c158598da70089b9646233c632f14f62f1baa15
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-proto-ws: fix self locking issue
José Bollo [Sat, 11 Nov 2017 21:36:05 +0000 (22:36 +0100)]
afb-proto-ws: fix self locking issue

Calling synchronously a verb on an event of the same
API was blocking.

Change-Id: I58a988c6df8c60cd3a38c3cdff23d7be8b6be54e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-stub-ws: autoclose session on disconnection
José Bollo [Tue, 7 Nov 2017 18:25:44 +0000 (19:25 +0100)]
afb-stub-ws: autoclose session on disconnection

Change-Id: If46ca2fa34a080b7087edb4e0da109c5ee85b14f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-stub-ws: manage closed sessions
José Bollo [Tue, 7 Nov 2017 18:25:15 +0000 (19:25 +0100)]
afb-stub-ws: manage closed sessions

Change-Id: I16620f12719c222c0da03caf330a865149fe9051
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: improve naming
José Bollo [Tue, 7 Nov 2017 16:21:37 +0000 (17:21 +0100)]
afb-session: improve naming

Change-Id: I6692f9089be355995d5caf979f4344ed3b8337a7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-stub-ws: Track sessions for releasing it
José Bollo [Tue, 7 Nov 2017 12:54:23 +0000 (13:54 +0100)]
afb-stub-ws: Track sessions for releasing it

Change-Id: If0ff0f491e0fd8267137aa742d7acbe0157f88ad
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: Improve readability
José Bollo [Mon, 6 Nov 2017 22:25:10 +0000 (23:25 +0100)]
afb-session: Improve readability

Change-Id: I4035a59d125e0768b0366c3dc5e7509e416ab9c6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: fix reference counting
José Bollo [Mon, 6 Nov 2017 22:01:42 +0000 (23:01 +0100)]
afb-session: fix reference counting

Change-Id: If36c9210f0982ba35299de52f0c8fd96e7c836e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: optimization
José Bollo [Mon, 6 Nov 2017 21:42:23 +0000 (22:42 +0100)]
afb-session: optimization

Change-Id: Ic3b0ec8e7bcbf21f7ae3a9f2b1a5719118a7912d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: add comments
José Bollo [Mon, 6 Nov 2017 17:01:58 +0000 (18:01 +0100)]
afb-session: add comments

Change-Id: I88026384d3f5e98659fba2bb774e41e931d45f51
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: remove unused access time
José Bollo [Mon, 6 Nov 2017 14:33:21 +0000 (15:33 +0100)]
afb-session: remove unused access time

Change-Id: I1e8ca2adfec5bf7df5a7da02e6d093ae099ec9a3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: Add timeout features for sessions
José Bollo [Mon, 6 Nov 2017 14:31:34 +0000 (15:31 +0100)]
afb-session: Add timeout features for sessions

Change-Id: I0aa8a82c0bbf709aa380ef7e5efe2e4ebaf454c0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-session: add function afb_session_search
José Bollo [Mon, 6 Nov 2017 14:05:45 +0000 (15:05 +0100)]
afb-session: add function afb_session_search

Also the function afb_session_get always create
a session even if 'created' is NULL

Change-Id: Ia5ac1231e1d61e92cb9bbc07c968e3000d6864ff
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-trace: improve and simplify session management
José Bollo [Mon, 6 Nov 2017 13:28:49 +0000 (14:28 +0100)]
afb-trace: improve and simplify session management

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