Skip to content

Commit ba181ce

Browse files
byrootpeterzhu2118
andcommitted
Fix hiredis driver crashes
Somehow `ruby.h` must be included first, otherwise the extension and the VM use different `fd_set` structs. Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
1 parent 0cd5b48 commit ba181ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
os: ["ubuntu-latest"]
3030
redis: ["6.2"]
3131
ruby: ["3.1", "3.0", "2.7", "2.6", "2.5"]
32-
driver: ["ruby"] #, "hiredis"]
32+
driver: ["ruby", "hiredis"]
3333
runs-on: ${{ matrix.os }}
3434
steps:
3535
- name: Check out code

ext/redis_client/hiredis/hiredis_connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3131
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232

33+
#include "ruby.h"
3334
#include <errno.h>
3435
#include <sys/socket.h>
3536
#include "hiredis.h"
3637
#include "hiredis_ssl.h"
37-
#include "ruby.h"
3838

3939
static VALUE rb_cSet, rb_eRedisClientCommandError, rb_eRedisClientConnectionError;
4040
static VALUE rb_eRedisClientConnectTimeoutError, rb_eRedisClientReadTimeoutError, rb_eRedisClientWriteTimeoutError;

0 commit comments

Comments
 (0)