Changelog History
Page 4
-
v0.5.1 Changes
๐ Fix: (
sock
) Fixed an issue wheresock_flush
would always invokesock_touch
, even if no data was actually sent on the wire.๐ Fix: (
sock
) fixed a possible issue withsock_flush_strong
which might have caused the facil.io to hang.๐ Fix: (
Websocket
) fixed an issue with fragmented pipelined Websocket messages.๐ Feature: (
facil
) easily force an IO event, even if it did not occur, usingfacil_force_event
. -
v0.5.0 Changes
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. -
v0.4.4 Changes
๐ Fix: (
pubsub
) Fixed collisions between equal channel names on different engines, so that channels are only considered equal if they share the same name as well as the same engine (rather than only the same name)... actually, if they share the same channel name SipHash value XOR'd with the engine's memory location.๐ Fix: (
facil
) Fixed compiling error on oldergcc
v.4.8.4, discovered on Ubuntu trusty/64.๐ Fix: Fix enhanced CPU cycles introduced in the v.0.4.3 update. Now CPU cycles are lower and thread throttling handles empty queues more effectively.
๐ Performance: (
pubsub
) now uses a hash-table storage for the channels, clients and patterns, making the duplicate review inpubsub_subscribe
much faster, as well as improving large channel collection performance (nothing I can do about pattern pub/sub, though, as they still need to be matched using iterations, channel by channel and for every channel match).๐ Feature: (
http
) Thehttp_response_sendfile2
function will now test for agzip
encoded alternative when the client indicated support for the encoding. To provide agzip
alternative file, simplygzip
the original file and place the.gz
file in the original file's location.Folder Structure: Updated the folder structure to reflect source code relation to the library.
core
being required files,http
relating tohttp
etc'. -
v0.4.3 Changes
๐ Fix: Some killer error handling should now signal all the process group to exit.
๐ Fix: (
sock
,websocket
)sock_buffer_send
wouldn't automatically schedule a socket buffer flush. This caused some websocket messages to stay in the unsent buffer until a new event would push them along. Now flushing is scheduled and messages are send immediately, regardless of size.๐ Fix: (
facil
)facil_attach
now correctly calls theon_close
callback in case of error.๐ Fix: (
facil
)facil_protocol_try_lock
would return false errors, preventing external access to the internal protocol data... this is now fixed.๐ Feature: (
facil
) Experimental cluster mode messaging, allowing messages to be sent to all the cluster workers. A classic use-case would be a localized pub/sub websocket service that doesn't require a backend database for syncing a single machine... Oh wait, we've added that one too...๐ Feature: (
facil
) Experimental cluster wide pub/sub API with expendable engine support (i.e., I plan to add Redis as a possible engine for websocket pub/sub).โก๏ธ Update: (
http
) Updated thehttp_listen
to accept the newsock_rw_hook_set
andrw_udata
options.โก๏ธ Update: (
sock
) Rewrote some of the error handling code. Will it change anything? only if there were issues I didn't know about. It mostly effects errno value availability, I think. -
v0.4.2 Changes
๐ Fix: (
sock
) Fixed an issue with thesendfile
implementation on macOS and BSD, where medium to large files wouldn't be sent correctly.๐ Fix: (
sock
) Fixed thesock_rw_hook_set
implementation (would lock the wrongfd
).Design: (
facil
) Separated the Read/Write hooks from the protocol'son_open
callback by adding aset_rw_hook
callback, allowing the same protocol to be used either with or without Read/Write hooks (i.e., both HTTP and HTTPS can share the sameon_open
function).๐ Fix: (
evio
,facil
) Closes theevio
once facil.io finished running, presumably allowing facil.io to be reinitialized and run again.๐ Fix: (
defer
) return an error ifdefer_perform_in_fork
is called from within a running defer-forked process.๐ Fix: (
sock
,facil
, bscrypt) Add missingstatic
keywords.Compatibility: (bscrypt) Add an alternative
HAS_UNIX_FEATURES
test that fits older *nix compilers.
-
v0.4.1 Changes
๐ Fix: (HTTP/1.1) fixed the default response
date
(should have been "now", but was initialized to 0 instead).๐ Fix: fixed thread throttling for better energy conservation.
๐ Fix: fixed stream response logging.
Compatibility: (HTTP/1.1) Automatic
should_close
now checks for HTTP/1.0 clients to determine connection persistence.Compatibility: (HTTP/1.1) Added spaces after header names, since some parsers don't seem to read the RFC.
๐ Fix/Compatibility: compiling under Linux had been improved.
-
v0.4.0 Changes
Rewrite from core. The code is more concise with less duplications.
Different API.
The server is now a global state machine instead of an object.
๐ Better integration with
libsock
.๐ Handles
libsock
's UUID instead of direct file descriptors, preventing file descriptor collisions and preventing long running tasks from writing to the wrong client (i.e., if file descriptor 6 got disconnected and someone else connected and receive file descriptor 6 to identify the socket).Better concurrency protection and protocol cleanup
on_close
. Now, deferred tasks (server_task
/server_each
), theon_data
callback and even theon_close
callback all run within a connection's "lock" (busy flag), limiting concurrency for a single connection to theon_ready
andping
callbacks. No it is safe to free the protocol's memory during anon_close
callback, as it is (almost) guarantied that no running tasks are using that memory (this assumes thatping
andon_ready
don't use any data placed protocol's memory).
-
v0.3.5 Changes
๐ Moved the global server lock (the one protecting global server data integrity) from a mutex to a spin-lock. Considering API design changes that might allow avoiding a lock.
๐ File sending is now offset based, so
lseek
data is ignored. This means that it should be possible to cache openfd
files and send the same file descriptor to multiple clients.
-
v0.3.4 Changes
- โก๏ธ Updated
sendfile
to only accept file descriptors (notFILE *
). This is an optimization requirement.
- โก๏ธ Updated
-
v0.3.3 Changes
๐ fixed situations in which the
sendfile
might not close the file before returning an error.๐ There was a chance that the
on_data
callback might return after the connection was disconnected and a new connection was established for the samefd
. This could have caused thebusy
flag to be cleared even if the new connection was actually busy. This potential issue had been fixed by checking the connection against the UUID counter before clearing thebusy
flag.๐ reminder: The
Server.rw_hooks
feature is deprecated. Uselibsock
's TLC (Transport Layer Callbacks) features instead.