Skip to content

Commit a615bf4

Browse files
author
Pan
committed
Implemented channel receive window adjust, x11_*, poll and handle extended data methods.
Implemented session get/set blocking, get/set timeout and scp methods and integration tests. Updated agent connection error exception. Updated session method name to match libssh2. Implemented file info extension class for SCP file stat structure.
1 parent 93cf4d7 commit a615bf4

19 files changed

+7887
-1847
lines changed

ssh2/agent.c

Lines changed: 22 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/agent.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
cimport c_ssh2
1818
from pkey cimport PublicKey, PyPublicKey
19-
from exceptions cimport AgentConnectError, AgentListIdentitiesError, \
19+
from exceptions cimport AgentConnectionError, AgentListIdentitiesError, \
2020
AgentGetIdentityError, AgentAuthenticationError
2121
from utils cimport to_bytes
2222

@@ -131,7 +131,7 @@ cdef class Agent:
131131
def connect(self):
132132
"""Connect to agent.
133133
134-
:raises: :py:class:`ssh2.exceptions.AgentConnectError` on errors
134+
:raises: :py:class:`ssh2.exceptions.AgentConnectionError` on errors
135135
connecting to agent.
136136
137137
:rtype: int"""
@@ -140,5 +140,5 @@ cdef class Agent:
140140
rc = c_ssh2.libssh2_agent_connect(self._agent)
141141
if rc != 0:
142142
with gil:
143-
raise AgentConnectError("Unable to connect to agent")
143+
raise AgentConnectionError("Unable to connect to agent")
144144
return rc

ssh2/c_ssh2.pxd

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
# License along with this library; if not, write to the Free Software
1515
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616

17+
from libc.stdint cimport uint64_t
1718
from libc.time cimport time_t
18-
from posix.types cimport off_t
19+
from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, mode_t,
20+
nlink_t, off_t, time_t, uid_t)
21+
1922

2023
cdef extern from "libssh2.h" nogil:
2124
ctypedef int libssh2_socket_t
@@ -29,10 +32,35 @@ cdef extern from "libssh2.h" nogil:
2932
_LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA "LIBSSH2_CHANNEL_FLUSH_EXTENDED_DATA"
3033
_LIBSSH2_CHANNEL_FLUSH_ALL "LIBSSH2_CHANNEL_FLUSH_ALL"
3134
ctypedef long long libssh2_int64_t
32-
ctypedef struct stat
33-
ctypedef off_t libssh2_struct_stat_size
35+
ctypedef struct stat:
36+
dev_t st_dev
37+
ino_t st_ino
38+
mode_t st_mode
39+
nlink_t st_nlink
40+
uid_t st_uid
41+
gid_t st_gid
42+
dev_t st_rdev
43+
off_t st_size
44+
blksize_t st_blksize
45+
blkcnt_t st_blocks
46+
time_t st_atime
47+
time_t st_mtime
48+
time_t st_ctime
49+
ctypedef uint64_t libssh2_struct_stat_size
3450
ctypedef struct libssh2_struct_stat:
35-
libssh2_struct_stat_size st_size
51+
dev_t st_dev
52+
ino_t st_ino
53+
unsigned long st_mode
54+
nlink_t st_nlink
55+
uid_t st_uid
56+
gid_t st_gid
57+
dev_t st_rdev
58+
uint64_t st_size
59+
blksize_t st_blksize
60+
blkcnt_t st_blocks
61+
time_t st_atime
62+
time_t st_mtime
63+
time_t st_ctime
3664
ctypedef struct LIBSSH2_SESSION:
3765
pass
3866
ctypedef struct LIBSSH2_CHANNEL:

0 commit comments

Comments
 (0)