src/app-framework-binder.git
7 years agoUse SIGHUP instead of SIGKILL
José Bollo [Tue, 4 Apr 2017 09:50:17 +0000 (11:50 +0200)]
Use SIGHUP instead of SIGKILL

This doesn't enforces anymore the brutal
termination.

Change-Id: I62445c7cb3692354637906fb1ddda1787c8fb82a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoLaunch job at a earlier step
José Bollo [Tue, 4 Apr 2017 09:49:15 +0000 (11:49 +0200)]
Launch job at a earlier step

Change-Id: I3fcb96e4d748e38eacc4d413a451143dd9b4a10d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoDefinitive switch to internal's xreq
José Bollo [Tue, 4 Apr 2017 08:10:13 +0000 (10:10 +0200)]
Definitive switch to internal's xreq

This switch allows to work on a common base for
the requests.

Change-Id: I94e7fdda80c1966af399309334c41c7c8c8259dc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMigrates subcalls to use xreq
José Bollo [Tue, 4 Apr 2017 07:51:28 +0000 (09:51 +0200)]
Migrates subcalls to use xreq

Change-Id: If865208bc0c207511d2b11e4cff617005ed01e56
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoIntroduce subcontext for subcalls
José Bollo [Tue, 4 Apr 2017 07:50:53 +0000 (09:50 +0200)]
Introduce subcontext for subcalls

Change-Id: I5460e9c502cee814c59a0ee60c2be001385e7b4a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoSwitch API D-Bus to xreq
José Bollo [Mon, 3 Apr 2017 15:35:32 +0000 (17:35 +0200)]
Switch API D-Bus to xreq

Change-Id: I16bfa2594f8de4babcc0d3cc1a62e7d0856d2479
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoSwitch API websocket to xreq
José Bollo [Mon, 3 Apr 2017 15:35:03 +0000 (17:35 +0200)]
Switch API websocket to xreq

Change-Id: I57600d8dc99bf37f207b126a0e3ab5731ad08ced
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImprove interface xreq
José Bollo [Mon, 3 Apr 2017 15:34:21 +0000 (17:34 +0200)]
Improve interface xreq

Add missing function for further work

Change-Id: I4e2b7a35b45ffb0edb1fd14b52500c9b00fab807
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd notification message for added API
José Bollo [Mon, 3 Apr 2017 15:33:35 +0000 (17:33 +0200)]
Add notification message for added API

Change-Id: I797afeaa0758f2fef854a1ffaee398aff6c9041e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRework the jobs
José Bollo [Mon, 3 Apr 2017 15:22:39 +0000 (17:22 +0200)]
Rework the jobs

Enforce starting jobs with acquiring the
calling thread.

Removes invoke methods in favour of
enter/leave synchronisation.

Change-Id: I7086f7f53b919b43ddafd2355316abc0d3516f49
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUse xreq for services
José Bollo [Fri, 31 Mar 2017 15:50:19 +0000 (17:50 +0200)]
Use xreq for services

Change-Id: I05d0ddb36635c01b3d56ae52a08fbb68f3b3a6a9
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUse xreq for websockets
José Bollo [Fri, 31 Mar 2017 14:58:14 +0000 (16:58 +0200)]
Use xreq for websockets

Change-Id: Ia489f863e8be3384fbe8a240f6010f7d5916b72a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoFactorize common code for handling requests
José Bollo [Fri, 31 Mar 2017 14:11:07 +0000 (16:11 +0200)]
Factorize common code for handling requests

The common code for session handling is
shared using struct afb_xreq. At the moment
only hreq leverages the new feature.

The objective is double: make the work of
writing new internal requests more easy and
prepare to check permissions.

Change-Id: If3ca311d68c2d8c427d1125f31a2704b150c2c94
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAllow detection of session closure
José Bollo [Fri, 31 Mar 2017 09:55:20 +0000 (11:55 +0200)]
Allow detection of session closure

In some case it can be good to have a function called
when the session closes. This is the case when a binding
records an item in the context. With this modification
the recorded item can be simply NULL.

Change-Id: I5e23f00eb2a6e2639fdeea15f9dea79c7df9dfbb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoStart to implement the bindings V2
José Bollo [Thu, 30 Mar 2017 17:02:06 +0000 (19:02 +0200)]
Start to implement the bindings V2

More work has to be done for merging common
code.

Change-Id: I72b01901f978854843967c12bfcb3cc59cc10310
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoOverall integration of job initialisation
José Bollo [Thu, 30 Mar 2017 12:22:03 +0000 (14:22 +0200)]
Overall integration of job initialisation

Move the job initialisation from main to jobs.

Change-Id: I8f5b54adb62e60592884ff1e3fad9811b5934d47
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoFix concurrency issues on event manager
José Bollo [Thu, 30 Mar 2017 11:33:11 +0000 (13:33 +0200)]
Fix concurrency issues on event manager

Having only one event manager is not possible
in multithreading due to the way that systemd
has to manage timer events. We observed that
timers were not armed when set in a thread
because event was polling in an other thread.

This patch provides more than one event manager
and at most as many as the number of threads
avalaible to start.

Change-Id: Iaeab353b7bc79ce61361ab73c7b197a9e69a6109
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRefactor initialisation of the daemon
José Bollo [Thu, 30 Mar 2017 09:19:42 +0000 (11:19 +0200)]
Refactor initialisation of the daemon

This commit prepares a future job centrered
main where 'sig_monitor_init', 'jobs_init',
'jobs_add_events', 'jobs_queue0' and 'jobs_add_me'
will be merged in one single call provided as
a feature of module jobs.

Change-Id: I8ccb1bf1761c4fa1031e903bead863ff68e7df83
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare migration to binding v2
José Bollo [Wed, 29 Mar 2017 16:09:38 +0000 (18:09 +0200)]
Prepare migration to binding v2

Change-Id: I48c1fdb5199c9fb0f001576ceed3ddcb50fc9066
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agocosmetic
José Bollo [Wed, 29 Mar 2017 15:41:16 +0000 (17:41 +0200)]
cosmetic

Change-Id: I26e35f99a68557d005ee46dd4cd1c0fbd728bfd2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoPrepare move to bindings version 2
José Bollo [Wed, 29 Mar 2017 15:39:23 +0000 (17:39 +0200)]
Prepare move to bindings version 2

Change-Id: I3105a5898d0703d1e57eff09f179b38742482842
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd comments
José Bollo [Wed, 29 Mar 2017 14:02:13 +0000 (16:02 +0200)]
Add comments

Improves the comments of the module jobs

Change-Id: Id99e9c6d6c9572d68ae9cca0f13e2498348de91d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRefactor job to allow synchronous calls
José Bollo [Tue, 28 Mar 2017 15:46:32 +0000 (17:46 +0200)]
Refactor job to allow synchronous calls

The family of methods "jobs_invoke" make synchronous
job activation. It waits for the completion of the
job while still dispatching it internally and
providing the calling thread for processing any job
queued.

Change-Id: Id36a30789cc51245a7bbfca42f0122cf4ea623b2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoFix bug in recycling jobs
José Bollo [Tue, 28 Mar 2017 08:18:06 +0000 (10:18 +0200)]
Fix bug in recycling jobs

The bug was creating an infinite loop starving
the system (or other possible horrific stuff).

Also updated the test.

Change-Id: Id71dd112d2ed4651ac8aa56d2c57b088d69b8655
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMake main thread used for common jobs
José Bollo [Mon, 27 Mar 2017 20:49:44 +0000 (22:49 +0200)]
Make main thread used for common jobs

This commit make the main thread behaving
like any other threads. The main loop
is shared across threads, the first one
without job taking it. The main event loop
now have the lowest priority. It is
activated only when no job is queued.
This has the good effect to not try to
overfill the queue of jobs.

Change-Id: I07cecc9d94a02134c63bc2a814db56e171ab719e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRemove option readyfd
José Bollo [Mon, 27 Mar 2017 13:54:44 +0000 (15:54 +0200)]
Remove option readyfd

This option is no more useful. Instead it is
possible to use systemd notify feature.

Change-Id: I8dd286242d3dc74238ca0908e83072367874d19e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoSpeed up accesses to session's cookies
José Bollo [Mon, 27 Mar 2017 12:48:53 +0000 (14:48 +0200)]
Speed up accesses to session's cookies

Minor improvement to speed up refactored contextes.

Change-Id: I45c1c4b0cecec52d10c2b7c5cd8e738fd75b25d6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoReplace session's value with sessions's cookies
José Bollo [Mon, 27 Mar 2017 12:24:46 +0000 (14:24 +0200)]
Replace session's value with sessions's cookies

This is a simplifaction with the benefits of
only allocating needed memory and avoiding to
create indexes on apis (path to dynanic?).
Conversely it replaces a direct access with
a linear search.

Change-Id: Ibb130528ad8f23dfd6b420c228f51e181efb2664
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImplement dichotomic search of APIs
José Bollo [Mon, 27 Mar 2017 10:00:12 +0000 (12:00 +0200)]
Implement dichotomic search of APIs

This is a small improvement but it costs
so few that it is welcome.

Change-Id: I96db79b17ec811582c8e5d1d512afacece284016
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoSimplify functions for calls
José Bollo [Mon, 27 Mar 2017 09:23:51 +0000 (11:23 +0200)]
Simplify functions for calls

For historical reasons, the call to apis was
passing the length of the api and the length
of the verb. The reason was to avoid a copy
of strings. But the copy occured only for HTTP
requests. Having this implementation is of
small interest and compromise future changes.

This patch simplify things.

Change-Id: I8157724c6c721b6797cd0eab52b07e1b8d6eb5f8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRefactor of threading and signal monitor
José Bollo [Wed, 22 Mar 2017 15:49:53 +0000 (16:49 +0100)]
Refactor of threading and signal monitor

The goal is to allow use of this facilities for
things that are not 'afb_req'.

Change-Id: I0d99c227934ed45136477bf6235bd1541d5f05cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoInstanciate the environment variables
José Bollo [Tue, 21 Mar 2017 15:28:00 +0000 (16:28 +0100)]
Instanciate the environment variables

Because it could be of interest to transmit the
port and the token in environment variables,
provision is made here to instanciate environment
variables before exec.

Change-Id: I65cc8e052ca9e2831520a19d2da2a96ada7f672e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoIntegration of socket activation for services
José Bollo [Mon, 13 Mar 2017 15:18:23 +0000 (16:18 +0100)]
Integration of socket activation for services

The services provided using the option --ws-server
can now be linked to socket activation of systemd.

When afb-daemon is launched, the api to be provided
by socket activation is declared by adding the
option

   --ws-server=sd:APINAME

Where APINAME is the name of the provided api.

The binder looks to the prefix "sd:" to automatically
use the "listen fd" of name APINAME for serving
the api APINAME.

In the socket activation unit the connection
to this socket must be named using the
directive FileDescriptorName as below:

[socket]
FileDescriptorName=APINAME
...

Change-Id: I281e1a2b9fed3eac3bd0ee27b7f56df99df7bbd6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoBeginning of integration as systemd service
José Bollo [Mon, 13 Mar 2017 14:49:11 +0000 (15:49 +0100)]
Beginning of integration as systemd service

This allows to receive socket activation by names.

Change-Id: I6896dec785e8d434da452ed2d1341016f6eadb60
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agonotify systemd of being started
José Bollo [Mon, 13 Mar 2017 14:16:26 +0000 (15:16 +0100)]
notify systemd of being started

Change-Id: I10251b0800ac44e59d2a17ebd202c9f55c5c9196
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd comments about always setting INFER_EXTENSION.
Sebastien Douheret [Mon, 6 Mar 2017 09:50:17 +0000 (10:50 +0100)]
Add comments about always setting INFER_EXTENSION.

INFER_EXTENSION must always be set in order to provide right mimetypes for
some files.
For example mimetype for css files must be 'text/css' and not 'text/plain' as
returned by libmagic. If mimetype is not correct, css files of HTML5 webapps
will be not correctly interpreted resulting in a strange rendering in browser
like Chrome.

Change-Id: I7f0d9f97ede19308c87256f7850f5c51135827f3
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
7 years agofix SEGFLT when unhendled request
José Bollo [Mon, 27 Feb 2017 08:31:33 +0000 (09:31 +0100)]
fix SEGFLT when unhendled request

Change-Id: I34c657972111db843d0d9d26a1732b21ac519c57
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoEnable INFER_EXTENSION and add well-known mime types.
Sebastien Douheret [Wed, 22 Feb 2017 10:24:14 +0000 (11:24 +0100)]
Enable INFER_EXTENSION and add well-known mime types.

Change-Id: I7c433eea63c01d2b0813a9cc84c12433839bf125
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
7 years agoFix issue in initialisation of api by sessions
José Bollo [Tue, 21 Feb 2017 18:22:49 +0000 (19:22 +0100)]
Fix issue in initialisation of api by sessions

Change-Id: I72639196ce7462c34a2037cc825cf819add4a2fc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix issue for C++
José Bollo [Tue, 21 Feb 2017 08:22:10 +0000 (09:22 +0100)]
fix issue for C++

Change-Id: I14b5fb9a0f517d5a784cbbc43ca1401877d0f2fe
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix mimetype by using libmagic
José Bollo [Tue, 21 Feb 2017 08:20:22 +0000 (09:20 +0100)]
fix mimetype by using libmagic

Change-Id: I418b7f9323d4847dfef0f1f3f6dd90f6538b2ffb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUpdate documentation of --roothttp option. 93/8493/1
Sebastien Douheret [Thu, 16 Feb 2017 09:34:56 +0000 (10:34 +0100)]
Update documentation of --roothttp option.

By default when roothttp option is not set, no files are served but
note that apis are still available.

Change-Id: I461b6c94d4d16cf873c0f8fb2543576595ed24c1
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
7 years agoIgnore Visual Studio Code project 91/8491/1
Sebastien Douheret [Thu, 16 Feb 2017 09:34:39 +0000 (10:34 +0100)]
Ignore Visual Studio Code project

Change-Id: Iecbef1a7887496deb849ab807ebf4de644e66343
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
7 years agoFix html heading and hyperlink order 65/8465/1
Sebastien Douheret [Wed, 15 Feb 2017 13:40:11 +0000 (14:40 +0100)]
Fix html heading and hyperlink order

Change-Id: I4f52c1c68fa357306faf6cd976a69e65de580fdb
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
7 years agoImproves documentation and directory management
José Bollo [Thu, 12 Jan 2017 16:34:02 +0000 (17:34 +0100)]
Improves documentation and directory management

Change-Id: I21c102f7439343476765c65011664feece2d2c18
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd option --random-token
José Bollo [Wed, 11 Jan 2017 17:28:23 +0000 (18:28 +0100)]
Add option --random-token

Also fix a bug in use of getopt_long.

Change-Id: Iffc90104665664c8e5a61fbee70f03f3cdb660cb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoFirst step for grouping processes
José Bollo [Thu, 5 Jan 2017 15:02:14 +0000 (16:02 +0100)]
First step for grouping processes

Actually make afb-daemon the process group leader.

Change-Id: I01ca7bb027416e2446cfa322b69684da4db852e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImproves logging
José Bollo [Thu, 5 Jan 2017 14:23:35 +0000 (15:23 +0100)]
Improves logging

Adds error message for errors related to HTTP.

Change-Id: I5a3069528f8e9a7fe9a8dae6c201a783948a565a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdds options --no-httpd and --exec
José Bollo [Wed, 4 Jan 2017 17:52:32 +0000 (18:52 +0100)]
Adds options --no-httpd and --exec

The option option --exec use the remaining arguments
of the command line (at the right of --exec) as a
command to launch with its arguments. Arguments can
use @p (for port), @t (for token) or @@ for @.

When the option --exec is given, the command is launched
as soon as afb-daemon is ready. When the command die,
afb-daemon exits and before exiting, afb-daemon kills
the launched command and its childs.

The option --no-http forbids the activation of
the HTTP server.

Change-Id: Icdd91d84c818796b5ac6ea5d33ff3549a2fe3c25
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoadds short option for verbosity
José Bollo [Wed, 4 Jan 2017 16:58:17 +0000 (17:58 +0100)]
adds short option for verbosity

Change-Id: I2282057344b2b986520f1a76f5a3c0a827d63075
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoallows to repeat option --ldpaths
José Bollo [Wed, 4 Jan 2017 15:50:13 +0000 (16:50 +0100)]
allows to repeat option --ldpaths

Change-Id: Id07b02eaef35732416de2fb1c6b24f3f75979ed6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRefactor of file main.c
José Bollo [Wed, 4 Jan 2017 15:14:52 +0000 (16:14 +0100)]
Refactor of file main.c

File main.c is splitted in 2 files, one for scanning
arguments and the other for setting up the process.

Change-Id: I5f2d7fd354392d13cdeac6c2a8fceaaf551dea22
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImproves naming of session's module
José Bollo [Tue, 3 Jan 2017 16:52:19 +0000 (17:52 +0100)]
Improves naming of session's module

Make names looking like other names

Change-Id: I63ce3d8a3d84193eca9d517cecb1888d630a9b2d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoRemoves uses of readdir_r
José Bollo [Tue, 3 Jan 2017 16:13:47 +0000 (17:13 +0100)]
Removes uses of readdir_r

Since glibc 2.24, readdir_r is deprecated.

Change-Id: Id0e186e67b7e60bd537a8ba85ede446be0c5095e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agocleanup: removes legacy-named file
José Bollo [Tue, 3 Jan 2017 15:21:51 +0000 (16:21 +0100)]
cleanup: removes legacy-named file

The file include/afb/afb-plugin.h was kept
for compatibility with previous versions.

Change-Id: If144803b5f56e9828ec78de5279520319bbc3342
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoCleanup of the project
José Bollo [Tue, 3 Jan 2017 10:13:47 +0000 (11:13 +0100)]
Cleanup of the project

The bindings "audio", "media" and "radio"
were in the project since its beginning
for historical reasons.

But this bindings msut not be part of the
current tree of sources.

Change-Id: I9d903f094ddc4d2457e63987df0c221d2bd7b4d1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdds 2017 to copyrights
José Bollo [Tue, 3 Jan 2017 10:07:56 +0000 (11:07 +0100)]
Adds 2017 to copyrights

Change-Id: Id85c4eb4e36a05b61346004ba95daa19faf5074f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoUpdate gitreview file for master branch 37/7937/2
Jan-Simon Möller [Wed, 28 Dec 2016 21:28:26 +0000 (22:28 +0100)]
Update gitreview file for master branch

Change-Id: I44fea156e7dc5c5fb16ae16aad7529476b35d485
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
7 years agomain: Removes setting roothttp to . by default
José Bollo [Wed, 14 Dec 2016 15:22:54 +0000 (16:22 +0100)]
main: Removes setting roothttp to . by default

When option --roothttp is not set, the server will
not serve HTTP files.

Change-Id: I16e09f7ad6f735967cde27d5c51758499110fb54
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-hsrv: Adds an error when alias dir doesn't exist
José Bollo [Wed, 14 Dec 2016 15:20:50 +0000 (16:20 +0100)]
afb-hsrv: Adds an error when alias dir doesn't exist

Change-Id: Iab0f9b1997f6471ceab8bb43be07d6d00c53fd78
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix html link 51/7551/1
Ronan [Mon, 12 Dec 2016 21:16:42 +0000 (22:16 +0100)]
fix html link

Change-Id: Iafcdcc919352c567bd097ee86aadae02e38c5415
Signed-off-by: Ronan <ronan.lemartret@iot.bzh>
7 years agofix svg path for website 21/7521/1
Ronan [Fri, 9 Dec 2016 16:08:11 +0000 (17:08 +0100)]
fix svg path for website

Change-Id: I059fe29816c0cba1f423d02f5bc7034438843cac
Signed-off-by: Ronan <ronan.lemartret@iot.bzh>
7 years agoFix typo, get diagrams pictures and reordering doc 25/7325/4
Romain Forlot [Mon, 21 Nov 2016 22:25:02 +0000 (23:25 +0100)]
Fix typo, get diagrams pictures and reordering doc

Change-Id: Id8327460cf59b330283a98db8cef3a89ef505d30
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
7 years agoafb-api-so: adds verbosity on dlopen error
José Bollo [Thu, 17 Nov 2016 16:22:40 +0000 (17:22 +0100)]
afb-api-so: adds verbosity on dlopen error

Change-Id: Ibe42a346c29e71b12d67ebbf43a6fc8152df8202
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoapi-so: cleanup
José Bollo [Mon, 31 Oct 2016 10:16:05 +0000 (11:16 +0100)]
api-so: cleanup

The structure monitoring is not used anymore.

Change-Id: I3b900f7b109b2549f0b4cf17550bb71c4b49d32d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agohook: add few comments
José Bollo [Fri, 28 Oct 2016 12:42:54 +0000 (14:42 +0200)]
hook: add few comments

Change-Id: I453625b70f13a5b01a84b2ac60eb6fb9e0dd0ebd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agohook: adding of hook feature for requests
José Bollo [Wed, 26 Oct 2016 07:23:30 +0000 (09:23 +0200)]
hook: adding of hook feature for requests

The current implementation is for hooking requests.
It allows implementation of command line option for
debugging. Further development is needed to also
handle events and service API. Also a binding for
debugging would be cool.

Change-Id: Ib1ac4711180db7b4097ed92ebbbf1a1a9fd2cc1c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoevent: add ability to get the event name
José Bollo [Fri, 14 Oct 2016 13:13:43 +0000 (15:13 +0200)]
event: add ability to get the event name

Change-Id: Iecfeb4ab07c07715093d729710669abecee722de
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoThreads: handles request with threads
José Bollo [Wed, 3 Aug 2016 18:04:08 +0000 (20:04 +0200)]
Threads: handles request with threads

This implementation handles all requests with threads.
Later implementation could add a mechanism to choose
what request will be handled by threads.

Each API receive its requests in serial order without
reentrancy. Here again, this can change in the future
if a choice is possible to allow reentrant calls.

The signal/event are not processed using threads
in this version. It may change in the future.

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoExplicit dependency on gcc 4.9 or higher
José Bollo [Fri, 7 Oct 2016 12:30:00 +0000 (14:30 +0200)]
Explicit dependency on gcc 4.9 or higher

Needed for _Thread_local keyword

Change-Id: Ia68b2d25fd747b87d95a94ac383c0107b276cf2f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoFix a compiler error
José Bollo [Fri, 7 Oct 2016 12:29:07 +0000 (14:29 +0200)]
Fix a compiler error

Change-Id: Id95c612de55fe5606be945ac74c2c157620c8839
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agominor: improves updt.sh script
José Bollo [Mon, 19 Sep 2016 10:33:05 +0000 (12:33 +0200)]
minor: improves updt.sh script

Change-Id: I0acc567bab126c6e8fef10b294eb0e362222ce5c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoDocumentation: improvements
José Bollo [Mon, 19 Sep 2016 08:54:42 +0000 (10:54 +0200)]
Documentation: improvements

- improves formatting of the documentation on events
- add documentations of functions in headers

Change-Id: Ie39d34fca8bd563a099f6b575c72e314ca08a29d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agocleanup of old unuseful data
José Bollo [Mon, 19 Sep 2016 07:21:07 +0000 (09:21 +0200)]
cleanup of old unuseful data

Change-Id: I849c615c4ff8d08ab170ca22c7d9038706099ff6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoImprovement of the documentation
José Bollo [Fri, 16 Sep 2016 16:47:57 +0000 (18:47 +0200)]
Improvement of the documentation

Change-Id: I8f220d7508d939a16eba956ab1fdf975f4048332
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoIgnore the SIGPIPE
José Bollo [Thu, 15 Sep 2016 13:29:44 +0000 (15:29 +0200)]
Ignore the SIGPIPE

The default action is to stop the daemon.
This is not the intended behaviour because the
sriting errors are checked and EPIPE is treated.

Change-Id: I9132b683e443825e4c056301a89bfad752a99e0c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-ws: fix of handling EAGAIN for websockets
José Bollo [Thu, 15 Sep 2016 13:19:23 +0000 (15:19 +0200)]
afb-ws: fix of handling EAGAIN for websockets

Change-Id: I5a48bff9b1ce50adb48884ad15a9cfc7bd7a066d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-ws: handle EAGAIN return status
José Bollo [Wed, 14 Sep 2016 21:02:39 +0000 (23:02 +0200)]
afb-ws: handle EAGAIN return status

Change-Id: If325537e36a8db1a3f082fa211d619de7ddd478c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoAdd the option roothttp
José Bollo [Wed, 31 Aug 2016 12:16:07 +0000 (14:16 +0200)]
Add the option roothttp

This option tells to the HTTP part of the binder the location
of the root directory for HTTP.

Change-Id: I080adcaaee952e375128eff3898f29332939c5f5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agobindings: adds ability to use data of applications
José Bollo [Wed, 31 Aug 2016 12:13:54 +0000 (14:13 +0200)]
bindings: adds ability to use data of applications

The two new verbs 'afb_daemon_rootdir_get_fd' and
'afb_daemon_rootdir_open_locale' allow the bindings to retrieve
its installed global data.

Change-Id: I369997d9e59402a413a929aa650c48613f034183
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agolocale-root: improves the API
José Bollo [Wed, 31 Aug 2016 12:07:37 +0000 (14:07 +0200)]
locale-root: improves the API

Change-Id: I470da7df049abab589d2c4044740cd54de0d35b4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-hsrv: expose locale root for alias
José Bollo [Mon, 29 Aug 2016 21:31:47 +0000 (23:31 +0200)]
afb-hsrv: expose locale root for alias

This prepare further use of locale_root
here and ther in the code.

Change-Id: I473e8de79db1cbd69b507f6e0e70733f0f02badc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoMinor
José Bollo [Mon, 29 Aug 2016 21:30:22 +0000 (23:30 +0200)]
Minor

Change-Id: Id2758e83b59d6d8617e7f58635127fc436c9be5a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix bug in reading socket
José Bollo [Mon, 29 Aug 2016 14:19:53 +0000 (16:19 +0200)]
fix bug in reading socket

Change-Id: I2f7daf847f59a450fafa5d7edf5f5984fdc15481
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoenforce locale processing for files
José Bollo [Thu, 25 Aug 2016 21:51:00 +0000 (23:51 +0200)]
enforce locale processing for files

Change-Id: I7de05d2acd02d088a3a2034ad8bccf524b5b6c12
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoadd algorithm to seek for locale files
José Bollo [Thu, 25 Aug 2016 17:26:28 +0000 (19:26 +0200)]
add algorithm to seek for locale files

Change-Id: Ie4355db29b157b13c4d93011337b15ca3e5d2571

7 years agoadds accepted lang to global hreq
José Bollo [Thu, 25 Aug 2016 21:19:16 +0000 (23:19 +0200)]
adds accepted lang to global hreq

Change-Id: I6b820e7ab169897259414276eaa0b1f8847d9229
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agomakes a function to ensure trailing slash
José Bollo [Thu, 25 Aug 2016 21:11:17 +0000 (23:11 +0200)]
makes a function to ensure trailing slash

This function is usefull to ensure that links to otherfile
are epanded to directory/otherfile (not directoryotherfile!)

Change-Id: If8ad1c275598b322516c41706b464d5d90067a8e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofactorise code for alias handling
José Bollo [Thu, 25 Aug 2016 18:20:09 +0000 (20:20 +0200)]
factorise code for alias handling

Change-Id: Ia60b50b1e4f859c2ee69919d5f63349af40865b6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix tiny memory leak 2.0.2 blowfish_2.0.2
José Bollo [Tue, 9 Aug 2016 08:12:56 +0000 (10:12 +0200)]
fix tiny memory leak

Change-Id: I7ad19eeb73c613893682824d6becc500277d01d6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix blocking read
José Bollo [Mon, 8 Aug 2016 15:59:58 +0000 (17:59 +0200)]
fix blocking read

Change-Id: I7e39d4ce7c0f83e3398f344ade7e5114cf203efb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix on_event for services
José Bollo [Mon, 8 Aug 2016 12:53:50 +0000 (14:53 +0200)]
fix on_event for services

Change-Id: Id90d53764016abc16db6f4d4fb68b9e16ba492fb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agocleanup of unused variables
José Bollo [Mon, 8 Aug 2016 11:57:52 +0000 (13:57 +0200)]
cleanup of unused variables

Change-Id: I895901fb5af2811d79a96aa0baa7981a5c9f9b3a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoadd validity functions
José Bollo [Mon, 8 Aug 2016 11:57:21 +0000 (13:57 +0200)]
add validity functions

Change-Id: I56f4f6aebe673363c8b07c55f68ebbb1362b04fc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoremoving casts to (void*) 2.0.1 blowfish_2.0.1
José Bollo [Thu, 4 Aug 2016 12:33:24 +0000 (14:33 +0200)]
removing casts to (void*)

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agofix tiny memory leak
José Bollo [Sun, 7 Aug 2016 06:05:07 +0000 (08:05 +0200)]
fix tiny memory leak

Change-Id: I8183da55b6afb0e2d3035ebe8cf371b181ec4257
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoremoving casts to (void*)
José Bollo [Wed, 3 Aug 2016 18:03:13 +0000 (20:03 +0200)]
removing casts to (void*)

Change-Id: I34a4444c1fe8b9fa81c5319f53d154d6fe93916c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agowebsocket transparancy for C/S bindings
José Bollo [Wed, 3 Aug 2016 13:54:48 +0000 (15:54 +0200)]
websocket transparancy for C/S bindings

Change-Id: Ia78621ca4d3298fd45f3486ee64c3785c8ab6d8d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoafb-ws: adds function afb_ws_is_connected
José Bollo [Wed, 3 Aug 2016 13:13:59 +0000 (15:13 +0200)]
afb-ws: adds function afb_ws_is_connected

Change-Id: If7f3a2b9a724f28dbd3e4968347892d837ba875d
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
7 years agoapi-dbus: improves 'dbus_req_json'
José Bollo [Wed, 3 Aug 2016 13:13:21 +0000 (15:13 +0200)]
api-dbus: improves 'dbus_req_json'

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