On Mon, 29 Sep 2008 23:43:30 +0200 Peter Stuge <[EMAIL PROTECTED]> wrote:
> E L wrote: > > Alternatively, if the result of recv() or send() is not checked, > > What? Checking for errors really has to be programming 101.. > > The current libssh2 code has something like this ret = recv(session->socket_fd, &c, 1, LIBSSH2_SOCKET_RECV_FLAGS(session)); if (ret < 0) { #ifdef WIN32 switch (WSAGetLastError()) { case WSAEWOULDBLOCK: ... #endif The return is checked directly. The patch I was commenting on removed the "if ret < 0" stuff and just checked WSAGetLastError(). That would be OK if the error variable was cleared error before the socket call. Then the result of recv() and send() would be implicitly checked, and programming 101 would not be violated. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ libssh2-devel mailing list libssh2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libssh2-devel