Skip to content

Commit

Permalink
possibly related to issue #100 + bump
Browse files Browse the repository at this point in the history
  • Loading branch information
boazsegev committed Sep 12, 2022
1 parent 4fb44bf commit 4dcc78b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions examples/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#
# ab -c 2000 -t 5 -n 1000000 -k http://127.0.0.1:3000/
# wrk -c2000 -d5 -t12 http://localhost:3000/
#
# Test websocket echo using the browser. For example:
# ws = new WebSocket("ws://localhost:3000"); ws.onmessage = function(e) {console.log("Got message!"); console.log(e.data);}; ws.onclose = function(e) {console.log("closed")}; ws.onopen = function(e) {ws.send("hi");};


# A simple router - Checks for Websocket Upgrade and answers HTTP.
Expand Down
6 changes: 4 additions & 2 deletions ext/iodine/fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3689,7 +3689,8 @@ ssize_t fio_flush(intptr_t uuid) {
return -1;

flush_rw_hook:
flushed = uuid_data(uuid).rw_hooks->flush(uuid, uuid_data(uuid).rw_udata);
if(uuid_data(uuid).rw_hooks)
flushed = uuid_data(uuid).rw_hooks->flush(uuid, uuid_data(uuid).rw_udata);
fio_unlock(&uuid_data(uuid).sock_lock);
if (!flushed)
return 0;
Expand Down Expand Up @@ -3749,7 +3750,8 @@ size_t fio_flush_all(void) {
return 0;
size_t count = 0;
for (uintptr_t i = 0; i <= fio_data->max_protocol_fd; ++i) {
if ((fd_data(i).open || fd_data(i).packet) && fio_flush(fd2uuid(i)) > 0)
if ((fd_data(i).open || fd_data(i).packet) &&
fd_data(i).rw_hooks && fio_flush(fd2uuid(i)) > 0)
++count;
}
return count;
Expand Down
2 changes: 1 addition & 1 deletion lib/iodine/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Iodine
VERSION = '0.7.48'.freeze
VERSION = '0.7.49'.freeze
end

0 comments on commit 4dcc78b

Please sign in to comment.