facil.io v0.5.0 Release Notes
-
Braking changes: (
pubsub
) The API was changed / updated, makingpubsub_engine_s
objects easier to author and allowing allocations to be avoided by utilizing twovoid * udata
fields... Since this is a breaking change, and following semantic versioning, the minor version is updated. I do wish I could have delayed the version bump, as the roadmap ahead is long, but it is what it is.Braking changes: (
facil
) Since the API is already changing a bit, I thought I'd clean it up a bit and have all theon_X
flow events (on_close
,on_fail
,on_start
...) share the same function signature where possible.๐ Changes: (
facil
) Minor changes to thefio_cluster_*
API now use signed message types. All negativemsg_type
values are reserved for internal use.๐ Fix: plugging memory leaks while testing the system under very high stress.
๐ Fix: (
pubsub
,fio_dict
) Fixed glob pattern matching... I hope. It seems to work fine, but I'm not sure it the algorithm matches the Redis implementation which is the de-facto standard for channel pattern matching.๐ Security: (
http
) the HTTP parser now breaks pipelined HTTP requests into fragmented events, preventing an attacker from monopolizing requests through endless pipelining of requests that have a long processing time.๐ Fix: (
http
)http_listen
will now always copy the string for thepublic_folder
, allowing dynamic strings to be safely used.๐ Fix: (
http
) default error files weren't located due to missing/
in name. Fixed by adjusting the requirement for the/
to be more adaptive.๐ Fix: (
http
) dates were off by 1 day. Now fixed.๐ Fix: (
http1
) a minor issue in theon_data
callback could have caused the parser to crash in rare cases of fragmented pipelined requests on slower connections. This is now fixed.๐ Fix?: (
http
) When decoding the path or a request, the+
sign is now left unencoded (correct behavior), trusting in better clients in this great jungle.๐ Fix: (
facil
)facil_defer
would leak memory if a connection was disconnected while a task was scheduled.๐ Fix: (
facil
)facil_connect
now correctly calls theon_fail
callback even on immediate failures (i.e. when the function call was missing a target address and port).๐ Fix: (
facil
)facil_connect
can now be called before other socket events (protected form library initialization conflicts).๐ Fix: (
facil
)facil_listen
will now always copy the string for theport
, allowing dynamic strings to be safely used whenFACIL_PRINT_STATE
is set.๐ Fix: (
facil
)facil_last_tick
would crash if called before the library was initialized during socket operations (facil_listen
,facil_attach
, etc')... nowfacil_last_tick
falls back totime()
if nothing happened yet.๐ Fix: (
facil
).on_idle
now correctly checks for non networks events as well before the callback is called.๐ Fix: (
defer
) A large enough (or fast enough) thread pool in a forked process would complete the existing tasks before the active flag was set, causing the facil.io reactor to be stranded in an unscheduled mode, as if expecting to exit. This is now fixed by setting a temporary flag pointer for the forked children, preventing a premature task cleanup.๐ Changes: Major folder structure updates make development and support for CMake submodules easier. These changes should also make it easier to push PRs for by offering the
dev
folder for any localized testing prior to submitting the PR.๐ Feature: (
websockets
) The websocket pub/sub support is here - supporting protocol tasks as well as direct client publishsing (and autu text/binary detection)! There are limits and high memory costs related to channel names, sincepubsub
uses a trie for absolute channel matching (i.e. channel name length should be short, definitely less than 1024Bytes).๐ Feature: (
redis
) The websocket pub/sub support features a shiny new Redis engine to synchronize pub/sub across machines! ... I tested it as much as I could, but I know my tests are as buggy as my code, so please test before using.๐ Feature: (
facil_listen
,http_listen
) supports an optionalon_finish_rw
callback to clean-up therw_udata
object.๐ Feature: (
pubsub
) channels now use the availablefio_dict_s
(trie) data store. The potential price of the larger data-structure is elevated by it's absolute protection against hash collisions. Also, I hope that since channels are more often searched than created, this should improve performance when searching for channels by both pattern and perfect match. I hope this combination of hash tables (for client lookup) and tries (for channel traversal) will provide the best balance between string matching, pattern matching, iterations and subscription management.๐ Feature: (
http
)http_listen
now supports anon_finish
callback.๐ Feature: (
http1
) HTTP/1.1 will, in some cases, search for available error files (i.e. "400.html") in thepublic_folder
root, allowing for custom error messages.๐ Feature: CMake inclusion. Credit to @OwenDelahoy (PR#8).
๐ > To use facil.io in a CMake build you may add it as a submodule to the project's repository.
git submodule add https://github.com/boazsegev/facil.io.git
Then add the following line the project's
CMakeLists.txt
add_subdirectory(facil.io)
โก๏ธ Optimize: (
fio_hash_table
) optimizefio_ht_s
bin memory allocations.