James Housley
7d57222912
Finish making SFTP fully non-blocking capable.
...
Functions that return an "int", and friends, return LIBSSH2SFTP_EAGAIN.
Functions that return a structure return NULL and set the error to
LIBSSH2_ERROR_EAGAIN
2007-06-07 16:01:12 +00:00
James Housley
d141ba49f3
Make libssh2_sftp_write() be fully non-blocking. The state of the socket
...
is fully honored. LIBSSH2SFTP_EAGAIN is returned when the call would
block.
2007-06-06 19:52:11 +00:00
James Housley
4b8db8c1ab
Modify the code to truely support non-blocking. Propogate the EAGAIN error
...
all the way up to the user interface. All code modules bug sftp.c have
been completed.
Functions that return an "int", or similar return LIBSSH2CHANNEL_EAGAIN to
indicate some part of the call would block, in non-blocking mode.
Functions that return a structure, like "LIBSSH2_CHANNEL *", return NULL
and set the libssh2 error. The error can be obtained with either
libssh2_session_last_error() or libssh2_session_last_errno(). Either of
these will return the error code of LIBSSH2_ERROR_EAGAIN if the
call would block, in non-blocking mode.
The current state of a function and some variable are keep in the
structures so that on the next call the operation that would block can
be retried again with the same data.
2007-06-06 12:34:06 +00:00
James Housley
9896c291e4
libssh2_packet_read() was checking the "errno" even when recv() didn't
...
return an error. "errno" should have been zero by the recv() call but
doesn't seem to be on all systems. Only check when recv() says there
is an error.
Bug: 1703467
Patch: 1703468
2007-06-06 10:13:30 +00:00
James Housley
412b25d971
Initially the libssh2 code was indented with tabs of 4 spaces. Some of
...
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size. Other commits converted the tabs to 8 spaces, this
didn't match.
All the code has been converted to 4 space indents. No changes to line
lengths or actual code was performed. This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.
2007-05-28 17:56:08 +00:00
Daniel Stenberg
355c9c634b
Eberhard Mattes' fix for libssh2_packet_read() for when reading very small
...
chunks at a time.
2007-05-08 19:20:05 +00:00
Dan Fandrich
62f77b1e4b
Fix building out of the source tree.
2007-05-01 20:07:08 +00:00
Guenter Knauf
145bbabb96
include libssh_config.h to get the configure vars in.
2007-04-26 23:59:14 +00:00
Guenter Knauf
40970adb53
changed to configure defines to control inclusion of headers from libssh2_config.h.
2007-04-26 22:59:29 +00:00
James Housley
34bcc69a1a
Add more of the new programs to be ignored
2007-04-22 19:53:58 +00:00
James Housley
046edb478f
Test programs for libssh2_sftp_mkdir_ex() and libssh2_sftp_mkdirnb_ex()
2007-04-22 19:52:51 +00:00
James Housley
54e6528822
Document libssh2_sftp_mkdir_ex() and libssh2_sftp_mkdirnb_ex()
2007-04-22 19:51:53 +00:00
James Housley
a66885c51c
Make _libssh2_sftp_mkdir_ex() fully non-blocking safe. This makes
...
libssh2_sftp_mkdirnb_ex() non-blocking safe and libssh2_sftp_mkdir_ex()
blocking safe
2007-04-22 19:51:24 +00:00
James Housley
510df9bf52
libssh2_sftp.h is needed for all of these functions
2007-04-22 17:18:03 +00:00
James Housley
61807e8d4d
Fix a couple of locations where read should have been readdir
2007-04-22 17:09:23 +00:00
James Housley
9ff217b6d2
libssh2_sftp_seek() and libssh2_sftp_tell() are NB-SAFE, since they
...
only set variables
2007-04-22 16:42:54 +00:00
James Housley
c43c390a7d
Create two sample programs, similar to sftp.c and sftp_nonblock.c, that
...
will test blocking and non-blocking write SFTP transfers
2007-04-22 15:57:52 +00:00
James Housley
7eccfc7fbc
Make _libssh2_sftp_write() fully non-blocking safe. This makes
...
libssh2_sftp_writenb() non-blocking safe and libssh2_sftp_write() blocking
safe
2007-04-22 15:56:06 +00:00
James Housley
d79939fc3a
Commit the version that actually uses the non-blocking code
2007-04-22 15:05:06 +00:00
James Housley
c5fb9d8f1a
Commit the version that actually uses the non-blocking read
2007-04-22 14:51:21 +00:00
James Housley
e85a2199b6
Update comment
2007-04-22 14:47:27 +00:00
James Housley
3bd3eb35b3
Make sftp_nonblock.c a non-blocking version of sftp.c, just like sftpdir.c
2007-04-22 14:16:26 +00:00
James Housley
08fd7e259b
Move sftp_nonblock.c to sftp_RW_nonblock.c, since it isn't just a
...
non-blocking version of sftp.c. It has different command line parameters
and tries to do more
2007-04-22 14:15:47 +00:00
James Housley
42f0f69a35
Make _libssh2_sftp_read() fully non-blocking safe. This makes
...
libssh2_sftp_readnb() non-blocking safe and libssh2_sftp_read() blocking
safe
2007-04-22 13:13:51 +00:00
James Housley
75ac861c7a
* Explicity set blocking
2007-04-22 13:10:48 +00:00
James Housley
04e975b6c7
Unless we tell libssh2 that we are blocking, which we are because didn't
...
set the socket to non-blocking it will think we are in non-blocking mode
in a lot of places
2007-04-22 11:01:54 +00:00
James Housley
f14aa01bb8
Add comment about setting non-blocking
2007-04-22 11:00:02 +00:00
Guenter Knauf
ab7c3fb2d4
fixed ARFLAGS for CodeWarrior build.
2007-04-21 23:36:51 +00:00
Guenter Knauf
1ebe0a64b3
some more makefile fixes.
2007-04-21 21:26:54 +00:00
Guenter Knauf
6cd1c7528e
fixed debug option.
2007-04-21 20:15:33 +00:00
Guenter Knauf
91c8715da4
fixed ARFLAGS for CodeWarrior build;
...
added libssh2_sftp_writenb to export list.
2007-04-21 18:46:30 +00:00
James Housley
2dc313d365
Non-blocking work
...
* The following low level packet routines now fully support non-blocking:
libssh2_sftp_packet_read()
libssh2_sftp_packet_ask()
libssh2_sftp_packet_require()
libssh2_sftp_packet_requirev()
* libssh2_sftp_readdirnb() functions completely in non-blocking mode
* The rest of the routines which call the libssh2_sftp_packet_* routine
loop on a return code of PACKET_EAGAIN. This maintains the current
functionality until they fully support non-blocking
* The state of all function are labeled with either NB-SAFE or NB-UNSAFE,
for those that are know. NB-UNSAFE?? for those that haven't been
examined.
2007-04-21 18:16:23 +00:00
James Housley
f8fe38e3a5
Create a simple test for sftp readdir with non-blocking
2007-04-21 18:08:00 +00:00
James Housley
bda32b6bbf
Document libssh2_sftp_readdir() and libssh2_sftp_readdirnb()
2007-04-21 18:07:17 +00:00
Dan Fandrich
09deb228f1
Added some consts to struct members
2007-04-19 19:40:45 +00:00
Dan Fandrich
1a6e00cfef
Fixed some compiler warnings and made some more tables 'const'.
2007-04-18 21:03:42 +00:00
Dan Fandrich
9b81a01376
Made some function parameters in the API const. This is an API change,
...
but correctly-written applications should see no source or binary
compatibility issues. Also fixed a few compiler warnings.
2007-04-18 18:51:03 +00:00
Dan Fandrich
4c6bfdd5b2
Bail out on a short kex packet.
2007-04-17 18:30:05 +00:00
Dan Fandrich
5dd66e604f
Made most internal tables 'static const'.
2007-04-17 18:12:41 +00:00
Guenter Knauf
d45d509a09
added ranlib when library is created with ar.
2007-04-16 20:56:08 +00:00
Guenter Knauf
d44e222b75
added sftpdir target; fixed linking.
2007-04-14 21:26:03 +00:00
Dan Fandrich
197764afcc
Properly propagate out of memory errors.
2007-04-13 18:28:10 +00:00
Simon Josefsson
d79f906b52
Add.
2007-04-13 06:09:12 +00:00
Simon Josefsson
08cf9fd7de
Add.
2007-04-13 06:08:25 +00:00
Simon Josefsson
7edad3046e
Make ChangeLog a phony target.
2007-04-13 06:06:15 +00:00
Guenter Knauf
f33375bc03
changed to configure defines to control inclusion of headers from libssh2_config.h.
2007-04-12 22:20:18 +00:00
Guenter Knauf
159c351d05
Win32 has no ENOTCONN - checked MSVC6, MingW32, Borland C++ 5.5, OpenWatcom 1.6; all have this define in winsock2.h but blocked with '#if 0';
...
changed to configure defines to control inclusion of headers from libssh2_config.h
2007-04-12 22:18:27 +00:00
Guenter Knauf
8371fa7b87
updated Makefile.netware to add more exports; fixed linking;
...
updated OpenSSL version to have users use latest.
2007-04-12 22:15:12 +00:00
Guenter Knauf
0eefd06af0
removed HAVE_IOCTLSOCKET define;
...
updated OpenSSL version to have users use latest.
2007-04-12 22:13:14 +00:00
Guenter Knauf
86ca80028b
blocked unistd.h inclusion for Win32 builds.
2007-04-12 22:10:12 +00:00