src/app-framework-binder.git
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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoafb-session: improves comments and names
José Bollo [Mon, 6 Nov 2017 12:11:49 +0000 (13:11 +0100)]
afb-session: improves comments and names

Change-Id: I05850b05dc6747563ef38800821bfcaf5c45b5d0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: redefine the function 'afb_session_create'
José Bollo [Mon, 6 Nov 2017 12:10:55 +0000 (13:10 +0100)]
afb-session: redefine the function 'afb_session_create'

Change-Id: Ib8a66af30ea2438248adb66c9a95ac82663ec223
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAFB.js: make HELLO the default token
José Bollo [Mon, 6 Nov 2017 12:07:34 +0000 (13:07 +0100)]
AFB.js: make HELLO the default token

Change-Id: I76ae307672e1268b9cc4a9194e61f884a3f7455b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-session: rewrite of cookie handling
José Bollo [Mon, 6 Nov 2017 09:42:44 +0000 (10:42 +0100)]
afb-session: rewrite of cookie handling

Change-Id: I9852c1e2a211f79f25c7f32e9ac93acf7c5e6968
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd 'noconcurrency' when creating dynamic API 4.99.2 eel/4.99.2 eel_4.99.2
José Bollo [Fri, 3 Nov 2017 12:58:33 +0000 (13:58 +0100)]
Add 'noconcurrency' when creating dynamic API

Change-Id: Ia108b23b9480bb32f27127ef00c18086fcf86752
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: Fix unclosed file descriptor
José Bollo [Fri, 3 Nov 2017 12:26:49 +0000 (13:26 +0100)]
afb-proto-ws: Fix unclosed file descriptor

Change-Id: I3c831b4f803e283fc692fef66621a798a5e9296e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agojobs: Improve event loop integration
José Bollo [Fri, 3 Nov 2017 12:04:30 +0000 (13:04 +0100)]
jobs: Improve event loop integration

The previous implmentation was buggy.

This changes make the event loop a thread global
variable. A thread now refuses to run an event loop
if it is in dispatching state.

Change-Id: Ic29792b87c1cae201958feb96d93678f6d37ac8d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoverbose: Ensure mutual exclusion when logging
José Bollo [Wed, 1 Nov 2017 12:32:44 +0000 (13:32 +0100)]
verbose: Ensure mutual exclusion when logging

Change-Id: I3ccc2ba35ee8db3d62eb229c736e65b2305184e3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agomonitoring: Improve readability of pastel style
José Bollo [Thu, 26 Oct 2017 10:14:07 +0000 (12:14 +0200)]
monitoring: Improve readability of pastel style

Change-Id: Ic2e8963ad9754b349064e535ed17fc768c0d8063
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAFB.js: Allows use of client's callIDs
José Bollo [Thu, 26 Oct 2017 10:13:21 +0000 (12:13 +0200)]
AFB.js: Allows use of client's callIDs

Change-Id: I4eaa768446abb875f9c030a58ff919b117c0bfe5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowebsocket: Add function that explain error codes
José Bollo [Mon, 23 Oct 2017 12:12:08 +0000 (14:12 +0200)]
websocket: Add function that explain error codes

Change-Id: I500520edac6792013650fa3cb0e02d0b9f5610d5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowebsocket: cleanup
José Bollo [Mon, 23 Oct 2017 12:11:32 +0000 (14:11 +0200)]
websocket: cleanup

Change-Id: I772e441f1b93131df670ef3fbef3a37e2a2c00f1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agowebsocket: Tune maximum received length
José Bollo [Mon, 23 Oct 2017 12:11:04 +0000 (14:11 +0200)]
websocket: Tune maximum received length

This commit increase the count of data that
is accepted by default from 65,000 to 1,048,500.

It also offers new functions to tune that value.

Change-Id: Iecf0b8c308e8287582819a8769859c39e46919c2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-dyn: Uniform return 0 on success
José Bollo [Mon, 16 Oct 2017 19:24:07 +0000 (21:24 +0200)]
afb-api-dyn: Uniform return 0 on success

Change-Id: I6ca079fa84547928f999e07d1925202a1e14850f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-api-so: improve error messages
José Bollo [Mon, 16 Oct 2017 14:53:26 +0000 (16:53 +0200)]
afb-api-so: improve error messages

Change-Id: I3bbf11890800a8b05c9cfaa8bd10b50a0b22c245
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-stub-ws: Always validate clients of stub-ws
José Bollo [Thu, 12 Oct 2017 20:59:09 +0000 (22:59 +0200)]
afb-stub-ws: Always validate clients of stub-ws

Change-Id: I2c020d586e6f22e47dac8ddb50c8ee9ca9c46b2e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agolibafbwsc: add function 'afb_ws_client_connect_api'
José Bollo [Wed, 11 Oct 2017 11:12:57 +0000 (13:12 +0200)]
libafbwsc: add function 'afb_ws_client_connect_api'

This function allows to connect to an API exported by the
binder.

The demo program afb-client-demo is modified to integrate
on option that direct API connection.

Example:
 server: afb-daemon --ws-server unix:hello
 client: afb-client-demo -d -H unix:hello

Change-Id: Id9f857a453c406df1c4b36eb25fb5e833a938c3d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoafb-proto-ws: remove dependencies
José Bollo [Wed, 11 Oct 2017 11:11:06 +0000 (13:11 +0200)]
afb-proto-ws: remove dependencies

Remove dependencies to verbose and to afb-common.

Change-Id: I140f2cd7c159e9be994ab7b786a164d605d1b1dc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate documentation for afb_req_get_uid
José Bollo [Wed, 11 Oct 2017 08:26:07 +0000 (10:26 +0200)]
Update documentation for afb_req_get_uid

Change-Id: I984824b8ffc22783c1e6b63ee03ba23d5b7e2954
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoUpdate C++ interface for afb_req_get_uid
José Bollo [Wed, 11 Oct 2017 08:13:32 +0000 (10:13 +0200)]
Update C++ interface for afb_req_get_uid

Change-Id: I8c281417bd08b49ac708a7992cb46a074e74c979
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoAdd the function afb_req_get_uid
José Bollo [Tue, 10 Oct 2017 16:21:54 +0000 (18:21 +0200)]
Add the function afb_req_get_uid

Change-Id: I9caf38ee3811cf10b546489094f0bb5b3d844c40
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
6 years agoRemove explicit Debug build type
José Bollo [Tue, 10 Oct 2017 16:21:23 +0000 (18:21 +0200)]
Remove explicit Debug build type

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