diff --git a/Changelog.rst b/Changelog.rst index 73bb4f65..cd5f5cb4 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -14,6 +14,8 @@ Changes * `ssh2.sftp_handle.SFTPHandle.closed` is now a public property indicating whether `ssh2.sftp_handle.SFTPHandle.close` was called on a `SFTPHandle` or not. * Added `ssh2.channel.Channel.signal` function for sending signals over SSH to an open channel - #221 +* Added `ssh2.session.Session.direct_streamlocal_ex` for creating `Channel` objects tunneling a local UNIX socket + via the remote host to a third party. 1.1.2 diff --git a/ci/integration_tests/test_session.py b/ci/integration_tests/test_session.py index 97c8a403..f1818922 100644 --- a/ci/integration_tests/test_session.py +++ b/ci/integration_tests/test_session.py @@ -340,3 +340,21 @@ def test_non_blocking_multi_chan(self): def test_userauth_kb_with_callback(self): my_cb = MagicMock() self.assertRaises(AuthenticationError, self.session.userauth_keyboardinteractive_callback, self.user, my_cb) + + def test_direct_streamlocal(self): + unix_sock_path = '/tmp/my_sock' + try: + os.unlink(unix_sock_path) + except OSError: + pass + unix_sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + unix_sock.bind(unix_sock_path) + try: + unix_sock.listen(1) + self.assertEqual(self._auth(), 0) + chan = self.session.direct_streamlocal_ex(unix_sock_path, '127.0.0.1', 12345) + self.assertTrue(chan is not None) + self.assertIsInstance(chan, Channel) + finally: + unix_sock.close() + os.unlink(unix_sock_path) diff --git a/ssh2/c_ssh2.pxd b/ssh2/c_ssh2.pxd index 77569130..de702b53 100644 --- a/ssh2/c_ssh2.pxd +++ b/ssh2/c_ssh2.pxd @@ -221,6 +221,9 @@ cdef extern from "libssh2.h" nogil: LIBSSH2_CHANNEL *libssh2_channel_direct_tcpip( LIBSSH2_SESSION *session, const char *host, int port) + LIBSSH2_CHANNEL *libssh2_channel_direct_streamlocal_ex( + LIBSSH2_SESSION * session, const char *socket_path, + const char *shost, int sport) LIBSSH2_LISTENER *libssh2_channel_forward_listen_ex( LIBSSH2_SESSION *session, const char *host, int port, int *bound_port, int queue_maxsize) diff --git a/ssh2/session.c b/ssh2/session.c index 38788dbb..c31e4776 100644 --- a/ssh2/session.c +++ b/ssh2/session.c @@ -2836,6 +2836,7 @@ static const char __pyx_k_Session[] = "Session"; static const char __pyx_k_b_prefs[] = "b_prefs"; static const char __pyx_k_b_shost[] = "b_shost"; static const char __pyx_k_c_prefs[] = "c_prefs"; +static const char __pyx_k_c_shost[] = "c_shost"; static const char __pyx_k_channel[] = "channel"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_enabled[] = "enabled"; @@ -2917,6 +2918,7 @@ static const char __pyx_k_method_pref[] = "method_pref"; static const char __pyx_k_method_type[] = "method_type"; static const char __pyx_k_publickey_2[] = "_publickey"; static const char __pyx_k_set_timeout[] = "set_timeout"; +static const char __pyx_k_socket_path[] = "socket_path"; static const char __pyx_k_A_2_1_1_k_HA[] = "\200A\360\010\000\t\032\320\0312\260!\2601\340\r\016\330\014\027\320\0271\260\021\260$\260k\300\021\330\014\020\220\t\230\021\330\010\014\210H\220A\330\010\017\320\017!\240\021\240!"; static const char __pyx_k_A_q_Kq_6_A_q[] = "\200A\360\024\000\016\017\330\014\032\320\032/\250q\260\004\260K\270q\330\010\013\2106\220\023\220A\330\014\r\330\010\021\220\021\330\010\017\210q"; static const char __pyx_k_ChannelError[] = "ChannelError"; @@ -2936,6 +2938,8 @@ static const char __pyx_k_ssh2_session[] = "ssh2.session"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_username_len[] = "username_len"; static const char __pyx_k_A6_Q_Q_9_aq_Q[] = "\200A\3606\000\t!\240\010\250\001\250\021\330\010%\240Q\340\010\014\320\014\035\230Q\330\010\023\320\0239\270\021\330\014\020\220\013\230;\240a\240q\330\010\014\320\014\035\230Q\330\010\017\320\017!\240\021\240!"; +static const char __pyx_k_b_socket_path[] = "b_socket_path"; +static const char __pyx_k_c_socket_path[] = "c_socket_path"; static const char __pyx_k_queue_maxsize[] = "queue_maxsize"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_userauth_list[] = "userauth_list"; @@ -3004,6 +3008,7 @@ static const char __pyx_k_LIBSSH2_FLAG_COMPRESS[] = "LIBSSH2_FLAG_COMPRESS"; static const char __pyx_k_LIBSSH2_METHOD_MAC_CS[] = "LIBSSH2_METHOD_MAC_CS"; static const char __pyx_k_LIBSSH2_METHOD_MAC_SC[] = "LIBSSH2_METHOD_MAC_SC"; static const char __pyx_k_Session_userauth_list[] = "Session.userauth_list"; +static const char __pyx_k_direct_streamlocal_ex[] = "direct_streamlocal_ex"; static const char __pyx_k_A_q_3aq_0_K_6_A_vQa_t6[] = "\200A\360\010\000\t!\240\010\250\001\250\021\330\010\037\230q\330\010#\2403\240a\240q\360\006\000\016\017\330\014\032\320\0320\260\001\330\020\024\220K\230{\250!\330\010\013\2106\220\023\220A\330\014\r\330\010\017\210v\220Q\220a\330\010\017\210t\2206\230\021\230!"; static const char __pyx_k_LIBSSH2_METHOD_COMP_CS[] = "LIBSSH2_METHOD_COMP_CS"; static const char __pyx_k_LIBSSH2_METHOD_COMP_SC[] = "LIBSSH2_METHOD_COMP_SC"; @@ -3050,6 +3055,7 @@ static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_UNKNOWN[] = "LIBSSH2_HOSTKEY_TYPE static const char __pyx_k_MethodType___setstate_cython[] = "MethodType.__setstate_cython__"; static const char __pyx_k_userauth_keyboardinteractive[] = "userauth_keyboardinteractive"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_INBOUND[] = "LIBSSH2_SESSION_BLOCK_INBOUND"; +static const char __pyx_k_Session_direct_streamlocal_ex[] = "Session.direct_streamlocal_ex"; static const char __pyx_k_userauth_publickey_frommemory[] = "userauth_publickey_frommemory"; static const char __pyx_k_8_q_HE_Jhaq_1_7_A_a_q_KwfA_9Cq[] = "\320\0048\270\017\300q\360.\000\t\035\230H\240E\250\023\250J\260h\270a\270q\330\010\033\2301\330\010\013\2107\220'\230\021\330\014\024\220A\330\010\036\230a\330\r\016\330\014\035\320\035?\270q\330\020\024\220K\230w\240f\250A\250\\\270\021\330\010\013\2109\220C\220q\330\014\024\320\024&\240g\320-H\310\001\330\020\024\220M\240\021\330\010\020\220\n\230!\230:\240W\250A"; static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_256[] = "LIBSSH2_HOSTKEY_TYPE_ECDSA_256"; @@ -3057,6 +3063,7 @@ static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_384[] = "LIBSSH2_HOSTKEY_TY static const char __pyx_k_LIBSSH2_HOSTKEY_TYPE_ECDSA_521[] = "LIBSSH2_HOSTKEY_TYPE_ECDSA_521"; static const char __pyx_k_LIBSSH2_SESSION_BLOCK_OUTBOUND[] = "LIBSSH2_SESSION_BLOCK_OUTBOUND"; static const char __pyx_k_Session_userauth_authenticated[] = "Session.userauth_authenticated"; +static const char __pyx_k_A_81A_XQa_1_B_4_Raajjk_83a_W_Gq[] = "\200A\360\"\000\t$\2408\2501\250A\330\010\035\230X\240Q\240a\330\010)\250\021\330\010#\2401\340\r\016\330\014\034\320\034B\300!\3004\300{\320Ra\320aj\320jk\330\010\013\2108\2203\220a\330\014\023\320\023%\240W\320,G\300q\330\020\024\220A\330\010\017\210y\230\001\230\031\240!"; static const char __pyx_k_A_6a_K_1_3b_Qa_1_1_1F_6_d_uAQ_1D[] = "\200A\360\026\000\016\017\330\014\027\320\0276\260a\330\020\024\220K\230{\250(\260!\2601\330\010\013\2103\210b\220\001\330\014\023\320\023%\240Q\240a\330\r\020\220\003\2201\330\014\023\2201\330\010\t\330\014\023\2201\220F\230!\2306\240\021\240$\240d\250%\250u\260A\260Q\340\021\022\330\026#\2401\240D\250\013\2601\330\010\017\210q"; static const char __pyx_k_A_HAQ_XQa_1_A_A_KwfHA_83a_W_Gq_A[] = "\200A\360\006\000\t\035\230H\240A\240Q\330\010\035\230X\240Q\240a\330\010\033\2301\330\010\034\230A\330\r\016\330\014\034\320\034<\270A\330\020\024\220K\230w\240f\250H\260A\330\010\013\2108\2203\220a\330\014\023\320\023%\240W\320,G\300q\330\020\024\220A\330\010\017\210y\230\001\230\031\240!"; static const char __pyx_k_Error_retrieving_server_host_key[] = "Error retrieving server host key for session"; @@ -3104,31 +3111,32 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_38agent_auth(struct __pyx_obj_ static PyObject *__pyx_pf_4ssh2_7session_7Session_40open_session(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_42direct_tcpip_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port, PyObject *__pyx_v_shost, int __pyx_v_sport); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_44direct_tcpip(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_host, int __pyx_v_port); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_FlagType *__pyx_v_flag, PyObject *__pyx_v_enabled); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_queue_maxsize, PyObject *__pyx_v_host, int __pyx_v_port); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, size_t __pyx_v_msg_size); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_errcode, PyObject *__pyx_v_errmsg); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, libssh2_uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_hash_type); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_want_reply, unsigned int __pyx_v_interval); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type, PyObject *__pyx_v_prefs); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_46direct_streamlocal_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_socket_path, PyObject *__pyx_v_shost, int __pyx_v_sport); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_48block_directions(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_50flag(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_FlagType *__pyx_v_flag, PyObject *__pyx_v_enabled); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_54forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_queue_maxsize, PyObject *__pyx_v_host, int __pyx_v_port); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_56sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, size_t __pyx_v_msg_size); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_60last_errno(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_62set_last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_errcode, PyObject *__pyx_v_errmsg); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_70scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, libssh2_uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_72publickey_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey_hash(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_hash_type); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_76hostkey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_78knownhost_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_config(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_want_reply, unsigned int __pyx_v_interval); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_82keepalive_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_84supported_algs(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_86methods(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_88method_pref(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type, PyObject *__pyx_v_prefs); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_4sock___get__(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_4ssh2_7session_7Session_13_kbd_callback___get__(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_88__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_4ssh2_7session_7Session_90__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_90__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4ssh2_7session_7Session_92__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_4ssh2_7session_Session(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_7session_MethodType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_4ssh2_7session_FlagType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3192,8 +3200,8 @@ typedef struct { PyTypeObject *__pyx_ptype_4ssh2_7session___pyx_defaults; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_tuple[5]; - PyObject *__pyx_codeobj_tab[49]; - PyObject *__pyx_string_tab[258]; + PyObject *__pyx_codeobj_tab[50]; + PyObject *__pyx_string_tab[264]; PyObject *__pyx_int_0; PyObject *__pyx_int_1024; /* #### Code section: module_state_contents ### */ @@ -3281,216 +3289,222 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_Session_agent_auth __pyx_string_tab[45] #define __pyx_n_u_Session_agent_init __pyx_string_tab[46] #define __pyx_n_u_Session_block_directions __pyx_string_tab[47] -#define __pyx_n_u_Session_direct_tcpip __pyx_string_tab[48] -#define __pyx_n_u_Session_direct_tcpip_ex __pyx_string_tab[49] -#define __pyx_n_u_Session_disconnect __pyx_string_tab[50] -#define __pyx_n_u_Session_flag __pyx_string_tab[51] -#define __pyx_n_u_Session_forward_listen __pyx_string_tab[52] -#define __pyx_n_u_Session_forward_listen_ex __pyx_string_tab[53] -#define __pyx_n_u_Session_get_blocking __pyx_string_tab[54] -#define __pyx_n_u_Session_get_timeout __pyx_string_tab[55] -#define __pyx_n_u_Session_handshake __pyx_string_tab[56] -#define __pyx_n_u_Session_hostkey __pyx_string_tab[57] -#define __pyx_n_u_Session_hostkey_hash __pyx_string_tab[58] -#define __pyx_n_u_Session_keepalive_config __pyx_string_tab[59] -#define __pyx_n_u_Session_keepalive_send __pyx_string_tab[60] -#define __pyx_n_u_Session_knownhost_init __pyx_string_tab[61] -#define __pyx_n_u_Session_last_errno __pyx_string_tab[62] -#define __pyx_n_u_Session_last_error __pyx_string_tab[63] -#define __pyx_n_u_Session_method_pref __pyx_string_tab[64] -#define __pyx_n_u_Session_methods __pyx_string_tab[65] -#define __pyx_n_u_Session_open_session __pyx_string_tab[66] -#define __pyx_n_u_Session_publickey_init __pyx_string_tab[67] -#define __pyx_n_u_Session_scp_recv __pyx_string_tab[68] -#define __pyx_n_u_Session_scp_recv2 __pyx_string_tab[69] -#define __pyx_n_u_Session_scp_send __pyx_string_tab[70] -#define __pyx_n_u_Session_scp_send64 __pyx_string_tab[71] -#define __pyx_n_u_Session_set_blocking __pyx_string_tab[72] -#define __pyx_n_u_Session_set_last_error __pyx_string_tab[73] -#define __pyx_n_u_Session_set_timeout __pyx_string_tab[74] -#define __pyx_n_u_Session_sftp_init __pyx_string_tab[75] -#define __pyx_n_u_Session_startup __pyx_string_tab[76] -#define __pyx_n_u_Session_supported_algs __pyx_string_tab[77] -#define __pyx_n_u_Session_userauth_authenticated __pyx_string_tab[78] -#define __pyx_n_u_Session_userauth_hostbased_fromf __pyx_string_tab[79] -#define __pyx_n_u_Session_userauth_keyboardinterac __pyx_string_tab[80] -#define __pyx_n_u_Session_userauth_keyboardinterac_2 __pyx_string_tab[81] -#define __pyx_n_u_Session_userauth_list __pyx_string_tab[82] -#define __pyx_n_u_Session_userauth_password __pyx_string_tab[83] -#define __pyx_n_u_Session_userauth_publickey __pyx_string_tab[84] -#define __pyx_n_u_Session_userauth_publickey_fromf __pyx_string_tab[85] -#define __pyx_n_u_Session_userauth_publickey_fromm __pyx_string_tab[86] -#define __pyx_n_u_TypeError __pyx_string_tab[87] -#define __pyx_n_u_ValueError __pyx_string_tab[88] -#define __pyx_kp_b__2 __pyx_string_tab[89] -#define __pyx_kp_u__2 __pyx_string_tab[90] -#define __pyx_kp_u__3 __pyx_string_tab[91] -#define __pyx_kp_u__4 __pyx_string_tab[92] -#define __pyx_kp_u_add_note __pyx_string_tab[93] -#define __pyx_n_u_agent __pyx_string_tab[94] -#define __pyx_n_u_agent_auth __pyx_string_tab[95] -#define __pyx_n_u_agent_init __pyx_string_tab[96] -#define __pyx_n_u_algs __pyx_string_tab[97] -#define __pyx_n_u_args __pyx_string_tab[98] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[99] -#define __pyx_n_u_atime __pyx_string_tab[100] -#define __pyx_n_u_auth __pyx_string_tab[101] -#define __pyx_n_u_auth_2 __pyx_string_tab[102] -#define __pyx_n_u_b_errmsg __pyx_string_tab[103] -#define __pyx_n_u_b_hash __pyx_string_tab[104] -#define __pyx_n_u_b_host __pyx_string_tab[105] -#define __pyx_n_u_b_hostname __pyx_string_tab[106] -#define __pyx_n_u_b_passphrase __pyx_string_tab[107] -#define __pyx_n_u_b_password __pyx_string_tab[108] -#define __pyx_n_u_b_path __pyx_string_tab[109] -#define __pyx_n_u_b_prefs __pyx_string_tab[110] -#define __pyx_n_u_b_privatekey __pyx_string_tab[111] -#define __pyx_n_u_b_publickey __pyx_string_tab[112] -#define __pyx_n_u_b_shost __pyx_string_tab[113] -#define __pyx_n_u_b_username __pyx_string_tab[114] -#define __pyx_n_u_block_directions __pyx_string_tab[115] -#define __pyx_n_u_blocking __pyx_string_tab[116] -#define __pyx_n_u_bound_port __pyx_string_tab[117] -#define __pyx_n_u_c_algs __pyx_string_tab[118] -#define __pyx_n_u_c_prefs __pyx_string_tab[119] -#define __pyx_n_u_c_seconds __pyx_string_tab[120] -#define __pyx_n_u_callback __pyx_string_tab[121] -#define __pyx_n_u_channel __pyx_string_tab[122] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[123] -#define __pyx_n_u_direct_tcpip __pyx_string_tab[124] -#define __pyx_n_u_direct_tcpip_ex __pyx_string_tab[125] -#define __pyx_kp_u_disable __pyx_string_tab[126] -#define __pyx_n_u_disconnect __pyx_string_tab[127] -#define __pyx_kp_u_enable __pyx_string_tab[128] -#define __pyx_n_u_enabled __pyx_string_tab[129] -#define __pyx_n_u_errcode __pyx_string_tab[130] -#define __pyx_n_u_errmsg __pyx_string_tab[131] -#define __pyx_n_u_errmsg_2 __pyx_string_tab[132] -#define __pyx_n_u_errmsg_len __pyx_string_tab[133] -#define __pyx_n_u_error_msg __pyx_string_tab[134] -#define __pyx_n_u_exceptions __pyx_string_tab[135] -#define __pyx_n_u_fileinfo __pyx_string_tab[136] -#define __pyx_n_u_flag __pyx_string_tab[137] -#define __pyx_n_u_forward_listen __pyx_string_tab[138] -#define __pyx_n_u_forward_listen_ex __pyx_string_tab[139] -#define __pyx_n_u_func __pyx_string_tab[140] -#define __pyx_kp_u_gc __pyx_string_tab[141] -#define __pyx_n_u_get_blocking __pyx_string_tab[142] -#define __pyx_n_u_get_timeout __pyx_string_tab[143] -#define __pyx_n_u_getstate __pyx_string_tab[144] -#define __pyx_n_u_handshake __pyx_string_tab[145] -#define __pyx_n_u_hash __pyx_string_tab[146] -#define __pyx_n_u_hash_type __pyx_string_tab[147] -#define __pyx_n_u_host __pyx_string_tab[148] -#define __pyx_n_u_host_2 __pyx_string_tab[149] -#define __pyx_n_u_hostkey __pyx_string_tab[150] -#define __pyx_n_u_hostkey_hash __pyx_string_tab[151] -#define __pyx_n_u_hostname __pyx_string_tab[152] -#define __pyx_n_u_hostname_2 __pyx_string_tab[153] -#define __pyx_n_u_i __pyx_string_tab[154] -#define __pyx_n_u_identity __pyx_string_tab[155] -#define __pyx_n_u_interval __pyx_string_tab[156] -#define __pyx_n_u_is_coroutine __pyx_string_tab[157] -#define __pyx_kp_u_isenabled __pyx_string_tab[158] -#define __pyx_n_u_keepalive_config __pyx_string_tab[159] -#define __pyx_n_u_keepalive_send __pyx_string_tab[160] -#define __pyx_n_u_key __pyx_string_tab[161] -#define __pyx_n_u_key_2 __pyx_string_tab[162] -#define __pyx_n_u_key_len __pyx_string_tab[163] -#define __pyx_n_u_key_type __pyx_string_tab[164] -#define __pyx_n_u_known_hosts __pyx_string_tab[165] -#define __pyx_n_u_knownhost_init __pyx_string_tab[166] -#define __pyx_n_u_last_errno __pyx_string_tab[167] -#define __pyx_n_u_last_error __pyx_string_tab[168] -#define __pyx_n_u_listener __pyx_string_tab[169] -#define __pyx_n_u_main __pyx_string_tab[170] -#define __pyx_n_u_method_pref __pyx_string_tab[171] -#define __pyx_n_u_method_type __pyx_string_tab[172] -#define __pyx_n_u_methods __pyx_string_tab[173] -#define __pyx_n_u_mode __pyx_string_tab[174] -#define __pyx_n_u_module __pyx_string_tab[175] -#define __pyx_n_u_msg __pyx_string_tab[176] -#define __pyx_n_u_msg_size __pyx_string_tab[177] -#define __pyx_n_u_mtime __pyx_string_tab[178] -#define __pyx_n_u_name __pyx_string_tab[179] -#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[180] -#define __pyx_n_u_open_session __pyx_string_tab[181] -#define __pyx_n_u_passphrase __pyx_string_tab[182] -#define __pyx_n_u_passphrase_2 __pyx_string_tab[183] -#define __pyx_n_u_passwd __pyx_string_tab[184] -#define __pyx_n_u_password __pyx_string_tab[185] -#define __pyx_n_u_password_2 __pyx_string_tab[186] -#define __pyx_n_u_path __pyx_string_tab[187] -#define __pyx_n_u_path_2 __pyx_string_tab[188] -#define __pyx_n_u_pkey __pyx_string_tab[189] -#define __pyx_n_u_pop __pyx_string_tab[190] -#define __pyx_n_u_port __pyx_string_tab[191] -#define __pyx_n_u_prefs __pyx_string_tab[192] -#define __pyx_n_u_prev __pyx_string_tab[193] -#define __pyx_n_u_privatekey __pyx_string_tab[194] -#define __pyx_n_u_privatekey_2 __pyx_string_tab[195] -#define __pyx_n_u_privatekeydata_len __pyx_string_tab[196] -#define __pyx_n_u_privatekeyfiledata __pyx_string_tab[197] -#define __pyx_n_u_privatekeyfiledata_2 __pyx_string_tab[198] -#define __pyx_n_u_pubkeydata __pyx_string_tab[199] -#define __pyx_n_u_pubkeydata_2 __pyx_string_tab[200] -#define __pyx_n_u_pubkeydata_len __pyx_string_tab[201] -#define __pyx_n_u_publickey __pyx_string_tab[202] -#define __pyx_n_u_publickey_2 __pyx_string_tab[203] -#define __pyx_n_u_publickey_init __pyx_string_tab[204] -#define __pyx_n_u_publickeyfiledata __pyx_string_tab[205] -#define __pyx_n_u_publickeyfiledata_2 __pyx_string_tab[206] -#define __pyx_n_u_pyx_state __pyx_string_tab[207] -#define __pyx_n_u_qualname __pyx_string_tab[208] -#define __pyx_n_u_queue_maxsize __pyx_string_tab[209] -#define __pyx_n_u_range __pyx_string_tab[210] -#define __pyx_n_u_rc __pyx_string_tab[211] -#define __pyx_n_u_reduce __pyx_string_tab[212] -#define __pyx_n_u_reduce_cython __pyx_string_tab[213] -#define __pyx_n_u_reduce_ex __pyx_string_tab[214] -#define __pyx_n_u_scp_recv __pyx_string_tab[215] -#define __pyx_n_u_scp_recv2 __pyx_string_tab[216] -#define __pyx_n_u_scp_send __pyx_string_tab[217] -#define __pyx_n_u_scp_send64 __pyx_string_tab[218] -#define __pyx_n_u_seconds __pyx_string_tab[219] -#define __pyx_n_u_self __pyx_string_tab[220] -#define __pyx_n_u_set_blocking __pyx_string_tab[221] -#define __pyx_n_u_set_last_error __pyx_string_tab[222] -#define __pyx_n_u_set_name __pyx_string_tab[223] -#define __pyx_n_u_set_timeout __pyx_string_tab[224] -#define __pyx_n_u_setstate __pyx_string_tab[225] -#define __pyx_n_u_setstate_cython __pyx_string_tab[226] -#define __pyx_n_u_sftp __pyx_string_tab[227] -#define __pyx_n_u_sftp_init __pyx_string_tab[228] -#define __pyx_n_u_shost __pyx_string_tab[229] -#define __pyx_n_u_shost_2 __pyx_string_tab[230] -#define __pyx_n_u_size __pyx_string_tab[231] -#define __pyx_n_u_sock __pyx_string_tab[232] -#define __pyx_n_u_sock_2 __pyx_string_tab[233] -#define __pyx_n_u_sport __pyx_string_tab[234] -#define __pyx_n_u_ssh2_session __pyx_string_tab[235] -#define __pyx_kp_u_ssh2_session_pyx __pyx_string_tab[236] -#define __pyx_n_u_startup __pyx_string_tab[237] -#define __pyx_n_u_statinfo __pyx_string_tab[238] -#define __pyx_kp_u_stringsource __pyx_string_tab[239] -#define __pyx_n_u_supported_algs __pyx_string_tab[240] -#define __pyx_n_u_test __pyx_string_tab[241] -#define __pyx_n_u_timeout __pyx_string_tab[242] -#define __pyx_n_u_userauth_authenticated __pyx_string_tab[243] -#define __pyx_n_u_userauth_hostbased_fromfile __pyx_string_tab[244] -#define __pyx_n_u_userauth_keyboardinteractive __pyx_string_tab[245] -#define __pyx_n_u_userauth_keyboardinteractive_cal __pyx_string_tab[246] -#define __pyx_n_u_userauth_keyboardinteractive_loc __pyx_string_tab[247] -#define __pyx_n_u_userauth_list __pyx_string_tab[248] -#define __pyx_n_u_userauth_password __pyx_string_tab[249] -#define __pyx_n_u_userauth_publickey __pyx_string_tab[250] -#define __pyx_n_u_userauth_publickey_fromfile __pyx_string_tab[251] -#define __pyx_n_u_userauth_publickey_frommemory __pyx_string_tab[252] -#define __pyx_n_u_username __pyx_string_tab[253] -#define __pyx_n_u_username_2 __pyx_string_tab[254] -#define __pyx_n_u_username_len __pyx_string_tab[255] -#define __pyx_n_u_value __pyx_string_tab[256] -#define __pyx_n_u_want_reply __pyx_string_tab[257] +#define __pyx_n_u_Session_direct_streamlocal_ex __pyx_string_tab[48] +#define __pyx_n_u_Session_direct_tcpip __pyx_string_tab[49] +#define __pyx_n_u_Session_direct_tcpip_ex __pyx_string_tab[50] +#define __pyx_n_u_Session_disconnect __pyx_string_tab[51] +#define __pyx_n_u_Session_flag __pyx_string_tab[52] +#define __pyx_n_u_Session_forward_listen __pyx_string_tab[53] +#define __pyx_n_u_Session_forward_listen_ex __pyx_string_tab[54] +#define __pyx_n_u_Session_get_blocking __pyx_string_tab[55] +#define __pyx_n_u_Session_get_timeout __pyx_string_tab[56] +#define __pyx_n_u_Session_handshake __pyx_string_tab[57] +#define __pyx_n_u_Session_hostkey __pyx_string_tab[58] +#define __pyx_n_u_Session_hostkey_hash __pyx_string_tab[59] +#define __pyx_n_u_Session_keepalive_config __pyx_string_tab[60] +#define __pyx_n_u_Session_keepalive_send __pyx_string_tab[61] +#define __pyx_n_u_Session_knownhost_init __pyx_string_tab[62] +#define __pyx_n_u_Session_last_errno __pyx_string_tab[63] +#define __pyx_n_u_Session_last_error __pyx_string_tab[64] +#define __pyx_n_u_Session_method_pref __pyx_string_tab[65] +#define __pyx_n_u_Session_methods __pyx_string_tab[66] +#define __pyx_n_u_Session_open_session __pyx_string_tab[67] +#define __pyx_n_u_Session_publickey_init __pyx_string_tab[68] +#define __pyx_n_u_Session_scp_recv __pyx_string_tab[69] +#define __pyx_n_u_Session_scp_recv2 __pyx_string_tab[70] +#define __pyx_n_u_Session_scp_send __pyx_string_tab[71] +#define __pyx_n_u_Session_scp_send64 __pyx_string_tab[72] +#define __pyx_n_u_Session_set_blocking __pyx_string_tab[73] +#define __pyx_n_u_Session_set_last_error __pyx_string_tab[74] +#define __pyx_n_u_Session_set_timeout __pyx_string_tab[75] +#define __pyx_n_u_Session_sftp_init __pyx_string_tab[76] +#define __pyx_n_u_Session_startup __pyx_string_tab[77] +#define __pyx_n_u_Session_supported_algs __pyx_string_tab[78] +#define __pyx_n_u_Session_userauth_authenticated __pyx_string_tab[79] +#define __pyx_n_u_Session_userauth_hostbased_fromf __pyx_string_tab[80] +#define __pyx_n_u_Session_userauth_keyboardinterac __pyx_string_tab[81] +#define __pyx_n_u_Session_userauth_keyboardinterac_2 __pyx_string_tab[82] +#define __pyx_n_u_Session_userauth_list __pyx_string_tab[83] +#define __pyx_n_u_Session_userauth_password __pyx_string_tab[84] +#define __pyx_n_u_Session_userauth_publickey __pyx_string_tab[85] +#define __pyx_n_u_Session_userauth_publickey_fromf __pyx_string_tab[86] +#define __pyx_n_u_Session_userauth_publickey_fromm __pyx_string_tab[87] +#define __pyx_n_u_TypeError __pyx_string_tab[88] +#define __pyx_n_u_ValueError __pyx_string_tab[89] +#define __pyx_kp_b__2 __pyx_string_tab[90] +#define __pyx_kp_u__2 __pyx_string_tab[91] +#define __pyx_kp_u__3 __pyx_string_tab[92] +#define __pyx_kp_u__4 __pyx_string_tab[93] +#define __pyx_kp_u_add_note __pyx_string_tab[94] +#define __pyx_n_u_agent __pyx_string_tab[95] +#define __pyx_n_u_agent_auth __pyx_string_tab[96] +#define __pyx_n_u_agent_init __pyx_string_tab[97] +#define __pyx_n_u_algs __pyx_string_tab[98] +#define __pyx_n_u_args __pyx_string_tab[99] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[100] +#define __pyx_n_u_atime __pyx_string_tab[101] +#define __pyx_n_u_auth __pyx_string_tab[102] +#define __pyx_n_u_auth_2 __pyx_string_tab[103] +#define __pyx_n_u_b_errmsg __pyx_string_tab[104] +#define __pyx_n_u_b_hash __pyx_string_tab[105] +#define __pyx_n_u_b_host __pyx_string_tab[106] +#define __pyx_n_u_b_hostname __pyx_string_tab[107] +#define __pyx_n_u_b_passphrase __pyx_string_tab[108] +#define __pyx_n_u_b_password __pyx_string_tab[109] +#define __pyx_n_u_b_path __pyx_string_tab[110] +#define __pyx_n_u_b_prefs __pyx_string_tab[111] +#define __pyx_n_u_b_privatekey __pyx_string_tab[112] +#define __pyx_n_u_b_publickey __pyx_string_tab[113] +#define __pyx_n_u_b_shost __pyx_string_tab[114] +#define __pyx_n_u_b_socket_path __pyx_string_tab[115] +#define __pyx_n_u_b_username __pyx_string_tab[116] +#define __pyx_n_u_block_directions __pyx_string_tab[117] +#define __pyx_n_u_blocking __pyx_string_tab[118] +#define __pyx_n_u_bound_port __pyx_string_tab[119] +#define __pyx_n_u_c_algs __pyx_string_tab[120] +#define __pyx_n_u_c_prefs __pyx_string_tab[121] +#define __pyx_n_u_c_seconds __pyx_string_tab[122] +#define __pyx_n_u_c_shost __pyx_string_tab[123] +#define __pyx_n_u_c_socket_path __pyx_string_tab[124] +#define __pyx_n_u_callback __pyx_string_tab[125] +#define __pyx_n_u_channel __pyx_string_tab[126] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[127] +#define __pyx_n_u_direct_streamlocal_ex __pyx_string_tab[128] +#define __pyx_n_u_direct_tcpip __pyx_string_tab[129] +#define __pyx_n_u_direct_tcpip_ex __pyx_string_tab[130] +#define __pyx_kp_u_disable __pyx_string_tab[131] +#define __pyx_n_u_disconnect __pyx_string_tab[132] +#define __pyx_kp_u_enable __pyx_string_tab[133] +#define __pyx_n_u_enabled __pyx_string_tab[134] +#define __pyx_n_u_errcode __pyx_string_tab[135] +#define __pyx_n_u_errmsg __pyx_string_tab[136] +#define __pyx_n_u_errmsg_2 __pyx_string_tab[137] +#define __pyx_n_u_errmsg_len __pyx_string_tab[138] +#define __pyx_n_u_error_msg __pyx_string_tab[139] +#define __pyx_n_u_exceptions __pyx_string_tab[140] +#define __pyx_n_u_fileinfo __pyx_string_tab[141] +#define __pyx_n_u_flag __pyx_string_tab[142] +#define __pyx_n_u_forward_listen __pyx_string_tab[143] +#define __pyx_n_u_forward_listen_ex __pyx_string_tab[144] +#define __pyx_n_u_func __pyx_string_tab[145] +#define __pyx_kp_u_gc __pyx_string_tab[146] +#define __pyx_n_u_get_blocking __pyx_string_tab[147] +#define __pyx_n_u_get_timeout __pyx_string_tab[148] +#define __pyx_n_u_getstate __pyx_string_tab[149] +#define __pyx_n_u_handshake __pyx_string_tab[150] +#define __pyx_n_u_hash __pyx_string_tab[151] +#define __pyx_n_u_hash_type __pyx_string_tab[152] +#define __pyx_n_u_host __pyx_string_tab[153] +#define __pyx_n_u_host_2 __pyx_string_tab[154] +#define __pyx_n_u_hostkey __pyx_string_tab[155] +#define __pyx_n_u_hostkey_hash __pyx_string_tab[156] +#define __pyx_n_u_hostname __pyx_string_tab[157] +#define __pyx_n_u_hostname_2 __pyx_string_tab[158] +#define __pyx_n_u_i __pyx_string_tab[159] +#define __pyx_n_u_identity __pyx_string_tab[160] +#define __pyx_n_u_interval __pyx_string_tab[161] +#define __pyx_n_u_is_coroutine __pyx_string_tab[162] +#define __pyx_kp_u_isenabled __pyx_string_tab[163] +#define __pyx_n_u_keepalive_config __pyx_string_tab[164] +#define __pyx_n_u_keepalive_send __pyx_string_tab[165] +#define __pyx_n_u_key __pyx_string_tab[166] +#define __pyx_n_u_key_2 __pyx_string_tab[167] +#define __pyx_n_u_key_len __pyx_string_tab[168] +#define __pyx_n_u_key_type __pyx_string_tab[169] +#define __pyx_n_u_known_hosts __pyx_string_tab[170] +#define __pyx_n_u_knownhost_init __pyx_string_tab[171] +#define __pyx_n_u_last_errno __pyx_string_tab[172] +#define __pyx_n_u_last_error __pyx_string_tab[173] +#define __pyx_n_u_listener __pyx_string_tab[174] +#define __pyx_n_u_main __pyx_string_tab[175] +#define __pyx_n_u_method_pref __pyx_string_tab[176] +#define __pyx_n_u_method_type __pyx_string_tab[177] +#define __pyx_n_u_methods __pyx_string_tab[178] +#define __pyx_n_u_mode __pyx_string_tab[179] +#define __pyx_n_u_module __pyx_string_tab[180] +#define __pyx_n_u_msg __pyx_string_tab[181] +#define __pyx_n_u_msg_size __pyx_string_tab[182] +#define __pyx_n_u_mtime __pyx_string_tab[183] +#define __pyx_n_u_name __pyx_string_tab[184] +#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[185] +#define __pyx_n_u_open_session __pyx_string_tab[186] +#define __pyx_n_u_passphrase __pyx_string_tab[187] +#define __pyx_n_u_passphrase_2 __pyx_string_tab[188] +#define __pyx_n_u_passwd __pyx_string_tab[189] +#define __pyx_n_u_password __pyx_string_tab[190] +#define __pyx_n_u_password_2 __pyx_string_tab[191] +#define __pyx_n_u_path __pyx_string_tab[192] +#define __pyx_n_u_path_2 __pyx_string_tab[193] +#define __pyx_n_u_pkey __pyx_string_tab[194] +#define __pyx_n_u_pop __pyx_string_tab[195] +#define __pyx_n_u_port __pyx_string_tab[196] +#define __pyx_n_u_prefs __pyx_string_tab[197] +#define __pyx_n_u_prev __pyx_string_tab[198] +#define __pyx_n_u_privatekey __pyx_string_tab[199] +#define __pyx_n_u_privatekey_2 __pyx_string_tab[200] +#define __pyx_n_u_privatekeydata_len __pyx_string_tab[201] +#define __pyx_n_u_privatekeyfiledata __pyx_string_tab[202] +#define __pyx_n_u_privatekeyfiledata_2 __pyx_string_tab[203] +#define __pyx_n_u_pubkeydata __pyx_string_tab[204] +#define __pyx_n_u_pubkeydata_2 __pyx_string_tab[205] +#define __pyx_n_u_pubkeydata_len __pyx_string_tab[206] +#define __pyx_n_u_publickey __pyx_string_tab[207] +#define __pyx_n_u_publickey_2 __pyx_string_tab[208] +#define __pyx_n_u_publickey_init __pyx_string_tab[209] +#define __pyx_n_u_publickeyfiledata __pyx_string_tab[210] +#define __pyx_n_u_publickeyfiledata_2 __pyx_string_tab[211] +#define __pyx_n_u_pyx_state __pyx_string_tab[212] +#define __pyx_n_u_qualname __pyx_string_tab[213] +#define __pyx_n_u_queue_maxsize __pyx_string_tab[214] +#define __pyx_n_u_range __pyx_string_tab[215] +#define __pyx_n_u_rc __pyx_string_tab[216] +#define __pyx_n_u_reduce __pyx_string_tab[217] +#define __pyx_n_u_reduce_cython __pyx_string_tab[218] +#define __pyx_n_u_reduce_ex __pyx_string_tab[219] +#define __pyx_n_u_scp_recv __pyx_string_tab[220] +#define __pyx_n_u_scp_recv2 __pyx_string_tab[221] +#define __pyx_n_u_scp_send __pyx_string_tab[222] +#define __pyx_n_u_scp_send64 __pyx_string_tab[223] +#define __pyx_n_u_seconds __pyx_string_tab[224] +#define __pyx_n_u_self __pyx_string_tab[225] +#define __pyx_n_u_set_blocking __pyx_string_tab[226] +#define __pyx_n_u_set_last_error __pyx_string_tab[227] +#define __pyx_n_u_set_name __pyx_string_tab[228] +#define __pyx_n_u_set_timeout __pyx_string_tab[229] +#define __pyx_n_u_setstate __pyx_string_tab[230] +#define __pyx_n_u_setstate_cython __pyx_string_tab[231] +#define __pyx_n_u_sftp __pyx_string_tab[232] +#define __pyx_n_u_sftp_init __pyx_string_tab[233] +#define __pyx_n_u_shost __pyx_string_tab[234] +#define __pyx_n_u_shost_2 __pyx_string_tab[235] +#define __pyx_n_u_size __pyx_string_tab[236] +#define __pyx_n_u_sock __pyx_string_tab[237] +#define __pyx_n_u_sock_2 __pyx_string_tab[238] +#define __pyx_n_u_socket_path __pyx_string_tab[239] +#define __pyx_n_u_sport __pyx_string_tab[240] +#define __pyx_n_u_ssh2_session __pyx_string_tab[241] +#define __pyx_kp_u_ssh2_session_pyx __pyx_string_tab[242] +#define __pyx_n_u_startup __pyx_string_tab[243] +#define __pyx_n_u_statinfo __pyx_string_tab[244] +#define __pyx_kp_u_stringsource __pyx_string_tab[245] +#define __pyx_n_u_supported_algs __pyx_string_tab[246] +#define __pyx_n_u_test __pyx_string_tab[247] +#define __pyx_n_u_timeout __pyx_string_tab[248] +#define __pyx_n_u_userauth_authenticated __pyx_string_tab[249] +#define __pyx_n_u_userauth_hostbased_fromfile __pyx_string_tab[250] +#define __pyx_n_u_userauth_keyboardinteractive __pyx_string_tab[251] +#define __pyx_n_u_userauth_keyboardinteractive_cal __pyx_string_tab[252] +#define __pyx_n_u_userauth_keyboardinteractive_loc __pyx_string_tab[253] +#define __pyx_n_u_userauth_list __pyx_string_tab[254] +#define __pyx_n_u_userauth_password __pyx_string_tab[255] +#define __pyx_n_u_userauth_publickey __pyx_string_tab[256] +#define __pyx_n_u_userauth_publickey_fromfile __pyx_string_tab[257] +#define __pyx_n_u_userauth_publickey_frommemory __pyx_string_tab[258] +#define __pyx_n_u_username __pyx_string_tab[259] +#define __pyx_n_u_username_2 __pyx_string_tab[260] +#define __pyx_n_u_username_len __pyx_string_tab[261] +#define __pyx_n_u_value __pyx_string_tab[262] +#define __pyx_n_u_want_reply __pyx_string_tab[263] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3531,8 +3545,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_4ssh2_7session___pyx_defaults); Py_CLEAR(clear_module_state->__pyx_type_4ssh2_7session___pyx_defaults); for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<49; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<258; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<50; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<264; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1024); return 0; @@ -3575,8 +3589,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_4ssh2_7session___pyx_defaults); Py_VISIT(traverse_module_state->__pyx_type_4ssh2_7session___pyx_defaults); for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<49; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<258; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<50; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<264; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1024); return 0; @@ -10142,7 +10156,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44direct_tcpip(struct __pyx_ob * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< * - * def block_directions(self): + * def direct_streamlocal_ex(self, socket_path not None, shost not None, int sport): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error) @@ -10172,6 +10186,327 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44direct_tcpip(struct __pyx_ob } /* "ssh2/session.pyx":476 + * return PyChannel(channel, self) + * + * def direct_streamlocal_ex(self, socket_path not None, shost not None, int sport): # <<<<<<<<<<<<<< + * """ + * From libssh2 documentation: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_4ssh2_7session_7Session_47direct_streamlocal_ex(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_46direct_streamlocal_ex, "Session.direct_streamlocal_ex(self, socket_path, shost, int sport)\n\nFrom libssh2 documentation:\n Tunnel a UNIX socket connection through the SSH transport via the remote host to a third party.\n Communication from the client to the SSH server remains encrypted, communication from the server to the\n 3rd party host travels in cleartext.\n\n:param socket_path: Unix socket path to connect to using the SSH host as a proxy.\n:type socket_path: str\n:param shost: Host to tell the SSH server the connection originated on.\n:type shost: str\n:param sport: Port to tell the SSH server the connection originated from.\n:type sport: int\n:returns: A `Channel` object for the server intiated connection to the third party or an exception is raised\n on any error.\n:rtype: `ssh2.channel.Channel`"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_47direct_streamlocal_ex = {"direct_streamlocal_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_47direct_streamlocal_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_46direct_streamlocal_ex}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_47direct_streamlocal_ex(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_socket_path = 0; + PyObject *__pyx_v_shost = 0; + int __pyx_v_sport; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("direct_streamlocal_ex (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_socket_path,&__pyx_mstate_global->__pyx_n_u_shost,&__pyx_mstate_global->__pyx_n_u_sport,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 476, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 476, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 476, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 476, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "direct_streamlocal_ex", 0) < 0) __PYX_ERR(0, 476, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("direct_streamlocal_ex", 1, 3, 3, i); __PYX_ERR(0, 476, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 476, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 476, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 476, __pyx_L3_error) + } + __pyx_v_socket_path = values[0]; + __pyx_v_shost = values[1]; + __pyx_v_sport = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_sport == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("direct_streamlocal_ex", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 476, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("ssh2.session.Session.direct_streamlocal_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(((PyObject *)__pyx_v_socket_path) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "socket_path"); __PYX_ERR(0, 476, __pyx_L1_error) + } + if (unlikely(((PyObject *)__pyx_v_shost) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "shost"); __PYX_ERR(0, 476, __pyx_L1_error) + } + __pyx_r = __pyx_pf_4ssh2_7session_7Session_46direct_streamlocal_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_socket_path, __pyx_v_shost, __pyx_v_sport); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4ssh2_7session_7Session_46direct_streamlocal_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_socket_path, PyObject *__pyx_v_shost, int __pyx_v_sport) { + PyObject *__pyx_v_b_socket_path = 0; + PyObject *__pyx_v_b_shost = 0; + char const *__pyx_v_c_socket_path; + char const *__pyx_v_c_shost; + LIBSSH2_CHANNEL *__pyx_v_channel; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + char const *__pyx_t_2; + char const *__pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("direct_streamlocal_ex", 0); + + /* "ssh2/session.pyx":493 + * :rtype: `ssh2.channel.Channel` + * """ + * cdef bytes b_socket_path = to_bytes(socket_path) # <<<<<<<<<<<<<< + * cdef bytes b_shost = to_bytes(shost) + * cdef const char *c_socket_path = b_socket_path +*/ + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_socket_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_b_socket_path = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh2/session.pyx":494 + * """ + * cdef bytes b_socket_path = to_bytes(socket_path) + * cdef bytes b_shost = to_bytes(shost) # <<<<<<<<<<<<<< + * cdef const char *c_socket_path = b_socket_path + * cdef const char *c_shost = b_shost +*/ + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_shost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_b_shost = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh2/session.pyx":495 + * cdef bytes b_socket_path = to_bytes(socket_path) + * cdef bytes b_shost = to_bytes(shost) + * cdef const char *c_socket_path = b_socket_path # <<<<<<<<<<<<<< + * cdef const char *c_shost = b_shost + * cdef c_ssh2.LIBSSH2_CHANNEL *channel +*/ + if (unlikely(__pyx_v_b_socket_path == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 495, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_socket_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_v_c_socket_path = __pyx_t_2; + + /* "ssh2/session.pyx":496 + * cdef bytes b_shost = to_bytes(shost) + * cdef const char *c_socket_path = b_socket_path + * cdef const char *c_shost = b_shost # <<<<<<<<<<<<<< + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: +*/ + if (unlikely(__pyx_v_b_shost == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_b_shost); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_v_c_shost = __pyx_t_3; + + /* "ssh2/session.pyx":498 + * cdef const char *c_shost = b_shost + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: +*/ + { + PyThreadState *_save; + _save = NULL; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + /*try:*/ { + + /* "ssh2/session.pyx":499 + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) # <<<<<<<<<<<<<< + * if channel is NULL: + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( +*/ + __pyx_v_channel = libssh2_channel_direct_streamlocal_ex(__pyx_v_self->_session, __pyx_v_c_socket_path, __pyx_v_c_shost, __pyx_v_sport); + } + + /* "ssh2/session.pyx":498 + * cdef const char *c_shost = b_shost + * cdef c_ssh2.LIBSSH2_CHANNEL *channel + * with nogil: # <<<<<<<<<<<<<< + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: +*/ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh2/session.pyx":500 + * with nogil: + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: # <<<<<<<<<<<<<< + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) +*/ + __pyx_t_4 = (__pyx_v_channel == NULL); + if (__pyx_t_4) { + + /* "ssh2/session.pyx":501 + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< + * self._session)) + * return PyChannel(channel, self) +*/ + __Pyx_XDECREF(__pyx_r); + + /* "ssh2/session.pyx":502 + * if channel is NULL: + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) # <<<<<<<<<<<<<< + * return PyChannel(channel, self) + * +*/ + __pyx_t_5 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 501, __pyx_L1_error) + + /* "ssh2/session.pyx":501 + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< + * self._session)) + * return PyChannel(channel, self) +*/ + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":500 + * with nogil: + * channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + * if channel is NULL: # <<<<<<<<<<<<<< + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) +*/ + } + + /* "ssh2/session.pyx":503 + * return handle_error_codes(c_ssh2.libssh2_session_last_errno( + * self._session)) + * return PyChannel(channel, self) # <<<<<<<<<<<<<< + * + * def block_directions(self): +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "ssh2/session.pyx":476 + * return PyChannel(channel, self) + * + * def direct_streamlocal_ex(self, socket_path not None, shost not None, int sport): # <<<<<<<<<<<<<< + * """ + * From libssh2 documentation: +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh2.session.Session.direct_streamlocal_ex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_b_socket_path); + __Pyx_XDECREF(__pyx_v_b_shost); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh2/session.pyx":505 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -10180,16 +10515,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_44direct_tcpip(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_47block_directions(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_49block_directions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_46block_directions, "Session.block_directions(self)\n\nGet blocked directions for the current session.\n\nFrom libssh2 documentation:\n\nCan be a combination of:\n\n``ssh2.session.LIBSSH2_SESSION_BLOCK_INBOUND``: Inbound direction\nblocked.\n\n``ssh2.session.LIBSSH2_SESSION_BLOCK_OUTBOUND``: Outbound direction\nblocked.\n\nApplication should wait for data to be available for socket prior to\ncalling a libssh2 function again. If ``LIBSSH2_SESSION_BLOCK_INBOUND``\nis set select should contain the session socket in readfds set.\n\nCorrespondingly in case of ``LIBSSH2_SESSION_BLOCK_OUTBOUND`` writefds\nset should contain the socket.\n\n:rtype: int"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_47block_directions = {"block_directions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_47block_directions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_46block_directions}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_47block_directions(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_48block_directions, "Session.block_directions(self)\n\nGet blocked directions for the current session.\n\nFrom libssh2 documentation:\n\nCan be a combination of:\n\n``ssh2.session.LIBSSH2_SESSION_BLOCK_INBOUND``: Inbound direction\nblocked.\n\n``ssh2.session.LIBSSH2_SESSION_BLOCK_OUTBOUND``: Outbound direction\nblocked.\n\nApplication should wait for data to be available for socket prior to\ncalling a libssh2 function again. If ``LIBSSH2_SESSION_BLOCK_INBOUND``\nis set select should contain the session socket in readfds set.\n\nCorrespondingly in case of ``LIBSSH2_SESSION_BLOCK_OUTBOUND`` writefds\nset should contain the socket.\n\n:rtype: int"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_49block_directions = {"block_directions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_49block_directions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_48block_directions}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_49block_directions(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10215,14 +10550,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("block_directions", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_46block_directions(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_48block_directions(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_48block_directions(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10232,7 +10567,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("block_directions", 0); - /* "ssh2/session.pyx":498 + /* "ssh2/session.pyx":527 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -10246,7 +10581,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":499 + /* "ssh2/session.pyx":528 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_block_directions( # <<<<<<<<<<<<<< @@ -10256,7 +10591,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py __pyx_v_rc = libssh2_session_block_directions(__pyx_v_self->_session); } - /* "ssh2/session.pyx":498 + /* "ssh2/session.pyx":527 * :rtype: int""" * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -10273,7 +10608,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py } } - /* "ssh2/session.pyx":501 + /* "ssh2/session.pyx":530 * rc = c_ssh2.libssh2_session_block_directions( * self._session) * return rc # <<<<<<<<<<<<<< @@ -10281,13 +10616,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py * def flag(self, FlagType flag, enabled=True): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":476 + /* "ssh2/session.pyx":505 * return PyChannel(channel, self) * * def block_directions(self): # <<<<<<<<<<<<<< @@ -10306,7 +10641,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py return __pyx_r; } -/* "ssh2/session.pyx":503 +/* "ssh2/session.pyx":532 * return rc * * def flag(self, FlagType flag, enabled=True): # <<<<<<<<<<<<<< @@ -10315,16 +10650,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_46block_directions(struct __py */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_49flag(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_51flag(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_48flag, "Session.flag(self, FlagType flag, enabled=True)\n\nEnable/Disable flag for session.\n\nFlag must be one of :py:class:`ssh2.session.LIBSSH2_FLAG_SIGPIPE`\n or :py:class:`ssh2.session.LIBSSH2_FLAG_COMPRESS`.\n\nFlags *must* be set before :py:func:`Session.handshake` is called for the library to use them.\n\n:py:class:`ssh2.session.LIBSSH2_FLAG_SIGPIPE` - Library will not block SIGPIPE signal from triggering from the\n socket used. Meaning if the socket connection is terminated unexpectedly, using library functions will\n trigger a SIGPIPE signal from the associated socket. Default is off.\n\n:py:class:`ssh2.session.LIBSSH2_FLAG_COMPRESS` - Library will enable compression for the session.\n Default is off.\n\nUse `Session.supported_algs(LIBSSH2_METHOD_COMP_CS)` to get a list of supported compression algorithms after\nenabling compression, if any.\n\nDefault is to enable the flag - `enabled=True`.\n\nSet `enabled=False` to disable a previously enabled flag.\n\n:raises ValueError: On incorrect :py:class:`ssh2.session.FlagType` passed.\n:returns: None"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_49flag = {"flag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_49flag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_48flag}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_49flag(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_50flag, "Session.flag(self, FlagType flag, enabled=True)\n\nEnable/Disable flag for session.\n\nFlag must be one of :py:class:`ssh2.session.LIBSSH2_FLAG_SIGPIPE`\n or :py:class:`ssh2.session.LIBSSH2_FLAG_COMPRESS`.\n\nFlags *must* be set before :py:func:`Session.handshake` is called for the library to use them.\n\n:py:class:`ssh2.session.LIBSSH2_FLAG_SIGPIPE` - Library will not block SIGPIPE signal from triggering from the\n socket used. Meaning if the socket connection is terminated unexpectedly, using library functions will\n trigger a SIGPIPE signal from the associated socket. Default is off.\n\n:py:class:`ssh2.session.LIBSSH2_FLAG_COMPRESS` - Library will enable compression for the session.\n Default is off.\n\nUse `Session.supported_algs(LIBSSH2_METHOD_COMP_CS)` to get a list of supported compression algorithms after\nenabling compression, if any.\n\nDefault is to enable the flag - `enabled=True`.\n\nSet `enabled=False` to disable a previously enabled flag.\n\n:raises ValueError: On incorrect :py:class:`ssh2.session.FlagType` passed.\n:returns: None"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_51flag = {"flag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_51flag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_50flag}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_51flag(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10355,35 +10690,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,&__pyx_mstate_global->__pyx_n_u_enabled,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 503, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 532, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 503, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 503, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "flag", 0) < 0) __PYX_ERR(0, 503, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "flag", 0) < 0) __PYX_ERR(0, 532, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("flag", 0, 1, 2, i); __PYX_ERR(0, 503, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("flag", 0, 1, 2, i); __PYX_ERR(0, 532, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 503, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 503, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 532, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -10394,7 +10729,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("flag", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 503, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("flag", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 532, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10405,8 +10740,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flag), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_FlagType, 1, "flag", 0))) __PYX_ERR(0, 503, __pyx_L1_error) - __pyx_r = __pyx_pf_4ssh2_7session_7Session_48flag(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_flag, __pyx_v_enabled); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flag), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_FlagType, 1, "flag", 0))) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_r = __pyx_pf_4ssh2_7session_7Session_50flag(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_flag, __pyx_v_enabled); /* function exit code */ goto __pyx_L0; @@ -10425,7 +10760,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_FlagType *__pyx_v_flag, PyObject *__pyx_v_enabled) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_50flag(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_FlagType *__pyx_v_flag, PyObject *__pyx_v_enabled) { int __pyx_v_rc; int __pyx_v_value; PyObject *__pyx_r = NULL; @@ -10443,17 +10778,17 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flag", 0); - /* "ssh2/session.pyx":530 + /* "ssh2/session.pyx":559 * """ * cdef int rc * cdef bint value = enabled # <<<<<<<<<<<<<< * if not flag in (LIBSSH2_FLAG_SIGPIPE, LIBSSH2_FLAG_COMPRESS): * raise ValueError("Provided flag must be one of LIBSSH2_FLAG_SIGPIPE or LIBSSH2_FLAG_COMPRESS - got %s", */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enabled); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_enabled); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L1_error) __pyx_v_value = __pyx_t_1; - /* "ssh2/session.pyx":531 + /* "ssh2/session.pyx":560 * cdef int rc * cdef bint value = enabled * if not flag in (LIBSSH2_FLAG_SIGPIPE, LIBSSH2_FLAG_COMPRESS): # <<<<<<<<<<<<<< @@ -10462,22 +10797,22 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ */ __Pyx_INCREF((PyObject *)__pyx_v_flag); __pyx_t_2 = __pyx_v_flag; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LIBSSH2_FLAG_SIGPIPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LIBSSH2_FLAG_SIGPIPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LIBSSH2_FLAG_COMPRESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LIBSSH2_FLAG_COMPRESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_5; __pyx_L4_bool_binop_done:; @@ -10485,7 +10820,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ __pyx_t_5 = __pyx_t_1; if (unlikely(__pyx_t_5)) { - /* "ssh2/session.pyx":532 + /* "ssh2/session.pyx":561 * cdef bint value = enabled * if not flag in (LIBSSH2_FLAG_SIGPIPE, LIBSSH2_FLAG_COMPRESS): * raise ValueError("Provided flag must be one of LIBSSH2_FLAG_SIGPIPE or LIBSSH2_FLAG_COMPRESS - got %s", # <<<<<<<<<<<<<< @@ -10496,7 +10831,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ __Pyx_INCREF(__pyx_builtin_ValueError); __pyx_t_6 = __pyx_builtin_ValueError; - /* "ssh2/session.pyx":533 + /* "ssh2/session.pyx":562 * if not flag in (LIBSSH2_FLAG_SIGPIPE, LIBSSH2_FLAG_COMPRESS): * raise ValueError("Provided flag must be one of LIBSSH2_FLAG_SIGPIPE or LIBSSH2_FLAG_COMPRESS - got %s", * flag) # <<<<<<<<<<<<<< @@ -10509,14 +10844,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 532, __pyx_L1_error) + __PYX_ERR(0, 561, __pyx_L1_error) - /* "ssh2/session.pyx":531 + /* "ssh2/session.pyx":560 * cdef int rc * cdef bint value = enabled * if not flag in (LIBSSH2_FLAG_SIGPIPE, LIBSSH2_FLAG_COMPRESS): # <<<<<<<<<<<<<< @@ -10525,7 +10860,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ */ } - /* "ssh2/session.pyx":534 + /* "ssh2/session.pyx":563 * raise ValueError("Provided flag must be one of LIBSSH2_FLAG_SIGPIPE or LIBSSH2_FLAG_COMPRESS - got %s", * flag) * with nogil: # <<<<<<<<<<<<<< @@ -10539,7 +10874,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":535 + /* "ssh2/session.pyx":564 * flag) * with nogil: * rc = c_ssh2.libssh2_session_flag(self._session, flag.value, value) # <<<<<<<<<<<<<< @@ -10549,7 +10884,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ __pyx_v_rc = libssh2_session_flag(__pyx_v_self->_session, __pyx_v_flag->value, __pyx_v_value); } - /* "ssh2/session.pyx":534 + /* "ssh2/session.pyx":563 * raise ValueError("Provided flag must be one of LIBSSH2_FLAG_SIGPIPE or LIBSSH2_FLAG_COMPRESS - got %s", * flag) * with nogil: # <<<<<<<<<<<<<< @@ -10566,16 +10901,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ } } - /* "ssh2/session.pyx":536 + /* "ssh2/session.pyx":565 * with nogil: * rc = c_ssh2.libssh2_session_flag(self._session, flag.value, value) * handle_error_codes(rc) # <<<<<<<<<<<<<< * * def forward_listen(self, int port): */ - __pyx_t_8 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_8 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) - /* "ssh2/session.pyx":503 + /* "ssh2/session.pyx":532 * return rc * * def flag(self, FlagType flag, enabled=True): # <<<<<<<<<<<<<< @@ -10599,7 +10934,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ return __pyx_r; } -/* "ssh2/session.pyx":538 +/* "ssh2/session.pyx":567 * handle_error_codes(rc) * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -10608,16 +10943,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_48flag(struct __pyx_obj_4ssh2_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_51forward_listen(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_53forward_listen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_50forward_listen, "Session.forward_listen(self, int port)\n\nCreate forward listener on port.\n\n:param port: Port to listen on.\n:type port: int\n\n:rtype: :py:class:`ssh2.listener.Listener` or None"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_51forward_listen = {"forward_listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_51forward_listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_50forward_listen}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_51forward_listen(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_52forward_listen, "Session.forward_listen(self, int port)\n\nCreate forward listener on port.\n\n:param port: Port to listen on.\n:type port: int\n\n:rtype: :py:class:`ssh2.listener.Listener` or None"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_53forward_listen = {"forward_listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_53forward_listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52forward_listen}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_53forward_listen(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10647,32 +10982,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_port,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 538, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 567, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 538, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 567, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forward_listen", 0) < 0) __PYX_ERR(0, 538, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forward_listen", 0) < 0) __PYX_ERR(0, 567, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forward_listen", 1, 1, 1, i); __PYX_ERR(0, 538, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forward_listen", 1, 1, 1, i); __PYX_ERR(0, 567, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 538, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 567, __pyx_L3_error) } - __pyx_v_port = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L3_error) + __pyx_v_port = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 567, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 538, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 567, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10683,7 +11018,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_50forward_listen(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_port); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_52forward_listen(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_port); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -10693,7 +11028,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_port) { LIBSSH2_LISTENER *__pyx_v_listener; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -10705,7 +11040,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forward_listen", 0); - /* "ssh2/session.pyx":546 + /* "ssh2/session.pyx":575 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -10719,7 +11054,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":547 + /* "ssh2/session.pyx":576 * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen( # <<<<<<<<<<<<<< @@ -10729,7 +11064,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ __pyx_v_listener = libssh2_channel_forward_listen(__pyx_v_self->_session, __pyx_v_port); } - /* "ssh2/session.pyx":546 + /* "ssh2/session.pyx":575 * :rtype: :py:class:`ssh2.listener.Listener` or None""" * cdef c_ssh2.LIBSSH2_LISTENER *listener * with nogil: # <<<<<<<<<<<<<< @@ -10746,7 +11081,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ } } - /* "ssh2/session.pyx":549 + /* "ssh2/session.pyx":578 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -10756,7 +11091,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ __pyx_t_1 = (__pyx_v_listener == NULL); if (__pyx_t_1) { - /* "ssh2/session.pyx":550 + /* "ssh2/session.pyx":579 * self._session, port) * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -10765,29 +11100,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":551 + /* "ssh2/session.pyx":580 * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyListener(listener, self) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 579, __pyx_L1_error) - /* "ssh2/session.pyx":550 + /* "ssh2/session.pyx":579 * self._session, port) * if listener is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyListener(listener, self) */ - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":549 + /* "ssh2/session.pyx":578 * listener = c_ssh2.libssh2_channel_forward_listen( * self._session, port) * if listener is NULL: # <<<<<<<<<<<<<< @@ -10796,7 +11131,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ */ } - /* "ssh2/session.pyx":552 + /* "ssh2/session.pyx":581 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyListener(listener, self) # <<<<<<<<<<<<<< @@ -10804,13 +11139,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":538 + /* "ssh2/session.pyx":567 * handle_error_codes(rc) * * def forward_listen(self, int port): # <<<<<<<<<<<<<< @@ -10829,7 +11164,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":554 +/* "ssh2/session.pyx":583 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -10838,16 +11173,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_50forward_listen(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_53forward_listen_ex(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_55forward_listen_ex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_52forward_listen_ex, "Session.forward_listen_ex(self, int queue_maxsize, host=None, int port=0)\n\nInstruct the remote SSH server to begin listening for inbound\nTCP/IP connections. New connections will be queued by the library\nuntil accepted by ``ssh2.channel.Channel.forward_accept``.\n\n:param queue_maxsize: Maximum number of pending connections to queue\n before rejecting further attempts.\n:type queue_maxsize: int\n:param host: Address to bind to on the remote host. Binding\n to 0.0.0.0 (default when `None` is passed) will bind to all available\n addresses.\n:type host: str\n:param port: port to bind to on the remote host. When 0 is passed\n (the default), the remote host will select the first available\n dynamic port.\n:type port: int\n:returns: (listener, bound_port) tuple where bound_port is the\n listen port bound on the remote host. Useful when requesting\n dynamic port numbers.\n:rtype: (:py:class:`ssh2.listener.Listener`, int)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_53forward_listen_ex = {"forward_listen_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_53forward_listen_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52forward_listen_ex}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_53forward_listen_ex(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_54forward_listen_ex, "Session.forward_listen_ex(self, int queue_maxsize, host=None, int port=0)\n\nInstruct the remote SSH server to begin listening for inbound\nTCP/IP connections. New connections will be queued by the library\nuntil accepted by ``ssh2.channel.Channel.forward_accept``.\n\n:param queue_maxsize: Maximum number of pending connections to queue\n before rejecting further attempts.\n:type queue_maxsize: int\n:param host: Address to bind to on the remote host. Binding\n to 0.0.0.0 (default when `None` is passed) will bind to all available\n addresses.\n:type host: str\n:param port: port to bind to on the remote host. When 0 is passed\n (the default), the remote host will select the first available\n dynamic port.\n:type port: int\n:returns: (listener, bound_port) tuple where bound_port is the\n listen port bound on the remote host. Useful when requesting\n dynamic port numbers.\n:rtype: (:py:class:`ssh2.listener.Listener`, int)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_55forward_listen_ex = {"forward_listen_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_55forward_listen_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54forward_listen_ex}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_55forward_listen_ex(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -10879,59 +11214,59 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_queue_maxsize,&__pyx_mstate_global->__pyx_n_u_host,&__pyx_mstate_global->__pyx_n_u_port,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 554, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 583, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 583, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 583, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 583, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forward_listen_ex", 0) < 0) __PYX_ERR(0, 554, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forward_listen_ex", 0) < 0) __PYX_ERR(0, 583, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, i); __PYX_ERR(0, 554, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, i); __PYX_ERR(0, 583, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 583, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 583, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 554, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 583, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); } - __pyx_v_queue_maxsize = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_v_queue_maxsize = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_queue_maxsize == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error) __pyx_v_host = values[1]; if (values[2]) { - __pyx_v_port = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_v_port = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error) } else { __pyx_v_port = ((int)0); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 554, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forward_listen_ex", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 583, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10942,7 +11277,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_queue_maxsize, __pyx_v_host, __pyx_v_port); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_54forward_listen_ex(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_queue_maxsize, __pyx_v_host, __pyx_v_port); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -10952,7 +11287,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_queue_maxsize, PyObject *__pyx_v_host, int __pyx_v_port) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_54forward_listen_ex(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_queue_maxsize, PyObject *__pyx_v_host, int __pyx_v_port) { LIBSSH2_LISTENER *__pyx_v_listener; PyObject *__pyx_v_b_host = 0; char *__pyx_v__host; @@ -10970,7 +11305,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forward_listen_ex", 0); - /* "ssh2/session.pyx":577 + /* "ssh2/session.pyx":606 * """ * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) # <<<<<<<<<<<<<< @@ -10982,16 +11317,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } else { - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } - if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 577, __pyx_L1_error) + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 606, __pyx_L1_error) __pyx_v_b_host = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":578 + /* "ssh2/session.pyx":607 * cdef c_ssh2.LIBSSH2_LISTENER *listener * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL # <<<<<<<<<<<<<< @@ -11000,7 +11335,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ __pyx_v__host = NULL; - /* "ssh2/session.pyx":579 + /* "ssh2/session.pyx":608 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -11010,7 +11345,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p __pyx_t_2 = (__pyx_v_b_host != ((PyObject*)Py_None)); if (__pyx_t_2) { - /* "ssh2/session.pyx":580 + /* "ssh2/session.pyx":609 * cdef char *_host = NULL * if b_host is not None: * _host = b_host # <<<<<<<<<<<<<< @@ -11019,12 +11354,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ if (unlikely(__pyx_v_b_host == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 580, __pyx_L1_error) + __PYX_ERR(0, 609, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_host); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error) __pyx_v__host = __pyx_t_4; - /* "ssh2/session.pyx":579 + /* "ssh2/session.pyx":608 * cdef bytes b_host = None if host is None else to_bytes(host) * cdef char *_host = NULL * if b_host is not None: # <<<<<<<<<<<<<< @@ -11033,7 +11368,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":581 + /* "ssh2/session.pyx":610 * if b_host is not None: * _host = b_host * cdef int bound_port = 0 # <<<<<<<<<<<<<< @@ -11042,7 +11377,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ __pyx_v_bound_port = 0; - /* "ssh2/session.pyx":582 + /* "ssh2/session.pyx":611 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -11056,7 +11391,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":583 + /* "ssh2/session.pyx":612 * cdef int bound_port = 0 * with nogil: * listener = c_ssh2.libssh2_channel_forward_listen_ex( # <<<<<<<<<<<<<< @@ -11066,7 +11401,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p __pyx_v_listener = libssh2_channel_forward_listen_ex(__pyx_v_self->_session, __pyx_v__host, __pyx_v_port, (&__pyx_v_bound_port), __pyx_v_queue_maxsize); } - /* "ssh2/session.pyx":582 + /* "ssh2/session.pyx":611 * _host = b_host * cdef int bound_port = 0 * with nogil: # <<<<<<<<<<<<<< @@ -11083,7 +11418,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p } } - /* "ssh2/session.pyx":585 + /* "ssh2/session.pyx":614 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -11093,7 +11428,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p __pyx_t_2 = (__pyx_v_listener == NULL); if (__pyx_t_2) { - /* "ssh2/session.pyx":586 + /* "ssh2/session.pyx":615 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -11102,37 +11437,37 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":587 + /* "ssh2/session.pyx":616 * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)), 0) # <<<<<<<<<<<<<< * return (PyListener(listener, self), bound_port) * */ - __pyx_t_5 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 615, __pyx_L1_error) - /* "ssh2/session.pyx":586 + /* "ssh2/session.pyx":615 * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)), 0) * return (PyListener(listener, self), bound_port) */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 586, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 615, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 586, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(0, 615, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":585 + /* "ssh2/session.pyx":614 * listener = c_ssh2.libssh2_channel_forward_listen_ex( * self._session, _host, port, &bound_port, queue_maxsize) * if listener is NULL: # <<<<<<<<<<<<<< @@ -11141,7 +11476,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ } - /* "ssh2/session.pyx":588 + /* "ssh2/session.pyx":617 * return (handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)), 0) * return (PyListener(listener, self), bound_port) # <<<<<<<<<<<<<< @@ -11149,23 +11484,23 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p * def sftp_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_8listener_PyListener(__pyx_v_listener, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_bound_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_bound_port); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 588, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 617, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 588, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 617, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":554 + /* "ssh2/session.pyx":583 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< @@ -11187,7 +11522,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p return __pyx_r; } -/* "ssh2/session.pyx":590 +/* "ssh2/session.pyx":619 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -11196,16 +11531,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_52forward_listen_ex(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_55sftp_init(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_57sftp_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_54sftp_init, "Session.sftp_init(self)\n\nInitialise SFTP channel.\n\n:rtype: :py:class:`ssh2.sftp.SFTP`"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_55sftp_init = {"sftp_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_55sftp_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54sftp_init}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_55sftp_init(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_56sftp_init, "Session.sftp_init(self)\n\nInitialise SFTP channel.\n\n:rtype: :py:class:`ssh2.sftp.SFTP`"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_57sftp_init = {"sftp_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_57sftp_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_56sftp_init}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_57sftp_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11231,14 +11566,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sftp_init", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_54sftp_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_56sftp_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_56sftp_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_SFTP *__pyx_v__sftp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11250,7 +11585,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sftp_init", 0); - /* "ssh2/session.pyx":596 + /* "ssh2/session.pyx":625 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -11264,7 +11599,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":597 + /* "ssh2/session.pyx":626 * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) # <<<<<<<<<<<<<< @@ -11274,7 +11609,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 __pyx_v__sftp = libssh2_sftp_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":596 + /* "ssh2/session.pyx":625 * """ * cdef c_sftp.LIBSSH2_SFTP *_sftp * with nogil: # <<<<<<<<<<<<<< @@ -11291,7 +11626,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":598 + /* "ssh2/session.pyx":627 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -11301,7 +11636,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 __pyx_t_1 = (__pyx_v__sftp == NULL); if (__pyx_t_1) { - /* "ssh2/session.pyx":599 + /* "ssh2/session.pyx":628 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -11310,29 +11645,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":600 + /* "ssh2/session.pyx":629 * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PySFTP(_sftp, self) * */ - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 628, __pyx_L1_error) - /* "ssh2/session.pyx":599 + /* "ssh2/session.pyx":628 * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PySFTP(_sftp, self) */ - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":598 + /* "ssh2/session.pyx":627 * with nogil: * _sftp = c_sftp.libssh2_sftp_init(self._session) * if _sftp is NULL: # <<<<<<<<<<<<<< @@ -11341,7 +11676,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":601 + /* "ssh2/session.pyx":630 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PySFTP(_sftp, self) # <<<<<<<<<<<<<< @@ -11349,13 +11684,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 * def last_error(self, size_t msg_size=1024): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_4sftp_PySFTP(__pyx_v__sftp, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":590 + /* "ssh2/session.pyx":619 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< @@ -11374,7 +11709,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":603 +/* "ssh2/session.pyx":632 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -11383,16 +11718,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_54sftp_init(struct __pyx_obj_4 */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_57last_error(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_59last_error(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_56last_error, "Session.last_error(self, size_t msg_size=1024)\n\nRetrieve last error message from libssh2, if any.\nReturns empty string on no error message.\n\n:rtype: str"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_57last_error = {"last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_57last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_56last_error}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_57last_error(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_58last_error, "Session.last_error(self, size_t msg_size=1024)\n\nRetrieve last error message from libssh2, if any.\nReturns empty string on no error message.\n\n:rtype: str"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_59last_error = {"last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_59last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_58last_error}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_59last_error(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11422,37 +11757,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_msg_size,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 603, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 632, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 603, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 632, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "last_error", 0) < 0) __PYX_ERR(0, 603, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "last_error", 0) < 0) __PYX_ERR(0, 632, __pyx_L3_error) } else { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 603, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 632, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } if (values[0]) { - __pyx_v_msg_size = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_msg_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 603, __pyx_L3_error) + __pyx_v_msg_size = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_msg_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L3_error) } else { __pyx_v_msg_size = ((size_t)0x400); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("last_error", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 603, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("last_error", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 632, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11463,7 +11798,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_56last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_msg_size); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_58last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_msg_size); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -11473,7 +11808,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, size_t __pyx_v_msg_size) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, size_t __pyx_v_msg_size) { char *__pyx_v__error_msg; PyObject *__pyx_v_msg = 0; int __pyx_v_errmsg_len; @@ -11496,7 +11831,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_error", 0); - /* "ssh2/session.pyx":610 + /* "ssh2/session.pyx":639 * """ * cdef char *_error_msg * cdef bytes msg = b'' # <<<<<<<<<<<<<< @@ -11506,7 +11841,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__2); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_b__2; - /* "ssh2/session.pyx":611 + /* "ssh2/session.pyx":640 * cdef char *_error_msg * cdef bytes msg = b'' * cdef int errmsg_len = 0 # <<<<<<<<<<<<<< @@ -11515,7 +11850,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ */ __pyx_v_errmsg_len = 0; - /* "ssh2/session.pyx":612 + /* "ssh2/session.pyx":641 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -11529,7 +11864,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":613 + /* "ssh2/session.pyx":642 * cdef int errmsg_len = 0 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) # <<<<<<<<<<<<<< @@ -11538,7 +11873,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ */ __pyx_v__error_msg = ((char *)malloc(((sizeof(char)) * __pyx_v_msg_size))); - /* "ssh2/session.pyx":614 + /* "ssh2/session.pyx":643 * with nogil: * _error_msg = malloc(sizeof(char) * msg_size) * c_ssh2.libssh2_session_last_error( # <<<<<<<<<<<<<< @@ -11548,7 +11883,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ (void)(libssh2_session_last_error(__pyx_v_self->_session, (&__pyx_v__error_msg), (&__pyx_v_errmsg_len), 1)); } - /* "ssh2/session.pyx":612 + /* "ssh2/session.pyx":641 * cdef bytes msg = b'' * cdef int errmsg_len = 0 * with nogil: # <<<<<<<<<<<<<< @@ -11565,7 +11900,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":616 + /* "ssh2/session.pyx":645 * c_ssh2.libssh2_session_last_error( * self._session, &_error_msg, &errmsg_len, 1) * try: # <<<<<<<<<<<<<< @@ -11574,7 +11909,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ */ /*try:*/ { - /* "ssh2/session.pyx":617 + /* "ssh2/session.pyx":646 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -11584,19 +11919,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ __pyx_t_1 = (__pyx_v_errmsg_len > 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":618 + /* "ssh2/session.pyx":647 * try: * if errmsg_len > 0: * msg = _error_msg[:errmsg_len] # <<<<<<<<<<<<<< * return to_str(msg) * finally: */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__error_msg + 0, __pyx_v_errmsg_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L7_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__error_msg + 0, __pyx_v_errmsg_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/session.pyx":617 + /* "ssh2/session.pyx":646 * self._session, &_error_msg, &errmsg_len, 1) * try: * if errmsg_len > 0: # <<<<<<<<<<<<<< @@ -11605,7 +11940,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":619 + /* "ssh2/session.pyx":648 * if errmsg_len > 0: * msg = _error_msg[:errmsg_len] * return to_str(msg) # <<<<<<<<<<<<<< @@ -11613,15 +11948,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ * free(_error_msg) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_msg); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L7_error) - __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L7_error) + __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_msg); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L7_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_to_str(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L6_return; } - /* "ssh2/session.pyx":621 + /* "ssh2/session.pyx":650 * return to_str(msg) * finally: * free(_error_msg) # <<<<<<<<<<<<<< @@ -11669,7 +12004,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ } } - /* "ssh2/session.pyx":603 + /* "ssh2/session.pyx":632 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< @@ -11689,7 +12024,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":623 +/* "ssh2/session.pyx":652 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -11698,16 +12033,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_56last_error(struct __pyx_obj_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_59last_errno(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_61last_errno(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_58last_errno, "Session.last_errno(self)\n\nRetrieve last error number from libssh2, if any.\nReturns 0 on no last error.\n\n:rtype: int"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_59last_errno = {"last_errno", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_59last_errno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_58last_errno}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_59last_errno(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_60last_errno, "Session.last_errno(self)\n\nRetrieve last error number from libssh2, if any.\nReturns 0 on no last error.\n\n:rtype: int"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_61last_errno = {"last_errno", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_61last_errno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_60last_errno}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_61last_errno(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11733,14 +12068,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("last_errno", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_58last_errno(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_60last_errno(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_60last_errno(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { int __pyx_v_rc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -11750,7 +12085,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("last_errno", 0); - /* "ssh2/session.pyx":630 + /* "ssh2/session.pyx":659 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -11764,7 +12099,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":631 + /* "ssh2/session.pyx":660 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -11774,7 +12109,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ __pyx_v_rc = libssh2_session_last_errno(__pyx_v_self->_session); } - /* "ssh2/session.pyx":630 + /* "ssh2/session.pyx":659 * """ * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -11791,7 +12126,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ } } - /* "ssh2/session.pyx":633 + /* "ssh2/session.pyx":662 * rc = c_ssh2.libssh2_session_last_errno( * self._session) * return rc # <<<<<<<<<<<<<< @@ -11799,13 +12134,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ * def set_last_error(self, int errcode, errmsg not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":623 + /* "ssh2/session.pyx":652 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< @@ -11824,7 +12159,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":635 +/* "ssh2/session.pyx":664 * return rc * * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< @@ -11833,16 +12168,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_58last_errno(struct __pyx_obj_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_61set_last_error(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_63set_last_error(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_60set_last_error, "Session.set_last_error(self, int errcode, errmsg)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_61set_last_error = {"set_last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_61set_last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_60set_last_error}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_61set_last_error(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_62set_last_error, "Session.set_last_error(self, int errcode, errmsg)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_63set_last_error = {"set_last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_63set_last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_62set_last_error}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_63set_last_error(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -11873,39 +12208,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_errcode,&__pyx_mstate_global->__pyx_n_u_errmsg,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 635, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 664, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 635, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 664, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 635, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 664, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_last_error", 0) < 0) __PYX_ERR(0, 635, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_last_error", 0) < 0) __PYX_ERR(0, 664, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, i); __PYX_ERR(0, 635, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, i); __PYX_ERR(0, 664, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 635, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 664, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 635, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 664, __pyx_L3_error) } - __pyx_v_errcode = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_errcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L3_error) + __pyx_v_errcode = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_errcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 664, __pyx_L3_error) __pyx_v_errmsg = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 635, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_last_error", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 664, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11917,9 +12252,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_errmsg) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "errmsg"); __PYX_ERR(0, 635, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "errmsg"); __PYX_ERR(0, 664, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_60set_last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_errcode, __pyx_v_errmsg); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_62set_last_error(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_errcode, __pyx_v_errmsg); /* function exit code */ goto __pyx_L0; @@ -11938,7 +12273,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_errcode, PyObject *__pyx_v_errmsg) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_62set_last_error(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_errcode, PyObject *__pyx_v_errmsg) { PyObject *__pyx_v_b_errmsg = 0; char *__pyx_v__errmsg; int __pyx_v_rc; @@ -11951,19 +12286,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_last_error", 0); - /* "ssh2/session.pyx":636 + /* "ssh2/session.pyx":665 * * def set_last_error(self, int errcode, errmsg not None): * cdef bytes b_errmsg = to_bytes(errmsg) # <<<<<<<<<<<<<< * cdef char *_errmsg = b_errmsg * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_errmsg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_errmsg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_errmsg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":637 + /* "ssh2/session.pyx":666 * def set_last_error(self, int errcode, errmsg not None): * cdef bytes b_errmsg = to_bytes(errmsg) * cdef char *_errmsg = b_errmsg # <<<<<<<<<<<<<< @@ -11972,12 +12307,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ */ if (unlikely(__pyx_v_b_errmsg == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 637, __pyx_L1_error) + __PYX_ERR(0, 666, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_errmsg); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error) __pyx_v__errmsg = __pyx_t_2; - /* "ssh2/session.pyx":639 + /* "ssh2/session.pyx":668 * cdef char *_errmsg = b_errmsg * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -11991,7 +12326,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":640 + /* "ssh2/session.pyx":669 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_set_last_error( # <<<<<<<<<<<<<< @@ -12001,7 +12336,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ __pyx_v_rc = libssh2_session_set_last_error(__pyx_v_self->_session, __pyx_v_errcode, __pyx_v__errmsg); } - /* "ssh2/session.pyx":639 + /* "ssh2/session.pyx":668 * cdef char *_errmsg = b_errmsg * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -12018,7 +12353,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ } } - /* "ssh2/session.pyx":642 + /* "ssh2/session.pyx":671 * rc = c_ssh2.libssh2_session_set_last_error( * self._session, errcode, _errmsg) * return rc # <<<<<<<<<<<<<< @@ -12026,13 +12361,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ * def scp_recv(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":635 + /* "ssh2/session.pyx":664 * return rc * * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< @@ -12052,7 +12387,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":644 +/* "ssh2/session.pyx":673 * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -12061,16 +12396,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_60set_last_error(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_63scp_recv(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_recv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_62scp_recv, "Session.scp_recv(self, path)\n\nReceive file via SCP.\n\nDeprecated in favour or recv2 (requires libssh2 >= 1.7).\n\n:param path: File path to receive.\n:type path: str\n\n:rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.statinfo.StatInfo`) or None"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_63scp_recv = {"scp_recv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_63scp_recv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_62scp_recv}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_63scp_recv(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_64scp_recv, "Session.scp_recv(self, path)\n\nReceive file via SCP.\n\nDeprecated in favour or recv2 (requires libssh2 >= 1.7).\n\n:param path: File path to receive.\n:type path: str\n\n:rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.statinfo.StatInfo`) or None"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_65scp_recv = {"scp_recv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_65scp_recv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_64scp_recv}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_recv(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12100,32 +12435,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 644, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 673, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 644, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 673, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_recv", 0) < 0) __PYX_ERR(0, 644, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_recv", 0) < 0) __PYX_ERR(0, 673, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_recv", 1, 1, 1, i); __PYX_ERR(0, 644, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_recv", 1, 1, 1, i); __PYX_ERR(0, 673, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 644, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 673, __pyx_L3_error) } __pyx_v_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_recv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 644, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_recv", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 673, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12137,9 +12472,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 644, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 673, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_62scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_64scp_recv(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path); /* function exit code */ goto __pyx_L0; @@ -12158,7 +12493,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { PyObject *__pyx_v_b_path = 0; char *__pyx_v__path; struct __pyx_obj_4ssh2_8statinfo_StatInfo *__pyx_v_statinfo = 0; @@ -12177,19 +12512,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_recv", 0); - /* "ssh2/session.pyx":654 + /* "ssh2/session.pyx":683 * :rtype: tuple(:py:class:`ssh2.channel.Channel`, * :py:class:`ssh2.statinfo.StatInfo`) or None""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef StatInfo statinfo = StatInfo() */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":655 + /* "ssh2/session.pyx":684 * :py:class:`ssh2.statinfo.StatInfo`) or None""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -12198,12 +12533,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 655, __pyx_L1_error) + __PYX_ERR(0, 684, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":656 + /* "ssh2/session.pyx":685 * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path * cdef StatInfo statinfo = StatInfo() # <<<<<<<<<<<<<< @@ -12219,13 +12554,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __pyx_v_statinfo = ((struct __pyx_obj_4ssh2_8statinfo_StatInfo *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":658 + /* "ssh2/session.pyx":687 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12239,7 +12574,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":659 + /* "ssh2/session.pyx":688 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv( # <<<<<<<<<<<<<< @@ -12249,7 +12584,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_recv(__pyx_v_self->_session, __pyx_v__path, __pyx_v_statinfo->_stat); } - /* "ssh2/session.pyx":658 + /* "ssh2/session.pyx":687 * cdef StatInfo statinfo = StatInfo() * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12266,7 +12601,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":661 + /* "ssh2/session.pyx":690 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12276,7 +12611,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s __pyx_t_6 = (__pyx_v_channel == NULL); if (__pyx_t_6) { - /* "ssh2/session.pyx":662 + /* "ssh2/session.pyx":691 * self._session, _path, statinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -12285,29 +12620,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":663 + /* "ssh2/session.pyx":692 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self), statinfo * */ - __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 691, __pyx_L1_error) - /* "ssh2/session.pyx":662 + /* "ssh2/session.pyx":691 * self._session, _path, statinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self), statinfo */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":661 + /* "ssh2/session.pyx":690 * channel = c_ssh2.libssh2_scp_recv( * self._session, _path, statinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12316,7 +12651,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":664 + /* "ssh2/session.pyx":693 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self), statinfo # <<<<<<<<<<<<<< @@ -12324,21 +12659,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s * def scp_recv2(self, path not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 693, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_statinfo); __Pyx_GIVEREF((PyObject *)__pyx_v_statinfo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_statinfo)) != (0)) __PYX_ERR(0, 664, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_statinfo)) != (0)) __PYX_ERR(0, 693, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":644 + /* "ssh2/session.pyx":673 * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< @@ -12361,7 +12696,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":666 +/* "ssh2/session.pyx":695 * return PyChannel(channel, self), statinfo * * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< @@ -12370,16 +12705,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_62scp_recv(struct __pyx_obj_4s */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_recv2(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_67scp_recv2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_64scp_recv2, "Session.scp_recv2(self, path)\n\nReceive file via SCP.\n\n:param path: File path to receive.\n:type path: str\n\n:rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo`) or ``None``"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_65scp_recv2 = {"scp_recv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_65scp_recv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_64scp_recv2}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_65scp_recv2(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_66scp_recv2, "Session.scp_recv2(self, path)\n\nReceive file via SCP.\n\n:param path: File path to receive.\n:type path: str\n\n:rtype: tuple(:py:class:`ssh2.channel.Channel`,\n :py:class:`ssh2.fileinfo.FileInfo`) or ``None``"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_67scp_recv2 = {"scp_recv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_67scp_recv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_66scp_recv2}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_67scp_recv2(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12409,32 +12744,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 666, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 695, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 666, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 695, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_recv2", 0) < 0) __PYX_ERR(0, 666, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_recv2", 0) < 0) __PYX_ERR(0, 695, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_recv2", 1, 1, 1, i); __PYX_ERR(0, 666, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_recv2", 1, 1, 1, i); __PYX_ERR(0, 695, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 666, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 695, __pyx_L3_error) } __pyx_v_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_recv2", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 666, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_recv2", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 695, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12446,9 +12781,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 666, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 695, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_64scp_recv2(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_66scp_recv2(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path); /* function exit code */ goto __pyx_L0; @@ -12467,7 +12802,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_recv2(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path) { struct __pyx_obj_4ssh2_8fileinfo_FileInfo *__pyx_v_fileinfo = 0; PyObject *__pyx_v_b_path = 0; char *__pyx_v__path; @@ -12486,7 +12821,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_recv2", 0); - /* "ssh2/session.pyx":674 + /* "ssh2/session.pyx":703 * :rtype: tuple(:py:class:`ssh2.channel.Channel`, * :py:class:`ssh2.fileinfo.FileInfo`) or ``None``""" * cdef FileInfo fileinfo = FileInfo() # <<<<<<<<<<<<<< @@ -12502,25 +12837,25 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_1); } __pyx_v_fileinfo = ((struct __pyx_obj_4ssh2_8fileinfo_FileInfo *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":675 + /* "ssh2/session.pyx":704 * :py:class:`ssh2.fileinfo.FileInfo`) or ``None``""" * cdef FileInfo fileinfo = FileInfo() * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":676 + /* "ssh2/session.pyx":705 * cdef FileInfo fileinfo = FileInfo() * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -12529,12 +12864,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 676, __pyx_L1_error) + __PYX_ERR(0, 705, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L1_error) __pyx_v__path = __pyx_t_5; - /* "ssh2/session.pyx":678 + /* "ssh2/session.pyx":707 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12548,7 +12883,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":679 + /* "ssh2/session.pyx":708 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_recv2( # <<<<<<<<<<<<<< @@ -12558,7 +12893,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 __pyx_v_channel = libssh2_scp_recv2(__pyx_v_self->_session, __pyx_v__path, __pyx_v_fileinfo->_stat); } - /* "ssh2/session.pyx":678 + /* "ssh2/session.pyx":707 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12575,7 +12910,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 } } - /* "ssh2/session.pyx":681 + /* "ssh2/session.pyx":710 * channel = c_ssh2.libssh2_scp_recv2( * self._session, _path, fileinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12585,7 +12920,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 __pyx_t_6 = (__pyx_v_channel == NULL); if (__pyx_t_6) { - /* "ssh2/session.pyx":682 + /* "ssh2/session.pyx":711 * self._session, _path, fileinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -12594,29 +12929,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":683 + /* "ssh2/session.pyx":712 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self), fileinfo * */ - __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_7 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 711, __pyx_L1_error) - /* "ssh2/session.pyx":682 + /* "ssh2/session.pyx":711 * self._session, _path, fileinfo._stat) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self), fileinfo */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":681 + /* "ssh2/session.pyx":710 * channel = c_ssh2.libssh2_scp_recv2( * self._session, _path, fileinfo._stat) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12625,7 +12960,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 */ } - /* "ssh2/session.pyx":684 + /* "ssh2/session.pyx":713 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self), fileinfo # <<<<<<<<<<<<<< @@ -12633,21 +12968,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 * def scp_send(self, path not None, int mode, size_t size): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 684, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 713, __pyx_L1_error); __Pyx_INCREF((PyObject *)__pyx_v_fileinfo); __Pyx_GIVEREF((PyObject *)__pyx_v_fileinfo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_fileinfo)) != (0)) __PYX_ERR(0, 684, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_fileinfo)) != (0)) __PYX_ERR(0, 713, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":695 * return PyChannel(channel, self), statinfo * * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< @@ -12670,7 +13005,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 return __pyx_r; } -/* "ssh2/session.pyx":686 +/* "ssh2/session.pyx":715 * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -12679,16 +13014,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_64scp_recv2(struct __pyx_obj_4 */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_67scp_send(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_69scp_send(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_66scp_send, "Session.scp_send(self, path, int mode, size_t size)\n\nDeprecated in favour of scp_send64. Send file via SCP.\n\n:param path: Local file path to send.\n:type path: str\n:param mode: File mode.\n:type mode: int\n:param size: size of file\n:type size: int\n\n:rtype: :py:class:`ssh2.channel.Channel`"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_67scp_send = {"scp_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_67scp_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_66scp_send}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_67scp_send(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_68scp_send, "Session.scp_send(self, path, int mode, size_t size)\n\nDeprecated in favour of scp_send64. Send file via SCP.\n\n:param path: Local file path to send.\n:type path: str\n:param mode: File mode.\n:type mode: int\n:param size: size of file\n:type size: int\n\n:rtype: :py:class:`ssh2.channel.Channel`"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_69scp_send = {"scp_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_69scp_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_68scp_send}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_69scp_send(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -12720,46 +13055,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_size,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 686, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 715, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 715, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 715, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 715, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_send", 0) < 0) __PYX_ERR(0, 686, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_send", 0) < 0) __PYX_ERR(0, 715, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, i); __PYX_ERR(0, 686, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, i); __PYX_ERR(0, 715, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 715, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 715, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 686, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 715, __pyx_L3_error) } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) - __pyx_v_size = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error) + __pyx_v_size = __Pyx_PyLong_As_size_t(values[2]); if (unlikely((__pyx_v_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 686, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 715, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12771,9 +13106,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 686, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 715, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_66scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_68scp_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size); /* function exit code */ goto __pyx_L0; @@ -12792,7 +13127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, size_t __pyx_v_size) { PyObject *__pyx_v_b_path = 0; char *__pyx_v__path; LIBSSH2_CHANNEL *__pyx_v_channel; @@ -12807,19 +13142,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_send", 0); - /* "ssh2/session.pyx":697 + /* "ssh2/session.pyx":726 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":698 + /* "ssh2/session.pyx":727 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -12828,12 +13163,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 698, __pyx_L1_error) + __PYX_ERR(0, 727, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":700 + /* "ssh2/session.pyx":729 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12847,7 +13182,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":701 + /* "ssh2/session.pyx":730 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send( # <<<<<<<<<<<<<< @@ -12857,7 +13192,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s __pyx_v_channel = libssh2_scp_send(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size); } - /* "ssh2/session.pyx":700 + /* "ssh2/session.pyx":729 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -12874,7 +13209,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s } } - /* "ssh2/session.pyx":703 + /* "ssh2/session.pyx":732 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12884,7 +13219,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s __pyx_t_3 = (__pyx_v_channel == NULL); if (__pyx_t_3) { - /* "ssh2/session.pyx":704 + /* "ssh2/session.pyx":733 * self._session, _path, mode, size) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -12893,29 +13228,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":705 + /* "ssh2/session.pyx":734 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 733, __pyx_L1_error) - /* "ssh2/session.pyx":704 + /* "ssh2/session.pyx":733 * self._session, _path, mode, size) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":703 + /* "ssh2/session.pyx":732 * channel = c_ssh2.libssh2_scp_send( * self._session, _path, mode, size) * if channel is NULL: # <<<<<<<<<<<<<< @@ -12924,7 +13259,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s */ } - /* "ssh2/session.pyx":706 + /* "ssh2/session.pyx":735 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -12932,13 +13267,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":686 + /* "ssh2/session.pyx":715 * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< @@ -12958,7 +13293,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s return __pyx_r; } -/* "ssh2/session.pyx":708 +/* "ssh2/session.pyx":737 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -12967,16 +13302,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_66scp_send(struct __pyx_obj_4s */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_69scp_send64(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_71scp_send64(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_68scp_send64, "Session.scp_send64(self, path, int mode, libssh2_uint64_t size, time_t mtime, time_t atime)\n\nSend file via SCP.\n\n:param path: Local file path to send.\n:type path: str\n:param mode: File mode.\n:type mode: int\n:param size: size of file\n:type size: int\n\n:rtype: :py:class:`ssh2.channel.Channel`"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_69scp_send64 = {"scp_send64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_69scp_send64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_68scp_send64}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_69scp_send64(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_70scp_send64, "Session.scp_send64(self, path, int mode, libssh2_uint64_t size, time_t mtime, time_t atime)\n\nSend file via SCP.\n\n:param path: Local file path to send.\n:type path: str\n:param mode: File mode.\n:type mode: int\n:param size: size of file\n:type size: int\n\n:rtype: :py:class:`ssh2.channel.Channel`"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_71scp_send64 = {"scp_send64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_71scp_send64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_70scp_send64}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_71scp_send64(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13010,60 +13345,60 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_mtime,&__pyx_mstate_global->__pyx_n_u_atime,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 708, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 737, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 737, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 737, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 737, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 737, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 737, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_send64", 0) < 0) __PYX_ERR(0, 708, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scp_send64", 0) < 0) __PYX_ERR(0, 737, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, i); __PYX_ERR(0, 708, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, i); __PYX_ERR(0, 737, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 737, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 737, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 737, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 737, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 708, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 737, __pyx_L3_error) } __pyx_v_path = values[0]; - __pyx_v_mode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - __pyx_v_size = __Pyx_PyLong_As_libssh2_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L3_error) - __pyx_v_mtime = __Pyx_PyLong_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L3_error) - __pyx_v_atime = __Pyx_PyLong_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L3_error) + __pyx_v_mode = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error) + __pyx_v_size = __Pyx_PyLong_As_libssh2_uint64_t(values[2]); if (unlikely((__pyx_v_size == ((libssh2_uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error) + __pyx_v_mtime = __Pyx_PyLong_As_time_t(values[3]); if (unlikely((__pyx_v_mtime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error) + __pyx_v_atime = __Pyx_PyLong_As_time_t(values[4]); if (unlikely((__pyx_v_atime == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 708, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("scp_send64", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 737, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13075,9 +13410,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(((PyObject *)__pyx_v_path) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 708, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "path"); __PYX_ERR(0, 737, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_68scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_70scp_send64(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); /* function exit code */ goto __pyx_L0; @@ -13096,7 +13431,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, libssh2_uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_70scp_send64(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, PyObject *__pyx_v_path, int __pyx_v_mode, libssh2_uint64_t __pyx_v_size, time_t __pyx_v_mtime, time_t __pyx_v_atime) { PyObject *__pyx_v_b_path = 0; char *__pyx_v__path; LIBSSH2_CHANNEL *__pyx_v_channel; @@ -13111,19 +13446,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scp_send64", 0); - /* "ssh2/session.pyx":720 + /* "ssh2/session.pyx":749 * * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) # <<<<<<<<<<<<<< * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":721 + /* "ssh2/session.pyx":750 * :rtype: :py:class:`ssh2.channel.Channel`""" * cdef bytes b_path = to_bytes(path) * cdef char *_path = b_path # <<<<<<<<<<<<<< @@ -13132,12 +13467,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ */ if (unlikely(__pyx_v_b_path == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 750, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_path); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error) __pyx_v__path = __pyx_t_2; - /* "ssh2/session.pyx":723 + /* "ssh2/session.pyx":752 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -13151,7 +13486,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":724 + /* "ssh2/session.pyx":753 * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: * channel = c_ssh2.libssh2_scp_send64( # <<<<<<<<<<<<<< @@ -13161,7 +13496,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ __pyx_v_channel = libssh2_scp_send64(__pyx_v_self->_session, __pyx_v__path, __pyx_v_mode, __pyx_v_size, __pyx_v_mtime, __pyx_v_atime); } - /* "ssh2/session.pyx":723 + /* "ssh2/session.pyx":752 * cdef char *_path = b_path * cdef c_ssh2.LIBSSH2_CHANNEL *channel * with nogil: # <<<<<<<<<<<<<< @@ -13178,7 +13513,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ } } - /* "ssh2/session.pyx":726 + /* "ssh2/session.pyx":755 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -13188,7 +13523,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ __pyx_t_3 = (__pyx_v_channel == NULL); if (__pyx_t_3) { - /* "ssh2/session.pyx":727 + /* "ssh2/session.pyx":756 * self._session, _path, mode, size, mtime, atime) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< @@ -13197,29 +13532,29 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ */ __Pyx_XDECREF(__pyx_r); - /* "ssh2/session.pyx":728 + /* "ssh2/session.pyx":757 * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) # <<<<<<<<<<<<<< * return PyChannel(channel, self) * */ - __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_4 = __pyx_f_4ssh2_5utils_handle_error_codes(libssh2_session_last_errno(__pyx_v_self->_session), 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 756, __pyx_L1_error) - /* "ssh2/session.pyx":727 + /* "ssh2/session.pyx":756 * self._session, _path, mode, size, mtime, atime) * if channel is NULL: * return handle_error_codes(c_ssh2.libssh2_session_last_errno( # <<<<<<<<<<<<<< * self._session)) * return PyChannel(channel, self) */ - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":726 + /* "ssh2/session.pyx":755 * channel = c_ssh2.libssh2_scp_send64( * self._session, _path, mode, size, mtime, atime) * if channel is NULL: # <<<<<<<<<<<<<< @@ -13228,7 +13563,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ */ } - /* "ssh2/session.pyx":729 + /* "ssh2/session.pyx":758 * return handle_error_codes(c_ssh2.libssh2_session_last_errno( * self._session)) * return PyChannel(channel, self) # <<<<<<<<<<<<<< @@ -13236,13 +13571,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ * def publickey_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_7channel_PyChannel(__pyx_v_channel, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":708 + /* "ssh2/session.pyx":737 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< @@ -13262,7 +13597,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ return __pyx_r; } -/* "ssh2/session.pyx":731 +/* "ssh2/session.pyx":760 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -13271,16 +13606,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_68scp_send64(struct __pyx_obj_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_71publickey_init(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_73publickey_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_70publickey_init, "Session.publickey_init(self)\n\nInitialise public key subsystem for managing remote server\npublic keys"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_71publickey_init = {"publickey_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_71publickey_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_70publickey_init}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_71publickey_init(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_72publickey_init, "Session.publickey_init(self)\n\nInitialise public key subsystem for managing remote server\npublic keys"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_73publickey_init = {"publickey_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_73publickey_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_72publickey_init}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_73publickey_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13306,14 +13641,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("publickey_init", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_70publickey_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_72publickey_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_72publickey_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_PUBLICKEY *__pyx_v__pkey; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13324,7 +13659,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("publickey_init", 0); - /* "ssh2/session.pyx":735 + /* "ssh2/session.pyx":764 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -13338,7 +13673,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":736 + /* "ssh2/session.pyx":765 * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) # <<<<<<<<<<<<<< @@ -13348,7 +13683,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ __pyx_v__pkey = libssh2_publickey_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":735 + /* "ssh2/session.pyx":764 * public keys""" * cdef c_pkey.LIBSSH2_PUBLICKEY *_pkey * with nogil: # <<<<<<<<<<<<<< @@ -13365,7 +13700,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ } } - /* "ssh2/session.pyx":737 + /* "ssh2/session.pyx":766 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -13375,20 +13710,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ __pyx_t_1 = (__pyx_v__pkey == NULL); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":738 + /* "ssh2/session.pyx":767 * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: * raise PublicKeyInitError # <<<<<<<<<<<<<< * return PyPublicKeySystem(_pkey, self) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PublicKeyInitError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PublicKeyInitError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 738, __pyx_L1_error) + __PYX_ERR(0, 767, __pyx_L1_error) - /* "ssh2/session.pyx":737 + /* "ssh2/session.pyx":766 * with nogil: * _pkey = c_pkey.libssh2_publickey_init(self._session) * if _pkey is NULL: # <<<<<<<<<<<<<< @@ -13397,7 +13732,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ */ } - /* "ssh2/session.pyx":739 + /* "ssh2/session.pyx":768 * if _pkey is NULL: * raise PublicKeyInitError * return PyPublicKeySystem(_pkey, self) # <<<<<<<<<<<<<< @@ -13405,13 +13740,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ * def hostkey_hash(self, int hash_type): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_9publickey_PyPublicKeySystem(__pyx_v__pkey, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_9publickey_PyPublicKeySystem(__pyx_v__pkey, __pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":731 + /* "ssh2/session.pyx":760 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< @@ -13430,7 +13765,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":741 +/* "ssh2/session.pyx":770 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -13439,16 +13774,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_70publickey_init(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_73hostkey_hash(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_75hostkey_hash(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_72hostkey_hash, "Session.hostkey_hash(self, int hash_type)\n\nGet computed digest of the remote system's host key.\n\n:param hash_type: One of ``ssh2.session.LIBSSH2_HOSTKEY_HASH_MD5`` or\n ``ssh2.session.LIBSSH2_HOSTKEY_HASH_SHA1``\n:type hash_type: int\n\n:rtype: bytes"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_73hostkey_hash = {"hostkey_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_73hostkey_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_72hostkey_hash}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_73hostkey_hash(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_74hostkey_hash, "Session.hostkey_hash(self, int hash_type)\n\nGet computed digest of the remote system's host key.\n\n:param hash_type: One of ``ssh2.session.LIBSSH2_HOSTKEY_HASH_MD5`` or\n ``ssh2.session.LIBSSH2_HOSTKEY_HASH_SHA1``\n:type hash_type: int\n\n:rtype: bytes"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_75hostkey_hash = {"hostkey_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_75hostkey_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_74hostkey_hash}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_75hostkey_hash(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13478,32 +13813,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hash_type,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 741, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 770, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 741, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 770, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hostkey_hash", 0) < 0) __PYX_ERR(0, 741, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hostkey_hash", 0) < 0) __PYX_ERR(0, 770, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hostkey_hash", 1, 1, 1, i); __PYX_ERR(0, 741, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hostkey_hash", 1, 1, 1, i); __PYX_ERR(0, 770, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 741, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 770, __pyx_L3_error) } - __pyx_v_hash_type = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_hash_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 741, __pyx_L3_error) + __pyx_v_hash_type = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_hash_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("hostkey_hash", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 741, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("hostkey_hash", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 770, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13514,7 +13849,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_72hostkey_hash(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_hash_type); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_74hostkey_hash(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_hash_type); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -13524,7 +13859,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_hash_type) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey_hash(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_hash_type) { char const *__pyx_v__hash; PyObject *__pyx_v_b_hash = 0; PyObject *__pyx_r = NULL; @@ -13536,7 +13871,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hostkey_hash", 0); - /* "ssh2/session.pyx":751 + /* "ssh2/session.pyx":780 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -13550,7 +13885,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":752 + /* "ssh2/session.pyx":781 * cdef bytes b_hash * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) # <<<<<<<<<<<<<< @@ -13560,7 +13895,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob __pyx_v__hash = libssh2_hostkey_hash(__pyx_v_self->_session, __pyx_v_hash_type); } - /* "ssh2/session.pyx":751 + /* "ssh2/session.pyx":780 * cdef const char *_hash * cdef bytes b_hash * with nogil: # <<<<<<<<<<<<<< @@ -13577,7 +13912,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob } } - /* "ssh2/session.pyx":753 + /* "ssh2/session.pyx":782 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -13587,7 +13922,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob __pyx_t_1 = (__pyx_v__hash == NULL); if (__pyx_t_1) { - /* "ssh2/session.pyx":754 + /* "ssh2/session.pyx":783 * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: * return # <<<<<<<<<<<<<< @@ -13598,7 +13933,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":753 + /* "ssh2/session.pyx":782 * with nogil: * _hash = c_ssh2.libssh2_hostkey_hash(self._session, hash_type) * if _hash is NULL: # <<<<<<<<<<<<<< @@ -13607,19 +13942,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob */ } - /* "ssh2/session.pyx":755 + /* "ssh2/session.pyx":784 * if _hash is NULL: * return * b_hash = _hash # <<<<<<<<<<<<<< * return b_hash * */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_hash = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/session.pyx":756 + /* "ssh2/session.pyx":785 * return * b_hash = _hash * return b_hash # <<<<<<<<<<<<<< @@ -13631,7 +13966,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob __pyx_r = __pyx_v_b_hash; goto __pyx_L0; - /* "ssh2/session.pyx":741 + /* "ssh2/session.pyx":770 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< @@ -13651,7 +13986,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob return __pyx_r; } -/* "ssh2/session.pyx":758 +/* "ssh2/session.pyx":787 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -13660,16 +13995,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_72hostkey_hash(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_75hostkey(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_77hostkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_74hostkey, "Session.hostkey(self)\n\nGet server host key for this session.\n\nReturns key, key_type tuple where key_type is one of\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_RSA`,\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_DSS`, or\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_UNKNOWN`\n\n:rtype: tuple(bytes, int)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_75hostkey = {"hostkey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_75hostkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_74hostkey}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_75hostkey(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_76hostkey, "Session.hostkey(self)\n\nGet server host key for this session.\n\nReturns key, key_type tuple where key_type is one of\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_RSA`,\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_DSS`, or\n:py:class:`ssh2.session.LIBSSH2_HOSTKEY_TYPE_UNKNOWN`\n\n:rtype: tuple(bytes, int)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_77hostkey = {"hostkey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_77hostkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_76hostkey}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_77hostkey(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13695,14 +14030,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("hostkey", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_74hostkey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_76hostkey(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_76hostkey(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { PyObject *__pyx_v_key = 0; char const *__pyx_v__key; size_t __pyx_v_key_len; @@ -13719,7 +14054,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hostkey", 0); - /* "ssh2/session.pyx":767 + /* "ssh2/session.pyx":796 * * :rtype: tuple(bytes, int)""" * cdef bytes key = b"" # <<<<<<<<<<<<<< @@ -13729,7 +14064,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__2); __pyx_v_key = __pyx_mstate_global->__pyx_kp_b__2; - /* "ssh2/session.pyx":769 + /* "ssh2/session.pyx":798 * cdef bytes key = b"" * cdef const char *_key * cdef size_t key_len = 0 # <<<<<<<<<<<<<< @@ -13738,7 +14073,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss */ __pyx_v_key_len = 0; - /* "ssh2/session.pyx":770 + /* "ssh2/session.pyx":799 * cdef const char *_key * cdef size_t key_len = 0 * cdef int key_type = 0 # <<<<<<<<<<<<<< @@ -13747,7 +14082,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss */ __pyx_v_key_type = 0; - /* "ssh2/session.pyx":771 + /* "ssh2/session.pyx":800 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -13761,7 +14096,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":772 + /* "ssh2/session.pyx":801 * cdef int key_type = 0 * with nogil: * _key = c_ssh2.libssh2_session_hostkey( # <<<<<<<<<<<<<< @@ -13771,7 +14106,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss __pyx_v__key = libssh2_session_hostkey(__pyx_v_self->_session, (&__pyx_v_key_len), (&__pyx_v_key_type)); } - /* "ssh2/session.pyx":771 + /* "ssh2/session.pyx":800 * cdef size_t key_len = 0 * cdef int key_type = 0 * with nogil: # <<<<<<<<<<<<<< @@ -13788,7 +14123,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss } } - /* "ssh2/session.pyx":774 + /* "ssh2/session.pyx":803 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -13798,7 +14133,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss __pyx_t_1 = (__pyx_v__key == NULL); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":775 + /* "ssh2/session.pyx":804 * self._session, &key_len, &key_type) * if _key is NULL: * raise SessionHostKeyError( # <<<<<<<<<<<<<< @@ -13806,7 +14141,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss * key = _key[:key_len] */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SessionHostKeyError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SessionHostKeyError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS @@ -13825,14 +14160,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 775, __pyx_L1_error) + __PYX_ERR(0, 804, __pyx_L1_error) - /* "ssh2/session.pyx":774 + /* "ssh2/session.pyx":803 * _key = c_ssh2.libssh2_session_hostkey( * self._session, &key_len, &key_type) * if _key is NULL: # <<<<<<<<<<<<<< @@ -13841,19 +14176,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss */ } - /* "ssh2/session.pyx":777 + /* "ssh2/session.pyx":806 * raise SessionHostKeyError( * "Error retrieving server host key for session") * key = _key[:key_len] # <<<<<<<<<<<<<< * return key, key_type * */ - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__key + 0, __pyx_v_key_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v__key + 0, __pyx_v_key_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "ssh2/session.pyx":778 + /* "ssh2/session.pyx":807 * "Error retrieving server host key for session") * key = _key[:key_len] * return key, key_type # <<<<<<<<<<<<<< @@ -13861,21 +14196,21 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss * def knownhost_init(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_key_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key) != (0)) __PYX_ERR(0, 778, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key) != (0)) __PYX_ERR(0, 807, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 778, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 807, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":758 + /* "ssh2/session.pyx":787 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< @@ -13897,7 +14232,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/session.pyx":780 +/* "ssh2/session.pyx":809 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -13906,16 +14241,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_74hostkey(struct __pyx_obj_4ss */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_77knownhost_init(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_79knownhost_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_76knownhost_init, "Session.knownhost_init(self)\n\nInitialise a collection of known hosts for this session.\n\n:rtype: :py:class:`ssh2.knownhost.KnownHost`"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_77knownhost_init = {"knownhost_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_77knownhost_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_76knownhost_init}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_77knownhost_init(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_78knownhost_init, "Session.knownhost_init(self)\n\nInitialise a collection of known hosts for this session.\n\n:rtype: :py:class:`ssh2.knownhost.KnownHost`"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_79knownhost_init = {"knownhost_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_79knownhost_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_78knownhost_init}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_79knownhost_init(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13941,14 +14276,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("knownhost_init", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_76knownhost_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_78knownhost_init(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_78knownhost_init(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { LIBSSH2_KNOWNHOSTS *__pyx_v_known_hosts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -13959,7 +14294,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("knownhost_init", 0); - /* "ssh2/session.pyx":785 + /* "ssh2/session.pyx":814 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -13973,7 +14308,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":786 + /* "ssh2/session.pyx":815 * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: * known_hosts = c_ssh2.libssh2_knownhost_init( # <<<<<<<<<<<<<< @@ -13983,7 +14318,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ __pyx_v_known_hosts = libssh2_knownhost_init(__pyx_v_self->_session); } - /* "ssh2/session.pyx":785 + /* "ssh2/session.pyx":814 * :rtype: :py:class:`ssh2.knownhost.KnownHost`""" * cdef c_ssh2.LIBSSH2_KNOWNHOSTS *known_hosts * with nogil: # <<<<<<<<<<<<<< @@ -14000,7 +14335,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ } } - /* "ssh2/session.pyx":788 + /* "ssh2/session.pyx":817 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -14010,20 +14345,20 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ __pyx_t_1 = (__pyx_v_known_hosts == NULL); if (unlikely(__pyx_t_1)) { - /* "ssh2/session.pyx":789 + /* "ssh2/session.pyx":818 * self._session) * if known_hosts is NULL: * raise KnownHostError # <<<<<<<<<<<<<< * return PyKnownHost(self, known_hosts) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_KnownHostError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_KnownHostError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 789, __pyx_L1_error) + __PYX_ERR(0, 818, __pyx_L1_error) - /* "ssh2/session.pyx":788 + /* "ssh2/session.pyx":817 * known_hosts = c_ssh2.libssh2_knownhost_init( * self._session) * if known_hosts is NULL: # <<<<<<<<<<<<<< @@ -14032,7 +14367,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ */ } - /* "ssh2/session.pyx":790 + /* "ssh2/session.pyx":819 * if known_hosts is NULL: * raise KnownHostError * return PyKnownHost(self, known_hosts) # <<<<<<<<<<<<<< @@ -14040,13 +14375,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ * def keepalive_config(self, bint want_reply, unsigned interval): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHost(__pyx_v_self, __pyx_v_known_hosts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_4ssh2_9knownhost_PyKnownHost(__pyx_v_self, __pyx_v_known_hosts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":780 + /* "ssh2/session.pyx":809 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< @@ -14065,7 +14400,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":792 +/* "ssh2/session.pyx":821 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -14074,16 +14409,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_76knownhost_init(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_79keepalive_config(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_81keepalive_config(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_78keepalive_config, "Session.keepalive_config(self, bool want_reply, unsigned int interval)\n\nConfigure keep alive settings.\n\n:param want_reply: True/False for reply wanted from server on keep\n alive messages being sent or not.\n:type want_reply: bool\n:param interval: Required keep alive interval. Set to ``0`` to disable\n keepalives.\n:type interval: int"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_79keepalive_config = {"keepalive_config", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_79keepalive_config, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_78keepalive_config}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_79keepalive_config(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_80keepalive_config, "Session.keepalive_config(self, bool want_reply, unsigned int interval)\n\nConfigure keep alive settings.\n\n:param want_reply: True/False for reply wanted from server on keep\n alive messages being sent or not.\n:type want_reply: bool\n:param interval: Required keep alive interval. Set to ``0`` to disable\n keepalives.\n:type interval: int"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_81keepalive_config = {"keepalive_config", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_81keepalive_config, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_80keepalive_config}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_81keepalive_config(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14114,39 +14449,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_want_reply,&__pyx_mstate_global->__pyx_n_u_interval,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 792, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 821, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 792, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 821, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 792, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 821, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "keepalive_config", 0) < 0) __PYX_ERR(0, 792, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "keepalive_config", 0) < 0) __PYX_ERR(0, 821, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, i); __PYX_ERR(0, 792, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, i); __PYX_ERR(0, 821, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 792, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 821, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 792, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 821, __pyx_L3_error) } - __pyx_v_want_reply = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_want_reply == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 792, __pyx_L3_error) - __pyx_v_interval = __Pyx_PyLong_As_unsigned_int(values[1]); if (unlikely((__pyx_v_interval == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 792, __pyx_L3_error) + __pyx_v_want_reply = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_want_reply == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) + __pyx_v_interval = __Pyx_PyLong_As_unsigned_int(values[1]); if (unlikely((__pyx_v_interval == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 792, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("keepalive_config", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 821, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14157,7 +14492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_78keepalive_config(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_want_reply, __pyx_v_interval); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_80keepalive_config(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_want_reply, __pyx_v_interval); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -14167,12 +14502,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_want_reply, unsigned int __pyx_v_interval) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_config(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, int __pyx_v_want_reply, unsigned int __pyx_v_interval) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keepalive_config", 0); - /* "ssh2/session.pyx":802 + /* "ssh2/session.pyx":831 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -14186,7 +14521,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __py __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":803 + /* "ssh2/session.pyx":832 * :type interval: int""" * with nogil: * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) # <<<<<<<<<<<<<< @@ -14196,7 +14531,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __py libssh2_keepalive_config(__pyx_v_self->_session, __pyx_v_want_reply, __pyx_v_interval); } - /* "ssh2/session.pyx":802 + /* "ssh2/session.pyx":831 * keepalives. * :type interval: int""" * with nogil: # <<<<<<<<<<<<<< @@ -14213,7 +14548,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __py } } - /* "ssh2/session.pyx":792 + /* "ssh2/session.pyx":821 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< @@ -14228,7 +14563,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __py return __pyx_r; } -/* "ssh2/session.pyx":805 +/* "ssh2/session.pyx":834 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -14237,16 +14572,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_78keepalive_config(struct __py */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_81keepalive_send(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_83keepalive_send(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_80keepalive_send, "Session.keepalive_send(self)\n\nSend keepalive.\n\nReturns seconds remaining before next keep alive should be sent.\n\n:rtype: int"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_81keepalive_send = {"keepalive_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_81keepalive_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_80keepalive_send}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_81keepalive_send(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_82keepalive_send, "Session.keepalive_send(self)\n\nSend keepalive.\n\nReturns seconds remaining before next keep alive should be sent.\n\n:rtype: int"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_83keepalive_send = {"keepalive_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_83keepalive_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_82keepalive_send}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_83keepalive_send(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14272,14 +14607,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("keepalive_send", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_80keepalive_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_82keepalive_send(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_82keepalive_send(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { CYTHON_UNUSED int __pyx_v_seconds; int __pyx_v_c_seconds; int __pyx_v_rc; @@ -14292,7 +14627,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("keepalive_send", 0); - /* "ssh2/session.pyx":811 + /* "ssh2/session.pyx":840 * * :rtype: int""" * cdef int seconds = 0 # <<<<<<<<<<<<<< @@ -14301,7 +14636,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ */ __pyx_v_seconds = 0; - /* "ssh2/session.pyx":812 + /* "ssh2/session.pyx":841 * :rtype: int""" * cdef int seconds = 0 * cdef int c_seconds = 0 # <<<<<<<<<<<<<< @@ -14310,7 +14645,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ */ __pyx_v_c_seconds = 0; - /* "ssh2/session.pyx":814 + /* "ssh2/session.pyx":843 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -14324,7 +14659,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":815 + /* "ssh2/session.pyx":844 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) # <<<<<<<<<<<<<< @@ -14334,7 +14669,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ __pyx_v_rc = libssh2_keepalive_send(__pyx_v_self->_session, (&__pyx_v_c_seconds)); } - /* "ssh2/session.pyx":814 + /* "ssh2/session.pyx":843 * cdef int c_seconds = 0 * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -14351,16 +14686,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ } } - /* "ssh2/session.pyx":816 + /* "ssh2/session.pyx":845 * with nogil: * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) * handle_error_codes(rc) # <<<<<<<<<<<<<< * return c_seconds * */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 816, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 845, __pyx_L1_error) - /* "ssh2/session.pyx":817 + /* "ssh2/session.pyx":846 * rc = c_ssh2.libssh2_keepalive_send(self._session, &c_seconds) * handle_error_codes(rc) * return c_seconds # <<<<<<<<<<<<<< @@ -14368,13 +14703,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ * def supported_algs(self, MethodType method_type): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_c_seconds); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":805 + /* "ssh2/session.pyx":834 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< @@ -14393,7 +14728,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":819 +/* "ssh2/session.pyx":848 * return c_seconds * * def supported_algs(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -14402,16 +14737,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_80keepalive_send(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_83supported_algs(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_85supported_algs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_82supported_algs, "Session.supported_algs(self, MethodType method_type)\n\nGet supportd algorithms for method type.\n\n:param method_type: Type of method to get\n:type method_type: :py:class:`MethodType`\n\n:returns: List of supported algorithms.\n:rtype: list(str)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_83supported_algs = {"supported_algs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_83supported_algs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_82supported_algs}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_83supported_algs(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_84supported_algs, "Session.supported_algs(self, MethodType method_type)\n\nGet supportd algorithms for method type.\n\n:param method_type: Type of method to get\n:type method_type: :py:class:`MethodType`\n\n:returns: List of supported algorithms.\n:rtype: list(str)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_85supported_algs = {"supported_algs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_85supported_algs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_84supported_algs}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_85supported_algs(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14441,32 +14776,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_method_type,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 819, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 848, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 819, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 848, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "supported_algs", 0) < 0) __PYX_ERR(0, 819, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "supported_algs", 0) < 0) __PYX_ERR(0, 848, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("supported_algs", 1, 1, 1, i); __PYX_ERR(0, 819, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("supported_algs", 1, 1, 1, i); __PYX_ERR(0, 848, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 819, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 848, __pyx_L3_error) } __pyx_v_method_type = ((struct __pyx_obj_4ssh2_7session_MethodType *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("supported_algs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 819, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("supported_algs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 848, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14477,8 +14812,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 819, __pyx_L1_error) - __pyx_r = __pyx_pf_4ssh2_7session_7Session_82supported_algs(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 848, __pyx_L1_error) + __pyx_r = __pyx_pf_4ssh2_7session_7Session_84supported_algs(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type); /* function exit code */ goto __pyx_L0; @@ -14497,7 +14832,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_84supported_algs(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type) { char const **__pyx_v_c_algs; int __pyx_v_rc; PyObject *__pyx_v_algs = NULL; @@ -14522,7 +14857,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("supported_algs", 0); - /* "ssh2/session.pyx":830 + /* "ssh2/session.pyx":859 * cdef const char **c_algs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -14536,7 +14871,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":831 + /* "ssh2/session.pyx":860 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_supported_algs( # <<<<<<<<<<<<<< @@ -14546,7 +14881,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_v_rc = libssh2_session_supported_algs(__pyx_v_self->_session, __pyx_v_method_type->value, (&__pyx_v_c_algs)); } - /* "ssh2/session.pyx":830 + /* "ssh2/session.pyx":859 * cdef const char **c_algs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -14563,7 +14898,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ } } - /* "ssh2/session.pyx":833 + /* "ssh2/session.pyx":862 * rc = c_ssh2.libssh2_session_supported_algs( * self._session, method_type.value, &c_algs) * if rc < 0: # <<<<<<<<<<<<<< @@ -14573,7 +14908,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_t_1 = (__pyx_v_rc < 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":834 + /* "ssh2/session.pyx":863 * self._session, method_type.value, &c_algs) * if rc < 0: * return handle_error_codes(rc) # <<<<<<<<<<<<<< @@ -14581,14 +14916,14 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ * return [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 834, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) + __pyx_t_2 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":833 + /* "ssh2/session.pyx":862 * rc = c_ssh2.libssh2_session_supported_algs( * self._session, method_type.value, &c_algs) * if rc < 0: # <<<<<<<<<<<<<< @@ -14597,7 +14932,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ */ } - /* "ssh2/session.pyx":835 + /* "ssh2/session.pyx":864 * if rc < 0: * return handle_error_codes(rc) * elif rc == 0: # <<<<<<<<<<<<<< @@ -14607,7 +14942,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_t_1 = (__pyx_v_rc == 0); if (__pyx_t_1) { - /* "ssh2/session.pyx":836 + /* "ssh2/session.pyx":865 * return handle_error_codes(rc) * elif rc == 0: * return [] # <<<<<<<<<<<<<< @@ -14615,13 +14950,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ * algs = [to_str(c_algs[i]) for i in range(rc)] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":835 + /* "ssh2/session.pyx":864 * if rc < 0: * return handle_error_codes(rc) * elif rc == 0: # <<<<<<<<<<<<<< @@ -14630,7 +14965,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ */ } - /* "ssh2/session.pyx":837 + /* "ssh2/session.pyx":866 * elif rc == 0: * return [] * try: # <<<<<<<<<<<<<< @@ -14639,7 +14974,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ */ /*try:*/ { - /* "ssh2/session.pyx":838 + /* "ssh2/session.pyx":867 * return [] * try: * algs = [to_str(c_algs[i]) for i in range(rc)] # <<<<<<<<<<<<<< @@ -14647,15 +14982,15 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ * with nogil: */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L8_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_v_rc; __pyx_t_4 = __pyx_t_2; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_7genexpr__pyx_v_i = __pyx_t_5; - __pyx_t_6 = __pyx_f_4ssh2_5utils_to_str((__pyx_v_c_algs[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L8_error) + __pyx_t_6 = __pyx_f_4ssh2_5utils_to_str((__pyx_v_c_algs[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 838, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 867, __pyx_L8_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ @@ -14663,7 +14998,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_t_3 = 0; } - /* "ssh2/session.pyx":840 + /* "ssh2/session.pyx":869 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -14679,7 +15014,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":841 + /* "ssh2/session.pyx":870 * finally: * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) # <<<<<<<<<<<<<< @@ -14689,7 +15024,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ libssh2_free(__pyx_v_self->_session, __pyx_v_c_algs); } - /* "ssh2/session.pyx":840 + /* "ssh2/session.pyx":869 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -14731,7 +15066,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":841 + /* "ssh2/session.pyx":870 * finally: * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) # <<<<<<<<<<<<<< @@ -14741,7 +15076,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ libssh2_free(__pyx_v_self->_session, __pyx_v_c_algs); } - /* "ssh2/session.pyx":840 + /* "ssh2/session.pyx":869 * algs = [to_str(c_algs[i]) for i in range(rc)] * finally: * with nogil: # <<<<<<<<<<<<<< @@ -14773,7 +15108,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_L9:; } - /* "ssh2/session.pyx":842 + /* "ssh2/session.pyx":871 * with nogil: * c_ssh2.libssh2_free(self._session, c_algs) * return algs # <<<<<<<<<<<<<< @@ -14785,7 +15120,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ __pyx_r = __pyx_v_algs; goto __pyx_L0; - /* "ssh2/session.pyx":819 + /* "ssh2/session.pyx":848 * return c_seconds * * def supported_algs(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -14806,7 +15141,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ return __pyx_r; } -/* "ssh2/session.pyx":844 +/* "ssh2/session.pyx":873 * return algs * * def methods(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -14815,16 +15150,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_82supported_algs(struct __pyx_ */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_85methods(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_87methods(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_84methods, "Session.methods(self, MethodType method_type)\n\nGet currently active algorithms for method type.\n\n:param method_type: Type of method to get\n:type method_type: :py:class:`MethodType`\n\n:rtype: str"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_85methods = {"methods", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_85methods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_84methods}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_85methods(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_86methods, "Session.methods(self, MethodType method_type)\n\nGet currently active algorithms for method type.\n\n:param method_type: Type of method to get\n:type method_type: :py:class:`MethodType`\n\n:rtype: str"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_87methods = {"methods", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_87methods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_86methods}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_87methods(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -14854,32 +15189,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_method_type,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 844, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 873, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 873, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "methods", 0) < 0) __PYX_ERR(0, 844, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "methods", 0) < 0) __PYX_ERR(0, 873, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("methods", 1, 1, 1, i); __PYX_ERR(0, 844, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("methods", 1, 1, 1, i); __PYX_ERR(0, 873, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 844, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 873, __pyx_L3_error) } __pyx_v_method_type = ((struct __pyx_obj_4ssh2_7session_MethodType *)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("methods", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 844, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("methods", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 873, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14890,8 +15225,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 844, __pyx_L1_error) - __pyx_r = __pyx_pf_4ssh2_7session_7Session_84methods(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 873, __pyx_L1_error) + __pyx_r = __pyx_pf_4ssh2_7session_7Session_86methods(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type); /* function exit code */ goto __pyx_L0; @@ -14910,7 +15245,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_86methods(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type) { char const *__pyx_v_methods; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -14922,18 +15257,18 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("methods", 0); - /* "ssh2/session.pyx":852 + /* "ssh2/session.pyx":881 * :rtype: str * """ * if not self.sock: # <<<<<<<<<<<<<< * return * with nogil: */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 881, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "ssh2/session.pyx":853 + /* "ssh2/session.pyx":882 * """ * if not self.sock: * return # <<<<<<<<<<<<<< @@ -14944,7 +15279,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "ssh2/session.pyx":852 + /* "ssh2/session.pyx":881 * :rtype: str * """ * if not self.sock: # <<<<<<<<<<<<<< @@ -14953,7 +15288,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss */ } - /* "ssh2/session.pyx":854 + /* "ssh2/session.pyx":883 * if not self.sock: * return * with nogil: # <<<<<<<<<<<<<< @@ -14967,7 +15302,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":855 + /* "ssh2/session.pyx":884 * return * with nogil: * methods = c_ssh2.libssh2_session_methods( # <<<<<<<<<<<<<< @@ -14977,7 +15312,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss __pyx_v_methods = libssh2_session_methods(__pyx_v_self->_session, __pyx_v_method_type->value); } - /* "ssh2/session.pyx":854 + /* "ssh2/session.pyx":883 * if not self.sock: * return * with nogil: # <<<<<<<<<<<<<< @@ -14994,7 +15329,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss } } - /* "ssh2/session.pyx":857 + /* "ssh2/session.pyx":886 * methods = c_ssh2.libssh2_session_methods( * self._session, method_type.value) * return to_str(methods) # <<<<<<<<<<<<<< @@ -15002,13 +15337,13 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss * def method_pref(self, MethodType method_type, prefs not None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v_methods); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_to_str(__pyx_v_methods); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":844 + /* "ssh2/session.pyx":873 * return algs * * def methods(self, MethodType method_type): # <<<<<<<<<<<<<< @@ -15027,7 +15362,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss return __pyx_r; } -/* "ssh2/session.pyx":859 +/* "ssh2/session.pyx":888 * return to_str(methods) * * def method_pref(self, MethodType method_type, prefs not None): # <<<<<<<<<<<<<< @@ -15036,16 +15371,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_84methods(struct __pyx_obj_4ss */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_87method_pref(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_89method_pref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_86method_pref, "Session.method_pref(self, MethodType method_type, prefs)\n\nSet preference for session method.\n\nSee :py:func:`Session.supported_algs` for supported algorithms\nfor method type.\n\n:param method_type: A supported session method LIBSSH2_METHOD_*\n:type method_type: :py:class:`MethodType`\n:param prefs: Algorithm preference for method type provided.\n:type prefs: str\n\n:rtype: int\n:raises: :py:class:`ssh2.exceptions.MethodNotSupported`\n on unsupported method preference"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_87method_pref = {"method_pref", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_87method_pref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_86method_pref}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_87method_pref(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_88method_pref, "Session.method_pref(self, MethodType method_type, prefs)\n\nSet preference for session method.\n\nSee :py:func:`Session.supported_algs` for supported algorithms\nfor method type.\n\n:param method_type: A supported session method LIBSSH2_METHOD_*\n:type method_type: :py:class:`MethodType`\n:param prefs: Algorithm preference for method type provided.\n:type prefs: str\n\n:rtype: int\n:raises: :py:class:`ssh2.exceptions.MethodNotSupported`\n on unsupported method preference"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_89method_pref = {"method_pref", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_89method_pref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_88method_pref}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_89method_pref(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15076,39 +15411,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_method_type,&__pyx_mstate_global->__pyx_n_u_prefs,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 859, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 888, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 859, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 888, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 859, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 888, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "method_pref", 0) < 0) __PYX_ERR(0, 859, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "method_pref", 0) < 0) __PYX_ERR(0, 888, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, i); __PYX_ERR(0, 859, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, i); __PYX_ERR(0, 888, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 859, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 888, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 859, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 888, __pyx_L3_error) } __pyx_v_method_type = ((struct __pyx_obj_4ssh2_7session_MethodType *)values[0]); __pyx_v_prefs = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 859, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("method_pref", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 888, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15119,11 +15454,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 859, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_method_type), __pyx_mstate_global->__pyx_ptype_4ssh2_7session_MethodType, 1, "method_type", 0))) __PYX_ERR(0, 888, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_prefs) == Py_None)) { - PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "prefs"); __PYX_ERR(0, 859, __pyx_L1_error) + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "prefs"); __PYX_ERR(0, 888, __pyx_L1_error) } - __pyx_r = __pyx_pf_4ssh2_7session_7Session_86method_pref(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type, __pyx_v_prefs); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_88method_pref(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v_method_type, __pyx_v_prefs); /* function exit code */ goto __pyx_L0; @@ -15142,7 +15477,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type, PyObject *__pyx_v_prefs) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_88method_pref(struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, struct __pyx_obj_4ssh2_7session_MethodType *__pyx_v_method_type, PyObject *__pyx_v_prefs) { PyObject *__pyx_v_b_prefs = 0; char const *__pyx_v_c_prefs; int __pyx_v_rc; @@ -15156,19 +15491,19 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("method_pref", 0); - /* "ssh2/session.pyx":874 + /* "ssh2/session.pyx":903 * on unsupported method preference * """ * cdef bytes b_prefs = to_bytes(prefs) # <<<<<<<<<<<<<< * cdef const char *c_prefs = b_prefs * cdef int rc */ - __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_prefs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) + __pyx_t_1 = __pyx_f_4ssh2_5utils_to_bytes(__pyx_v_prefs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_prefs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh2/session.pyx":875 + /* "ssh2/session.pyx":904 * """ * cdef bytes b_prefs = to_bytes(prefs) * cdef const char *c_prefs = b_prefs # <<<<<<<<<<<<<< @@ -15177,12 +15512,12 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj */ if (unlikely(__pyx_v_b_prefs == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 875, __pyx_L1_error) + __PYX_ERR(0, 904, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_prefs); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_prefs); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_v_c_prefs = __pyx_t_2; - /* "ssh2/session.pyx":877 + /* "ssh2/session.pyx":906 * cdef const char *c_prefs = b_prefs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -15196,7 +15531,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj __Pyx_FastGIL_Remember(); /*try:*/ { - /* "ssh2/session.pyx":878 + /* "ssh2/session.pyx":907 * cdef int rc * with nogil: * rc = c_ssh2.libssh2_session_method_pref( # <<<<<<<<<<<<<< @@ -15206,7 +15541,7 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj __pyx_v_rc = libssh2_session_method_pref(__pyx_v_self->_session, __pyx_v_method_type->value, __pyx_v_c_prefs); } - /* "ssh2/session.pyx":877 + /* "ssh2/session.pyx":906 * cdef const char *c_prefs = b_prefs * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -15223,27 +15558,27 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_86method_pref(struct __pyx_obj } } - /* "ssh2/session.pyx":880 + /* "ssh2/session.pyx":909 * rc = c_ssh2.libssh2_session_method_pref( * self._session, method_type.value, c_prefs) * handle_error_codes(rc) # <<<<<<<<<<<<<< * return rc */ - __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 880, __pyx_L1_error) + __pyx_t_3 = __pyx_f_4ssh2_5utils_handle_error_codes(__pyx_v_rc, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 909, __pyx_L1_error) - /* "ssh2/session.pyx":881 + /* "ssh2/session.pyx":910 * self._session, method_type.value, c_prefs) * handle_error_codes(rc) * return rc # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh2/session.pyx":859 + /* "ssh2/session.pyx":888 * return to_str(methods) * * def method_pref(self, MethodType method_type, prefs not None): # <<<<<<<<<<<<<< @@ -15348,16 +15683,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_13_kbd_callback___get__(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_89__reduce_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_91__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_88__reduce_cython__, "Session.__reduce_cython__(self)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_89__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_89__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_88__reduce_cython__}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_89__reduce_cython__(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_90__reduce_cython__, "Session.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_91__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_91__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_90__reduce_cython__}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_91__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15383,14 +15718,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_4ssh2_7session_7Session_88__reduce_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_90__reduce_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_88__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_90__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -15430,16 +15765,16 @@ static PyObject *__pyx_pf_4ssh2_7session_7Session_88__reduce_cython__(CYTHON_UNU */ /* Python wrapper */ -static PyObject *__pyx_pw_4ssh2_7session_7Session_91__setstate_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_4ssh2_7session_7Session_93__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_90__setstate_cython__, "Session.__setstate_cython__(self, __pyx_state)"); -static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_91__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_91__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_90__setstate_cython__}; -static PyObject *__pyx_pw_4ssh2_7session_7Session_91__setstate_cython__(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_4ssh2_7session_7Session_92__setstate_cython__, "Session.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4ssh2_7session_7Session_93__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_93__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_92__setstate_cython__}; +static PyObject *__pyx_pw_4ssh2_7session_7Session_93__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15505,7 +15840,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_4ssh2_7session_7Session_90__setstate_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v___pyx_state); + __pyx_r = __pyx_pf_4ssh2_7session_7Session_92__setstate_cython__(((struct __pyx_obj_4ssh2_7session_Session *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -15515,7 +15850,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_4ssh2_7session_7Session_90__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_4ssh2_7session_7Session_92__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4ssh2_7session_Session *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -15660,29 +15995,30 @@ static PyMethodDef __pyx_methods_4ssh2_7session_Session[] = { {"open_session", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_41open_session, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_40open_session}, {"direct_tcpip_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_43direct_tcpip_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_42direct_tcpip_ex}, {"direct_tcpip", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_45direct_tcpip, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_44direct_tcpip}, - {"block_directions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_47block_directions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_46block_directions}, - {"flag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_49flag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_48flag}, - {"forward_listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_51forward_listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_50forward_listen}, - {"forward_listen_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_53forward_listen_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52forward_listen_ex}, - {"sftp_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_55sftp_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54sftp_init}, - {"last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_57last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_56last_error}, - {"last_errno", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_59last_errno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_58last_errno}, - {"set_last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_61set_last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_60set_last_error}, - {"scp_recv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_63scp_recv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_62scp_recv}, - {"scp_recv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_65scp_recv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_64scp_recv2}, - {"scp_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_67scp_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_66scp_send}, - {"scp_send64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_69scp_send64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_68scp_send64}, - {"publickey_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_71publickey_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_70publickey_init}, - {"hostkey_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_73hostkey_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_72hostkey_hash}, - {"hostkey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_75hostkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_74hostkey}, - {"knownhost_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_77knownhost_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_76knownhost_init}, - {"keepalive_config", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_79keepalive_config, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_78keepalive_config}, - {"keepalive_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_81keepalive_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_80keepalive_send}, - {"supported_algs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_83supported_algs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_82supported_algs}, - {"methods", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_85methods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_84methods}, - {"method_pref", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_87method_pref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_86method_pref}, - {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_89__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_88__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_91__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_90__setstate_cython__}, + {"direct_streamlocal_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_47direct_streamlocal_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_46direct_streamlocal_ex}, + {"block_directions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_49block_directions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_48block_directions}, + {"flag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_51flag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_50flag}, + {"forward_listen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_53forward_listen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_52forward_listen}, + {"forward_listen_ex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_55forward_listen_ex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_54forward_listen_ex}, + {"sftp_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_57sftp_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_56sftp_init}, + {"last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_59last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_58last_error}, + {"last_errno", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_61last_errno, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_60last_errno}, + {"set_last_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_63set_last_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_62set_last_error}, + {"scp_recv", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_65scp_recv, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_64scp_recv}, + {"scp_recv2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_67scp_recv2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_66scp_recv2}, + {"scp_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_69scp_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_68scp_send}, + {"scp_send64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_71scp_send64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_70scp_send64}, + {"publickey_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_73publickey_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_72publickey_init}, + {"hostkey_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_75hostkey_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_74hostkey_hash}, + {"hostkey", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_77hostkey, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_76hostkey}, + {"knownhost_init", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_79knownhost_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_78knownhost_init}, + {"keepalive_config", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_81keepalive_config, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_80keepalive_config}, + {"keepalive_send", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_83keepalive_send, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_82keepalive_send}, + {"supported_algs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_85supported_algs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_84supported_algs}, + {"methods", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_87methods, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_86methods}, + {"method_pref", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_89method_pref, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_88method_pref}, + {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_91__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_90__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4ssh2_7session_7Session_93__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4ssh2_7session_7Session_92__setstate_cython__}, {0, 0, 0, 0} }; @@ -17683,256 +18019,268 @@ __Pyx_RefNannySetupContext("PyInit_session", 0); /* "ssh2/session.pyx":476 * return PyChannel(channel, self) * + * def direct_streamlocal_ex(self, socket_path not None, shost not None, int sport): # <<<<<<<<<<<<<< + * """ + * From libssh2 documentation: +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_47direct_streamlocal_ex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_direct_streamlocal_ex, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_direct_streamlocal_ex, __pyx_t_3) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/session.pyx":505 + * return PyChannel(channel, self) + * * def block_directions(self): # <<<<<<<<<<<<<< * """Get blocked directions for the current session. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_47block_directions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_block_directions, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_49block_directions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_block_directions, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_block_directions, __pyx_t_3) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_block_directions, __pyx_t_3) < 0) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":503 + /* "ssh2/session.pyx":532 * return rc * * def flag(self, FlagType flag, enabled=True): # <<<<<<<<<<<<<< * """ * Enable/Disable flag for session. */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_49flag, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_flag, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_51flag, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_flag, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[2]); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_3) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_flag, __pyx_t_3) < 0) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":538 + /* "ssh2/session.pyx":567 * handle_error_codes(rc) * * def forward_listen(self, int port): # <<<<<<<<<<<<<< * """Create forward listener on port. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_51forward_listen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_forward_listen, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_53forward_listen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_forward_listen, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_forward_listen, __pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_forward_listen, __pyx_t_3) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":554 + /* "ssh2/session.pyx":583 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< * """ * Instruct the remote SSH server to begin listening for inbound */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_53forward_listen_ex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_forward_listen_ex, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_55forward_listen_ex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_forward_listen_ex, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_forward_listen_ex, __pyx_t_3) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_forward_listen_ex, __pyx_t_3) < 0) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":590 + /* "ssh2/session.pyx":619 * return (PyListener(listener, self), bound_port) * * def sftp_init(self): # <<<<<<<<<<<<<< * """Initialise SFTP channel. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_55sftp_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_sftp_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_57sftp_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_sftp_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_sftp_init, __pyx_t_3) < 0) __PYX_ERR(0, 590, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_sftp_init, __pyx_t_3) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":603 + /* "ssh2/session.pyx":632 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< * """Retrieve last error message from libssh2, if any. * Returns empty string on no error message. */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_57last_error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_last_error, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_59last_error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_last_error, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_last_error, __pyx_t_3) < 0) __PYX_ERR(0, 603, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_last_error, __pyx_t_3) < 0) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":623 + /* "ssh2/session.pyx":652 * free(_error_msg) * * def last_errno(self): # <<<<<<<<<<<<<< * """Retrieve last error number from libssh2, if any. * Returns 0 on no last error. */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_59last_errno, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_last_errno, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_61last_errno, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_last_errno, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_last_errno, __pyx_t_3) < 0) __PYX_ERR(0, 623, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_last_errno, __pyx_t_3) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":635 + /* "ssh2/session.pyx":664 * return rc * * def set_last_error(self, int errcode, errmsg not None): # <<<<<<<<<<<<<< * cdef bytes b_errmsg = to_bytes(errmsg) * cdef char *_errmsg = b_errmsg */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_61set_last_error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_set_last_error, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_63set_last_error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_set_last_error, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_set_last_error, __pyx_t_3) < 0) __PYX_ERR(0, 635, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_set_last_error, __pyx_t_3) < 0) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":644 + /* "ssh2/session.pyx":673 * return rc * * def scp_recv(self, path not None): # <<<<<<<<<<<<<< * """Receive file via SCP. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_63scp_recv, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_recv, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_65scp_recv, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_recv, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_recv, __pyx_t_3) < 0) __PYX_ERR(0, 644, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_recv, __pyx_t_3) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":666 + /* "ssh2/session.pyx":695 * return PyChannel(channel, self), statinfo * * def scp_recv2(self, path not None): # <<<<<<<<<<<<<< * """Receive file via SCP. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_65scp_recv2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_recv2, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_67scp_recv2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_recv2, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_recv2, __pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_recv2, __pyx_t_3) < 0) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":686 + /* "ssh2/session.pyx":715 * return PyChannel(channel, self), fileinfo * * def scp_send(self, path not None, int mode, size_t size): # <<<<<<<<<<<<<< * """Deprecated in favour of scp_send64. Send file via SCP. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_67scp_send, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_send, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_69scp_send, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_send, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_send, __pyx_t_3) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_send, __pyx_t_3) < 0) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":708 + /* "ssh2/session.pyx":737 * return PyChannel(channel, self) * * def scp_send64(self, path not None, int mode, c_ssh2.libssh2_uint64_t size, # <<<<<<<<<<<<<< * time_t mtime, time_t atime): * """Send file via SCP. */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_69scp_send64, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_send64, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_71scp_send64, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_scp_send64, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_send64, __pyx_t_3) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_scp_send64, __pyx_t_3) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":731 + /* "ssh2/session.pyx":760 * return PyChannel(channel, self) * * def publickey_init(self): # <<<<<<<<<<<<<< * """Initialise public key subsystem for managing remote server * public keys""" */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_71publickey_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_publickey_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_73publickey_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_publickey_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_publickey_init, __pyx_t_3) < 0) __PYX_ERR(0, 731, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_publickey_init, __pyx_t_3) < 0) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":741 + /* "ssh2/session.pyx":770 * return PyPublicKeySystem(_pkey, self) * * def hostkey_hash(self, int hash_type): # <<<<<<<<<<<<<< * """Get computed digest of the remote system's host key. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_73hostkey_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_hostkey_hash, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_75hostkey_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_hostkey_hash, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_hostkey_hash, __pyx_t_3) < 0) __PYX_ERR(0, 741, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_hostkey_hash, __pyx_t_3) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":758 + /* "ssh2/session.pyx":787 * return b_hash * * def hostkey(self): # <<<<<<<<<<<<<< * """Get server host key for this session. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_75hostkey, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_hostkey, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_77hostkey, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_hostkey, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_hostkey, __pyx_t_3) < 0) __PYX_ERR(0, 758, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_hostkey, __pyx_t_3) < 0) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":780 + /* "ssh2/session.pyx":809 * return key, key_type * * def knownhost_init(self): # <<<<<<<<<<<<<< * """Initialise a collection of known hosts for this session. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_77knownhost_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_knownhost_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_79knownhost_init, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_knownhost_init, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_knownhost_init, __pyx_t_3) < 0) __PYX_ERR(0, 780, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_knownhost_init, __pyx_t_3) < 0) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":792 + /* "ssh2/session.pyx":821 * return PyKnownHost(self, known_hosts) * * def keepalive_config(self, bint want_reply, unsigned interval): # <<<<<<<<<<<<<< * """ * Configure keep alive settings. */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_79keepalive_config, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_keepalive_config, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_81keepalive_config, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_keepalive_config, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_keepalive_config, __pyx_t_3) < 0) __PYX_ERR(0, 792, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_keepalive_config, __pyx_t_3) < 0) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":805 + /* "ssh2/session.pyx":834 * c_ssh2.libssh2_keepalive_config(self._session, want_reply, interval) * * def keepalive_send(self): # <<<<<<<<<<<<<< * """Send keepalive. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_81keepalive_send, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_keepalive_send, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_83keepalive_send, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_keepalive_send, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_keepalive_send, __pyx_t_3) < 0) __PYX_ERR(0, 805, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_keepalive_send, __pyx_t_3) < 0) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":819 + /* "ssh2/session.pyx":848 * return c_seconds * * def supported_algs(self, MethodType method_type): # <<<<<<<<<<<<<< * """Get supportd algorithms for method type. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_83supported_algs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_supported_algs, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_85supported_algs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_supported_algs, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_supported_algs, __pyx_t_3) < 0) __PYX_ERR(0, 819, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_supported_algs, __pyx_t_3) < 0) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":844 + /* "ssh2/session.pyx":873 * return algs * * def methods(self, MethodType method_type): # <<<<<<<<<<<<<< * """Get currently active algorithms for method type. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_85methods, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_methods, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_87methods, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_methods, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_methods, __pyx_t_3) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_methods, __pyx_t_3) < 0) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "ssh2/session.pyx":859 + /* "ssh2/session.pyx":888 * return to_str(methods) * * def method_pref(self, MethodType method_type, prefs not None): # <<<<<<<<<<<<<< * """Set preference for session method. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_87method_pref, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_method_pref, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_89method_pref, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session_method_pref, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_method_pref, __pyx_t_3) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_4ssh2_7session_Session, __pyx_mstate_global->__pyx_n_u_method_pref, __pyx_t_3) < 0) __PYX_ERR(0, 888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 @@ -17940,7 +18288,7 @@ __Pyx_RefNannySetupContext("PyInit_session", 0); * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_89__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_91__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17951,7 +18299,7 @@ __Pyx_RefNannySetupContext("PyInit_session", 0); * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_91__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4ssh2_7session_7Session_93__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Session___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_ssh2_session, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18075,6 +18423,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_Session_agent_auth, sizeof(__pyx_k_Session_agent_auth), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_agent_auth */ {__pyx_k_Session_agent_init, sizeof(__pyx_k_Session_agent_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_agent_init */ {__pyx_k_Session_block_directions, sizeof(__pyx_k_Session_block_directions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_block_directions */ + {__pyx_k_Session_direct_streamlocal_ex, sizeof(__pyx_k_Session_direct_streamlocal_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_direct_streamlocal_ex */ {__pyx_k_Session_direct_tcpip, sizeof(__pyx_k_Session_direct_tcpip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_direct_tcpip */ {__pyx_k_Session_direct_tcpip_ex, sizeof(__pyx_k_Session_direct_tcpip_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_direct_tcpip_ex */ {__pyx_k_Session_disconnect, sizeof(__pyx_k_Session_disconnect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Session_disconnect */ @@ -18141,6 +18490,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_b_privatekey, sizeof(__pyx_k_b_privatekey), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_privatekey */ {__pyx_k_b_publickey, sizeof(__pyx_k_b_publickey), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_publickey */ {__pyx_k_b_shost, sizeof(__pyx_k_b_shost), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_shost */ + {__pyx_k_b_socket_path, sizeof(__pyx_k_b_socket_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_socket_path */ {__pyx_k_b_username, sizeof(__pyx_k_b_username), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b_username */ {__pyx_k_block_directions, sizeof(__pyx_k_block_directions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_block_directions */ {__pyx_k_blocking, sizeof(__pyx_k_blocking), 0, 1, 1}, /* PyObject cname: __pyx_n_u_blocking */ @@ -18148,9 +18498,12 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_c_algs, sizeof(__pyx_k_c_algs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_algs */ {__pyx_k_c_prefs, sizeof(__pyx_k_c_prefs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_prefs */ {__pyx_k_c_seconds, sizeof(__pyx_k_c_seconds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_seconds */ + {__pyx_k_c_shost, sizeof(__pyx_k_c_shost), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_shost */ + {__pyx_k_c_socket_path, sizeof(__pyx_k_c_socket_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c_socket_path */ {__pyx_k_callback, sizeof(__pyx_k_callback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_callback */ {__pyx_k_channel, sizeof(__pyx_k_channel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_channel */ {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_direct_streamlocal_ex, sizeof(__pyx_k_direct_streamlocal_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_direct_streamlocal_ex */ {__pyx_k_direct_tcpip, sizeof(__pyx_k_direct_tcpip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_direct_tcpip */ {__pyx_k_direct_tcpip_ex, sizeof(__pyx_k_direct_tcpip_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_direct_tcpip_ex */ {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ @@ -18261,6 +18614,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_size, sizeof(__pyx_k_size), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size */ {__pyx_k_sock, sizeof(__pyx_k_sock), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sock */ {__pyx_k_sock_2, sizeof(__pyx_k_sock_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sock_2 */ + {__pyx_k_socket_path, sizeof(__pyx_k_socket_path), 0, 1, 1}, /* PyObject cname: __pyx_n_u_socket_path */ {__pyx_k_sport, sizeof(__pyx_k_sport), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sport */ {__pyx_k_ssh2_session, sizeof(__pyx_k_ssh2_session), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ssh2_session */ {__pyx_k_ssh2_session_pyx, sizeof(__pyx_k_ssh2_session_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ssh2_session_pyx */ @@ -18297,7 +18651,7 @@ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 127, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 561, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -18331,36 +18685,36 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "ssh2/session.pyx":503 + /* "ssh2/session.pyx":532 * return rc * * def flag(self, FlagType flag, enabled=True): # <<<<<<<<<<<<<< * """ * Enable/Disable flag for session. */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "ssh2/session.pyx":554 + /* "ssh2/session.pyx":583 * return PyListener(listener, self) * * def forward_listen_ex(self, int queue_maxsize, host=None, int port=0): # <<<<<<<<<<<<<< * """ * Instruct the remote SSH server to begin listening for inbound */ - __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - /* "ssh2/session.pyx":603 + /* "ssh2/session.pyx":632 * return PySFTP(_sftp, self) * * def last_error(self, size_t msg_size=1024): # <<<<<<<<<<<<<< * """Retrieve last error message from libssh2, if any. * Returns empty string on no error message. */ - __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_1024); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_1024); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); __Pyx_RefNannyFinishContext(); @@ -18538,119 +18892,124 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_direct_tcpip, __pyx_k_A_HAQ_1_9_Kwa_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 476, 25}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 476, 94}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_socket_path, __pyx_mstate->__pyx_n_u_shost, __pyx_mstate->__pyx_n_u_sport, __pyx_mstate->__pyx_n_u_b_socket_path, __pyx_mstate->__pyx_n_u_b_shost, __pyx_mstate->__pyx_n_u_c_socket_path, __pyx_mstate->__pyx_n_u_c_shost, __pyx_mstate->__pyx_n_u_channel}; + __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_direct_streamlocal_ex, __pyx_k_A_81A_XQa_1_B_4_Raajjk_83a_W_Gq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 505, 25}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rc}; - __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_block_directions, __pyx_k_A_8_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_block_directions, __pyx_k_A_8_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 503, 64}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 532, 64}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_enabled, __pyx_mstate->__pyx_n_u_rc, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_flag, __pyx_k_6_uD_a_AQ_AT_D_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_flag, __pyx_k_6_uD_a_AQ_AT_D_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 538, 60}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 567, 60}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_listener}; - __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_forward_listen, __pyx_k_A_A_Kq_9Cq_W_Gq_A_z_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_forward_listen, __pyx_k_A_A_Kq_9Cq_W_Gq_A_z_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554, 118}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 583, 118}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_queue_maxsize, __pyx_mstate->__pyx_n_u_host, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_listener, __pyx_mstate->__pyx_n_u_b_host, __pyx_mstate->__pyx_n_u_host_2, __pyx_mstate->__pyx_n_u_bound_port}; - __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_forward_listen_ex, __pyx_k_8_q_HE_Jhaq_1_7_A_a_q_KwfA_9Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_forward_listen_ex, __pyx_k_8_q_HE_Jhaq_1_7_A_a_q_KwfA_9Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 590, 57}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 619, 57}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sftp}; - __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_sftp_init, __pyx_k_A_AT_6_A_W_Gq_A_vQgQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_sftp_init, __pyx_k_A_AT_6_A_W_Gq_A_vQgQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 603, 92}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 632, 92}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_msg_size, __pyx_mstate->__pyx_n_u_error_msg, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_errmsg_len}; - __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_last_error, __pyx_k_a_q_Rq_Q_Kq_A_A_j_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_last_error, __pyx_k_a_q_Rq_Q_Kq_A_A_j_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623, 25}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 652, 25}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rc}; - __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_last_errno, __pyx_k_A_2_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_last_errno, __pyx_k_A_2_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 635, 41}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 664, 41}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_errcode, __pyx_mstate->__pyx_n_u_errmsg, __pyx_mstate->__pyx_n_u_b_errmsg, __pyx_mstate->__pyx_n_u_errmsg_2, __pyx_mstate->__pyx_n_u_rc}; - __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_set_last_error, __pyx_k_A_haq_Q_6a_Ky_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_set_last_error, __pyx_k_A_haq_Q_6a_Ky_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644, 87}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 673, 87}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_b_path, __pyx_mstate->__pyx_n_u_path_2, __pyx_mstate->__pyx_n_u_statinfo, __pyx_mstate->__pyx_n_u_channel}; - __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_recv, __pyx_k_A_HAQ_1_Q_Kwha_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_recv, __pyx_k_A_HAQ_1_Q_Kwha_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 666, 87}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 695, 87}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_fileinfo, __pyx_mstate->__pyx_n_u_b_path, __pyx_mstate->__pyx_n_u_path_2, __pyx_mstate->__pyx_n_u_channel}; - __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_recv2, __pyx_k_A_HAQ_1_a_Kwha_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_recv2, __pyx_k_A_HAQ_1_a_Kwha_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 686, 78}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 715, 78}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_b_path, __pyx_mstate->__pyx_n_u_path_2, __pyx_mstate->__pyx_n_u_channel}; - __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_send, __pyx_k_A_HAQ_1_Q_KwfA_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_send, __pyx_k_A_HAQ_1_Q_KwfA_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 708, 82}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 737, 82}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_mtime, __pyx_mstate->__pyx_n_u_atime, __pyx_mstate->__pyx_n_u_b_path, __pyx_mstate->__pyx_n_u_path_2, __pyx_mstate->__pyx_n_u_channel}; - __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_send64, __pyx_k_A_HAQ_1_q_KwfF_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_scp_send64, __pyx_k_A_HAQ_1_q_KwfF_83a_W_Gq_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 731, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 760, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pkey}; - __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_publickey_init, __pyx_k_A_1_a_6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_publickey_init, __pyx_k_A_1_a_6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 741, 43}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 770, 43}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hash_type, __pyx_mstate->__pyx_n_u_hash, __pyx_mstate->__pyx_n_u_b_hash}; - __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_hostkey_hash, __pyx_k_A_q_Kq_6_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_hostkey_hash, __pyx_k_A_q_Kq_6_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 758, 79}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 787, 79}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_key_2, __pyx_mstate->__pyx_n_u_key_len, __pyx_mstate->__pyx_n_u_key_type}; - __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_hostkey, __pyx_k_A_a_A_1_Kq_5_1_Q_d_A_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_hostkey, __pyx_k_A_a_A_1_Kq_5_1_Q_d_A_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 780, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 809, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_known_hosts}; - __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_knownhost_init, __pyx_k_A_7q_A_s_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_knownhost_init, __pyx_k_A_7q_A_s_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 792, 20}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821, 20}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_want_reply, __pyx_mstate->__pyx_n_u_interval}; - __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_keepalive_config, __pyx_k_A_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_keepalive_config, __pyx_k_A_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 805, 45}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 834, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_seconds, __pyx_mstate->__pyx_n_u_c_seconds, __pyx_mstate->__pyx_n_u_rc}; - __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_keepalive_send, __pyx_k_A_1_Q_at_aq_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_keepalive_send, __pyx_k_A_1_Q_at_aq_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 819, 106}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 848, 106}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_method_type, __pyx_mstate->__pyx_n_u_c_algs, __pyx_mstate->__pyx_n_u_rc, __pyx_mstate->__pyx_n_u_algs, __pyx_mstate->__pyx_n_u_i}; - __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_supported_algs, __pyx_k_A_6a_K_1_3b_Qa_1_1_1F_6_d_uAQ_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_supported_algs, __pyx_k_A_6a_K_1_3b_Qa_1_1_1F_6_d_uAQ_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 844, 45}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 873, 45}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_method_type, __pyx_mstate->__pyx_n_u_methods}; - __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_methods, __pyx_k_A_4t1_4A_K_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_methods, __pyx_k_A_4t1_4A_K_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 859, 52}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 888, 52}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_method_type, __pyx_mstate->__pyx_n_u_prefs, __pyx_mstate->__pyx_n_u_b_prefs, __pyx_mstate->__pyx_n_u_c_prefs, __pyx_mstate->__pyx_n_u_rc}; - __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_method_pref, __pyx_k_A_XQa_1_31_K_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_session_pyx, __pyx_mstate->__pyx_n_u_method_pref, __pyx_k_A_XQa_1_31_K_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; - __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; diff --git a/ssh2/session.pyx b/ssh2/session.pyx index 0a885a2a..5cead79f 100644 --- a/ssh2/session.pyx +++ b/ssh2/session.pyx @@ -473,6 +473,35 @@ cdef class Session: self._session)) return PyChannel(channel, self) + def direct_streamlocal_ex(self, socket_path not None, shost not None, int sport): + """ + From libssh2 documentation: + Tunnel a UNIX socket connection through the SSH transport via the remote host to a third party. + Communication from the client to the SSH server remains encrypted, communication from the server to the + 3rd party host travels in cleartext. + + :param socket_path: Unix socket path to connect to using the SSH host as a proxy. + :type socket_path: str + :param shost: Host to tell the SSH server the connection originated on. + :type shost: str + :param sport: Port to tell the SSH server the connection originated from. + :type sport: int + :returns: A `Channel` object for the server intiated connection to the third party or an exception is raised + on any error. + :rtype: `ssh2.channel.Channel` + """ + cdef bytes b_socket_path = to_bytes(socket_path) + cdef bytes b_shost = to_bytes(shost) + cdef const char *c_socket_path = b_socket_path + cdef const char *c_shost = b_shost + cdef c_ssh2.LIBSSH2_CHANNEL *channel + with nogil: + channel = c_ssh2.libssh2_channel_direct_streamlocal_ex(self._session, c_socket_path, c_shost, sport) + if channel is NULL: + return handle_error_codes(c_ssh2.libssh2_session_last_errno( + self._session)) + return PyChannel(channel, self) + def block_directions(self): """Get blocked directions for the current session.