facil.io v0.5.0 Release Notes

  • Braking changes: (pubsub) The API was changed / updated, making pubsub_engine_s objects easier to author and allowing allocations to be avoided by utilizing two void * 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 the on_X flow events (on_close, on_fail, on_start...) share the same function signature where possible.

    ๐Ÿ”„ Changes: (facil) Minor changes to the fio_cluster_* API now use signed message types. All negative msg_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 the public_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 the on_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 the on_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 the port, allowing dynamic strings to be safely used when FACIL_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')... now facil_last_tick falls back to time() 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, since pubsub 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 optional on_finish_rw callback to clean-up the rw_udata object.

    ๐Ÿ”‹ Feature: (pubsub) channels now use the available fio_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 an on_finish callback.

    ๐Ÿ”‹ Feature: (http1) HTTP/1.1 will, in some cases, search for available error files (i.e. "400.html") in the public_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) optimize fio_ht_s bin memory allocations.