aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-api-ws.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-08Update copyright datesJosé Bollo1-1/+1
Signed-off-by: José Bollo <jose.bollo@iot.bzh> Change-Id: I01a566a693b8ec6239209c9323ae4ff15a07f737
2019-08-20Fix client disconnection closeJosé Bollo1-3/+3
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
2019-07-18Fix bad memory access at client disconnectionJosé Bollo1-2/+4
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>
2019-04-02Fix false ***buffer overflow*** detectionJosé Bollo1-2/+2
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>
2019-02-06Update copyright datehalibut_7.90.0halibut/7.90.07.90.0José Bollo1-1/+1
Change-Id: I3aaa92b2bfb01699ee8ae609272e93032b6f1a9d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-23afb-stub-ws: Add reconnection of ws-clients on needJosé Bollo1-1/+15
This implementation detects deconnections and try to reconnect lazily on need. Bug-AGL: SPEC-1668 Change-Id: Ib2a20a4578f2da80afe1564c42de96c4aa250e64 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-08-22afb-api-ws: Use afb-socket featuresJose Bollo1-92/+85
Use the feature of afb-socket to handle the api name. Bug-AGL: SPEC-1668 Change-Id: Ib13891d7948c75bc5d342b45c774f8e6c3ea016e Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-22afb-socket: ImprovementJose Bollo1-2/+2
Allows to either open a 'struct fdev*' or a int. This prepares further integration in afb-api-ws. Bug-AGL: SPEC-1668 Change-Id: I3d61be582bceaab636460b3c7de3ac2f24ed9473 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-08-02afb-socket: Separate socket creationJosé Bollo1-163/+29
The objective is to have a well identified and possibly reusable internally. Change-Id: Icdb6ce7d85ae26373cfe4f0b492fe97b74ed747c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-07-05Remove uses of deprecated macrosJosé Bollo1-1/+0
Change-Id: I439e891d92fb34087755e68102fda97c43b5b786 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-11/+12
This commit introduces the bindings v3 API for bindings. The documentation has still to be improved and will come very soon. Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-27Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-22fdev: Introduce fdev for file event handlingJosé Bollo1-45/+52
This is an effort to keep cutting dependency to systemd. Change-Id: I9a0c032a1095e297c7f3ac5b67827fda3658b8d9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-21afb-systemd: Integrate sd-fds featuresJosé Bollo1-2/+1
Change-Id: I59d194ba675912a42922f0905933b1cea796c78a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-21afb-systemd: Isolate systemd main entriesJosé Bollo1-2/+2
This change prepares the possibilty to remove the dependency to systemd/libsystemd. Change-Id: Ife4181d6c7195230a11a32e527b8973af6a096e1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-01-31afb-api: Enforce api names to be hookableJosé Bollo1-1/+1
Change-Id: Ic1d5cb208c636d3261e1a96c4a81b488cb84a60e Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-12-05afb-api-ws: Make weak ws-client by default (to be fixed)José Bollo1-2/+12
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>
2017-10-09Remove tailing spaces and TODO fileJosé Bollo1-1/+0
Change-Id: Id7cdad4e24c6ab62bf9c325b542e1605b17223f4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-09-05afb-api-ws: Fix bug introduced by 2e83db0José Bollo1-1/+1
Change-Id: Ia73d2d49ac888770f78d65a6258c0184b6aaa2da Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-31afb-apiset: refactor access to apisJosé Bollo1-2/+1
Change-Id: If003067ada5802b7d77f06f560a5d07464909a61 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-30afb-api-ws: check that the ws-server API existJosé Bollo1-0/+7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-11afb-stub-ws: improvementsJosé Bollo1-1/+6
The client stub isn't connecting anymore automatically to the apiset. The function 'afb_stub_ws_client_add' provides the feature. The client now returns a afb_api structure. name and on_hangup features added. Change-Id: I204cc39adeb782f5d40360c22c79d14f54dd5c63 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-14Create afb-stub-ws by spliting afb-api-wsJosé Bollo1-1183/+56
The file afb-stub-ws only carries the protocol of the internal remote calling conventions. It as the following benefits: - it easies transition to symetric connection (not planned) - it allows to have server stub on client socket and conversely, client stub on server socket (planned for debugging). Change-Id: I57dc8e78d7bd63427421a180abcb844f8313d37b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-14allow abstract unix socketsJosé Bollo1-1/+3
unix sockets named "unix:@something" are now treated as abstract sockets. Change-Id: Ieb2bb9dd1c7b420b9e3fae81590ef49c32f63802 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-14use heuristic message idsJosé Bollo1-3/+16
Change-Id: I9492288de61b79074db38818c459f7447b12b4e6 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Introduce apiset for grouping apisJosé Bollo1-22/+15
This will be used at the end for debugging facilities. Change-Id: I75e3345667e1f58143c77a885e166375680ca194 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Implement subcall for services over websocketsJosé Bollo1-56/+258
This modification make subcalls pushed back to the client that will issue it for itself. This will at the end ensure the security context of the client. Change-Id: Ib4bb5125ffe1b942103b72d1a3d13892dda87baa Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Enhance client->server protocolJosé Bollo1-8/+16
This commit adds a protocol header for inter binder communication in the direction client->server. It also changes how data buffer is handled. Change-Id: I1eb4253408ddd4c8042773da541d27046e90f715 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-13Use names for constantsJosé Bollo1-17/+24
quality improvement Change-Id: I1d8fda1ec48bb9d3c6eb2ee88b579cfcf8dcc5fb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-12Add credential data to xreqJosé Bollo1-0/+2
This will allow soon to check the credentials when evaluating calls. Change-Id: I993216ccbc02538dcd92e49fcb2de0541eeb8c01 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-12Optimisation of xreqJosé Bollo1-18/+16
Reduce the count of memory read Change-Id: Ie4dfa4bd30d6485be91961196294c43ffbd3b2a9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-12Add computation of credentialsJosé Bollo1-0/+7
Credentials are computed if possible. Change-Id: I36c7e95a35431b27109c26b51eab690d685862e1 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-10Refactor of API interfacesJosé Bollo1-3/+6
The new interface has increased functionnality, it allows to set debug flags by API. Change-Id: Ibd35fb02ed645e22cac8e7021b37b96e07e79877 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-07Add hooking of daemon interfaceJosé Bollo1-0/+1
Change-Id: I5840609f4300ade98412e8527ac5ce1f1e8c0c59 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-04Definitive switch to internal's xreqJosé Bollo1-3/+3
This switch allows to work on a common base for the requests. Change-Id: I94e7fdda80c1966af399309334c41c7c8c8259dc Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-03Switch API websocket to xreqJosé Bollo1-161/+53
Change-Id: I57600d8dc99bf37f207b126a0e3ab5731ad08ced Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-03-27Simplify functions for callsJosé Bollo1-9/+3
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>
2017-03-13Integration of socket activation for servicesJosé Bollo1-11/+22
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>
2017-01-03Improves naming of session's moduleJosé Bollo1-2/+2
Make names looking like other names Change-Id: I63ce3d8a3d84193eca9d517cecb1888d630a9b2d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-01-03Adds 2017 to copyrightsJosé Bollo1-1/+1
Change-Id: Id85c4eb4e36a05b61346004ba95daa19faf5074f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-08fix blocking readJosé Bollo1-0/+2
Change-Id: I7e39d4ce7c0f83e3398f344ade7e5114cf203efb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-07removing casts to (void*)blowfish_2.0.12.0.1José Bollo1-36/+61
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-07fix tiny memory leakJosé Bollo1-0/+1
Change-Id: I8183da55b6afb0e2d3035ebe8cf371b181ec4257 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-08-03websocket transparancy for C/S bindingsJosé Bollo1-0/+1302
Change-Id: Ia78621ca4d3298fd45f3486ee64c3785c8ab6d8d Signed-off-by: José Bollo <jose.bollo@iot.bzh>