Skip to content

Commit

Permalink
Initialize libssh on load
Browse files Browse the repository at this point in the history
  • Loading branch information
eagletmt committed Feb 6, 2016
1 parent bdffbaf commit 5f394fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/libssh_ruby/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

have_header('libssh/libssh.h')
have_library('ssh')
have_library('ssh_threads')
have_const('SSH_KEYTYPE_ED25519', 'libssh/libssh.h')

create_makefile('libssh/libssh_ruby')
4 changes: 4 additions & 0 deletions ext/libssh_ruby/libssh_ruby.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "libssh_ruby.h"
#include <libssh/callbacks.h>

VALUE rb_mLibSSH;

Expand Down Expand Up @@ -26,6 +27,9 @@ static VALUE m_version(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self)) {
}

void Init_libssh_ruby(void) {
ssh_threads_set_callbacks(ssh_threads_get_pthread());
ssh_init();

rb_mLibSSH = rb_define_module("LibSSH");

/* @see Session#server_known */
Expand Down

0 comments on commit 5f394fa

Please sign in to comment.