Re: [libssh2] code hangs with sftp downloads, solved
On Fri, 12 Sep 2008, E L wrote: >> Your patch was real close, but it doesn't address the above statement. >> >> Could you verify if the attached patch works fine for you, and report back >> to the list, so that someone might commit it to CVS ? > > Right now, the code works because errno is only checked if the result of the > socket call fail, so clearing it before the call is not needed. The bigger > issue is that on Windows, send() and recv() do not set errno at all. > http://msdn.microsoft.com/en-us/library/ms737828(VS.85).aspx > > I'm running the patched version right now and it is working. Right, but can you please answer to Yang's question whether his version of the fix works for you? That looks cleaner code-wise to me, so I would prefer to have his version get committed! -- / daniel.haxx.se - 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
[libssh2] [ libssh2-Bugs-2133354 ] libssh2_poll_channel_read doesn't work correctly
Bugs item #2133354, was opened at 2008-09-28 05:31 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2133354&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Paul Thomas (thomaspu) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2_poll_channel_read doesn't work correctly Initial Comment: The libssh2_poll_channel_read doesn't read both normal and extended data when called like so... libssh2_poll_channel_read( , 1); As taken from the wiki: "...When set to a non-zero value, the extended data stream buffers will be scanned as well" I read that as: if you set the 2nd item to a non-zero value, both normal and extended data is read. This isn't the case, it reads normal data or extended but Not both. Attached is a patch to fix this issue. Paul -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 15:29 Message: Can you please remake the diff with -u? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2133354&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1916627 ] Response to [EMAIL PROTECTED]
Bugs item #1916627, was opened at 2008-03-17 13:10 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1916627&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Response to [EMAIL PROTECTED] Initial Comment: Version 0.18 does not response to [EMAIL PROTECTED] message. Here is some code you could add to make it work. (based on what PuTTY does...) case SSH_MSG_CHANNEL_REQUEST: { if (libssh2_ntohu32(data + 5) == sizeof("exit-status") - 1 && !memcmp("exit-status", data + 9, sizeof("exit-status") - 1)) { /* we've got "exit-status" packet. Set the session value */ session->packAdd_channel = libssh2_channel_locate(session, libssh2_ntohu32(data + 1)); if (session->packAdd_channel) { session->packAdd_channel->exit_status = libssh2_ntohu32(data + 9 + sizeof("exit-status")); _libssh2_debug(session, LIBSSH2_DBG_CONN, "Exit status %lu received for channel %lu/%lu", session->packAdd_channel->exit_status, session->packAdd_channel->local.id, session->packAdd_channel->remote.id); } LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; } else if(libssh2_ntohu32(data+5) == sizeof("[EMAIL PROTECTED]")-1 && !memcmp("[EMAIL PROTECTED]", data+9, sizeof("[EMAIL PROTECTED]")-1)) { libssh2_channel_send_keepalive(session->packAdd_channel); LIBSSH2_FREE(session, data); session->packAdd_state = libssh2_NB_state_idle; return 0; } } break; LIBSSH2_API int libssh2_channel_send_keepalive(LIBSSH2_CHANNEL * channel) { LIBSSH2_SESSION *session = channel->session; unsigned char packet[5];/* packet_type(1) + channelno(4) */ int rc; _libssh2_debug(session, LIBSSH2_DBG_CONN, "Sending Keepalive on channel %lu/%lu", channel->local.id, channel->remote.id); packet[0] = SSH_MSG_CHANNEL_FAILURE; libssh2_htonu32(packet + 1, channel->remote.id); rc = libssh2_packet_write(session, packet, 5); if (rc == PACKET_EAGAIN) { return PACKET_EAGAIN; } else if (rc) { libssh2_error(session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send Keepalive on channel", 0); return -1; } //channel->local.eof = 1; return 0; } -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 15:32 Message: Please make a patch with 'diff -u' and submit it here and we can use it for inclusion! -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1916627&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-2064371 ] Illegal '-' used in identification banner
Bugs item #2064371, was opened at 2008-08-21 11:46 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2064371&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: misc Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Illegal '-' used in identification banner Initial Comment: RFC 4253, section 4.2, states that: "Both the 'protoversion' and 'softwareversion' strings MUST consist of printable US-ASCII characters, with the exception of whitespace characters and the minus sign (-)." However, the LIBSSH2_VERSION define in libssh2.h, which is used to build the 'softwareversion' part of LIBSSH2_SSH_BANNER and LIBSSH2_SSH_DEFAULT_BANNER, contains a '-' between the version number and the date. I haven't encountered any clients that complain over this, but it is a violation of the RFC and also trivial to correct, so it should be. I would suggest simply replacing the '-' with a '_'. Bjrn Stenborg -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 15:43 Message: Thanks, committed now. cased closed! -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=2064371&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1841442 ] libssh2-0.18 session.c
Bugs item #1841442, was opened at 2007-11-30 05:56 Message generated for change (Settings changed) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1841442&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: API Group: None >Status: Pending >Resolution: Fixed Priority: 5 Private: No Submitted By: Gary Miller (gmiller1018) Assigned to: Daniel Stenberg (bagder) Summary: libssh2-0.18 session.c Initial Comment: I have noticed an issue with libssh2_poll on my Linux machines. I found that on my machines HAVE_POLL and HAVE_SELECT are defined and the code that is executed in the poll code not the select. I fixed this by just undef'ing the HAVE_POLL. The other issue here is when the select code is enabled the code in the libssh2_poll seems to be in error. The code as I fixed it is: [code] if (sysret > 0) { for(i = 0; i < nfds; i++) { switch (fds[i].type) { case LIBSSH2_POLLFD_SOCKET: if (FD_ISSET(fds[i].fd.socket, &rfds)) { fds[i].revents |= LIBSSH2_POLLFD_POLLIN; } if (FD_ISSET(fds[i].fd.socket, &wfds)) { fds[i].revents |= LIBSSH2_POLLFD_POLLOUT; } if (fds[i].revents) { active_fds++; } break; case LIBSSH2_POLLFD_CHANNEL: if (FD_ISSET(fds[i].fd.channel->session->socket_fd, &rfds)) { /* Spin session until no data available */ //while (libssh2_packet_read(fds[i].fd.channel->session) // > 0); libssh2_packet_read(fds[i].fd.channel->session); active_fds++; } break; case LIBSSH2_POLLFD_LISTENER: if (FD_ISSET (fds[i].fd.listener->session->socket_fd, &rfds)) { /* Spin session until no data available */ //while (libssh2_packet_read(fds[i].fd.listener->session) // > 0); libssh2_packet_read(fds[i].fd.listener->session); active_fds++; } break; } } } [/code] when the FD_ISSET is true the code was looping reading (libssh2_packet_read) till and error occured but the behavio was reading till blocked. I changed the code to just read once (since that is all the FD_ISSET guaranteed). The increment of active_fds was also missing so the loop would not exit when it needs to. There are still some cases where I think there is data but it is not being returned for some reason. I have not been able to identify the cause but I am working on it. In my use of the poll function I am monitiring sockets of my own and sockets under control of libssh2 so my use may not be typical. should there be some reason that my changes are breaking something and there is another way to fix this please let me know. -- Comment By: Daniel Stenberg (bagder) Date: 2008-01-02 15:49 Message: Logged In: YES user_id=1110 Originator: NO I've committed a fix that uses maxfd+1 -- Comment By: Andrew Fullford (afullfor) Date: 2007-12-12 21:56 Message: Logged In: YES user_id=1958665 Originator: NO Similar problems on a FreeBSD system. The libssh2_packet_read() approach only works if the channel is set to non-blocking. Also, the select() call on line 1481 of session.c is passing "maxfd" as the first argument. The correct value is the number of fds to check, which is actually "maxfd+1". I suspect this is the cause of the additonal issues Gary is seeing as the select() will not report activity on the numerically highest fd, -- Comment By: Daniel Stenberg (bagder) Date: 2007-12-03 11:59 Message: Logged In: YES user_id=1110 Originator: NO Well of course it is a bug if it only works in non-blocking mode, as it is supposed to always work. Personally I only use libssh2 non-blocking... So just changing the docs isn't the proper fix. The socket could of course be made non-blocking just for this loop... Perhaps that is the best fix at least short-term? -- Comment By: Gary Miller (gmiller1018) Date: 2007-11-30 06:53 Message: Logged In: YES user_id=1700690 Originator: YES It appears from my experimentation that the looping to read with the libssh2_packet_read
[libssh2] [ libssh2-Bugs-1860989 ] libssh2_poll handles -1 timeout incorrectly
Bugs item #1860989, was opened at 2007-12-30 18:08 Message generated for change (Settings changed) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1860989&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: API Group: None >Status: Pending >Resolution: Remind Priority: 5 Private: No Submitted By: jls (apjenkins) Assigned to: Daniel Stenberg (bagder) Summary: libssh2_poll handles -1 timeout incorrectly Initial Comment: The documentation for libssh2_poll says the semantics are like poll(2). However poll(2) accepts a -1 timeout, which means to wait indefinitely. libssh2_poll does not correctly handle a -1 timeout. It seems like the only way to indicate an indefinite wait is to pass a really large timeout to libssh2_poll. I think either the documentation should mention that libssh2_poll differs from poll(2) in this way, or a -1 timeout should be supported as meaning wait indefinitely. Currently, if you look in libssh2_poll code, it performs arithmetic on timeout_remaining without first checking to see if it's negative. I can submit a patch to make libssh2_poll support -1 like poll(2) if you'd like. -- Comment By: Daniel Stenberg (bagder) Date: 2008-01-02 15:46 Message: Logged In: YES user_id=1110 Originator: NO That'd be great! -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1860989&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1960894 ] libssh2_scp_* do not handle whitespace in file names
Bugs item #1960894, was opened at 2008-05-09 11:50 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1960894&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Heiner (heiner0) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2_scp_* do not handle whitespace in file names Initial Comment: it seems that some libssh2 SCP functions do not correctly handle whitespace in file names. When trying to copy a file named "with blanks" using libssh2_scp_recv() I get an error message. The reason is that libssh2 builds a "scp" command line that will be run on the remote side, but does not take care to quote the file name. It runs the equivalent of the following "ssh" command: scp -f with blanks instead of (note the quotation marks): scp -f 'with blanks' The code causing problems is in libssh2_scp_recv(): memcpy(session->scpRecv_command, "scp -f ", sizeof("scp -f ") - 1); memcpy(session->scpRecv_command + sizeof("scp -f ") - 1, path, path_len); (Similar code is in libssh2_scp_send()). Variable "path" should get correct quoting. I attached the function shell_quotearg() that could be used for quoting the path name. -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 15:47 Message: So can you please submit a complete patch that makes use of the code you suggest? -- Comment By: Heiner (heiner0) Date: 2008-08-21 18:58 Message: Logged In: YES user_id=1568315 Originator: YES The shell_quotearg() function had problems when the login shell of the remote user was the C-Shell (csh). The new function works with CSH as well. It includes a small test program: cc -DMAIN -o qtest shell_quotearg.c; ./qtest "someone's test" File Added: shell_quotearg.c -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1960894&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1918953 ] SSH disconnect detection
Bugs item #1918953, was opened at 2008-03-19 00:50 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1918953&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: misc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Gary Miller (gmiller1018) Assigned to: Nobody/Anonymous (nobody) Summary: SSH disconnect detection Initial Comment: When using libssh2_poll with a INT max timeout and a socket disconnects there does not seem to be any response. I had expected the libssh2_poll to return with the appropriate status indication. Status passed in as: [code] cur_fd->fd.channel = sess_flags[I].channel; // channel cur_fd->type = LIBSSH2_POLLFD_CHANNEL; cur_fd->events = LIBSSH2_POLLFD_POLLIN | LIBSSH2_POLLFD_POLLERR | LIBSSH2_POLLFD_POLLHUP | LIBSSH2_POLLFD_POLLNVAL | LIBSSH2_POLLFD_SESSION_CLOSED | LIBSSH2_POLLFD_CHANNEL_CLOSED; twait = INT_MAX; // wait forever for input or disconn. Log_debug("Waiting in libssh2_poll"); nfound = libssh2_poll (ssh_fds, count, twait); Log_debug("libssh2_poll returned"); [/code] there is only one socket open at the time and count is set to 1 (in a select I would use 2). I am unsure if there is some behavior or other issue I need to consider to make this work. In past version of the library this worked but I had customized the code because of blocking behavior. This is pure latest release running on Fedora 7 using the RPM's. The connect and read and write appears to work correctly in general use but if the remote system server crashes the disconnect is not signaled so I never try to re-connect. The socket have been set to non blocking by: [code] libssh2_channel_set_blocking(sess_flags[I].channel, 0); // make nonblocking [/code] -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 15:48 Message: Can you please post your suggested changes as a "regular" diff -u output/patch ? -- Comment By: Gary Miller (gmiller1018) Date: 2008-03-22 00:34 Message: Logged In: YES user_id=1700690 Originator: YES All comments were made by me ... I fogot to log in prior to adding them ... sorry -- Comment By: Nobody/Anonymous (nobody) Date: 2008-03-21 23:10 Message: Logged In: NO To work around the issue I modified the code in session.c at line 1544 to be: [code libssh2 session.c] case LIBSSH2_POLLFD_CHANNEL: if (FD_ISSET(fds[i].fd.channel->session->socket_fd, &rfds)) { int rc; fds[i].revents |= LIBSSH2_POLLFD_POLLIN; // force data flag ...(gwm) /* Spin session until no data available */ while ((rc = libssh2_packet_read(fds[i].fd.channel->session)) > 0); // modified to get return code at exit (gwm) // check for socket closed ... if ( rc == PACKET_FAIL ) // new (gwm) fds[i].revents |= // new (gwm) LIBSSH2_POLLFD_CHANNEL_CLOSED | // new (gwm) LIBSSH2_POLLFD_SESSION_CLOSED;// new (gwm) .. the first change might be all thats needed active_fds++; } break; [/code libssh2 (session.c) In my code I use: [my code] if (ssh_fds[j].revents | (LIBSSH2_POLLFD_CHANNEL_CLOSED | LIBSSH2_POLLFD_SESSION_CLOSED)) { length = 0; // signal no data so we will close socket Log_debug("SSH lost connection"); } else { length = libssh2_channel_read (sess_flags[I].channel, // channel iptr[I], // buffer length); // max space in buffer Log_debug("Got %d SSH byte(s)", length); } [/mycode] The read if we ignore the close flags returns -37 ( libssh2's EAGAIN) Of course this change is after I did the #undef HAVE_POLL so select() would be used and not poll(). At this point all appears to be working and the disconnect is being returned to my code so it can close the sockets and retry the connection and re-port forward. Of course my solution might not be an acceptable way of doing what you intended so please do not react negatively. I think the build environment needs to "undef" HAVE_POLL if select is available or split the functionality so one has precedence over the other. The read should set the events data to should a read has been done and the socket close flags need to be indicated as well (or one or the other, if we close the heck with the data. I chose the PACKET_ERROR return code since that will be returned if the recv in libssh2_packet_read gets 0 bytes with no error (graceful socket exit). Please let
[libssh2] [ libssh2-Bugs-1878059 ] libssh2_scp_recv fails on large files
Bugs item #1878059, was opened at 2008-01-23 13:27 Message generated for change (Settings changed) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1878059&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Pending >Resolution: Fixed Priority: 5 Private: No Submitted By: Steven Ayre (stevenayre) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2_scp_recv fails on large files Initial Comment: I am trying to download a 2,719,984,337 byte (2.5 GB) file using scp_get in Net::SSH2, but it fails with the error "Invalid response from SCP server, invalid size" (LIBSSH2_ERROR_SCP_PROTOCOL). Upon investigation, the problem lies in libssh2 490 of src/scp.c (in CVS): session->scpRecv_size = strtol(p, &e, 10); This returns a ERANGE error as 2,719,984,337 is more than the 2,147,483,647 limit of a signed integer. Is there any way to get the library to support files larger than this limit? I'm guessing it'll be more involved than changing the data type to long long and using strtoll? -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 16:04 Message: I based a fix on your patch and committed it just now. Please get the latest code and see if it works for you! -- Comment By: Nobody/Anonymous (nobody) Date: 2008-04-09 16:04 Message: Logged In: NO The following change fixed the problem for me: --- libssh2-0.18.org/src/libssh2_priv.h 2008-02-27 18:43:08.0 +0100 +++ libssh2-0.18/src/libssh2_priv.h 2008-03-20 17:50:19.0 +0100 @@ -811,7 +811,7 @@ unsigned char scpRecv_response[LIBSSH2_SCP_RESPONSE_BUFLEN]; unsigned long scpRecv_response_len; long scpRecv_mode; -long scpRecv_size; +off_t scpRecv_size; long scpRecv_mtime; long scpRecv_atime; char *scpRecv_err_msg; diff -ru libssh2-0.18.org/src/misc.c libssh2-0.18/src/misc.c --- libssh2-0.18.org/src/misc.c 2008-02-27 18:43:10.0 +0100 +++ libssh2-0.18/src/misc.c 2008-03-20 18:37:33.0 +0100 @@ -62,7 +62,7 @@ msl = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; lsl = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; -return ((msl * 65536) * 65536) + lsl; +return ((msl * (libssh2_uint64_t) 65536) * 65536) + lsl; } /* }}} */ diff -ru libssh2-0.18.org/src/scp.c libssh2-0.18/src/scp.c --- libssh2-0.18.org/src/scp.c 2008-02-27 18:43:27.0 +0100 +++ libssh2-0.18/src/scp.c 2008-03-20 17:51:26.0 +0100 @@ -487,7 +487,7 @@ *(s++) = '\0'; /* Make sure we don't get fooled by leftover values */ errno = 0; -session->scpRecv_size = strtol(p, &e, 10); +session->scpRecv_size = strtoull(p, &e, 10); if ((e && *e) || errno) { libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL, "Invalid response from SCP server, invalid size", @@ -513,7 +513,7 @@ goto scp_recv_error; } _libssh2_debug(session, LIBSSH2_DBG_SCP, - "mode = 0%lo size = %ld", session->scpRecv_mode, + "mode = 0%lo size = %lld", session->scpRecv_mode, session->scpRecv_size); /* We *should* check that basename is valid, but why let that stop us? */ Additionally the library needs to get compiled with largefile support enabled, e.g. by adding the output of the command "getconf LFS_CFLAGS" to CFLAGS, "getconf LFS_LDFLAGS" to LDFLAGS, and "getconf LFS_LIBS" to LIBS, respectively. This causes the type "off_t" to be either 32 or 64 bit, as required on the target platform. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1878059&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1815692 ] data type for offset in libssh2_sftp_seek
Bugs item #1815692, was opened at 2007-10-18 13:05 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1815692&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: API Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Daniel Stenberg (bagder) Summary: data type for offset in libssh2_sftp_seek Initial Comment: The data type for the offset in libssh2_sftp_seek() should be libssh2_uint64_t, not size_t, because size_t is probably limited to 32bit. The internal variable for the offset has the correct data type. The prototype should be: LIBSSH2_API void libssh2_sftp_seek(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset); -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 16:12 Message: I've now added a libssh2_sftp_seek2() function in CVS that supports large file seeking. Thus it doesn't break the ABI with older existing releases! -- Comment By: Daniel Stenberg (bagder) Date: 2007-12-03 12:07 Message: Logged In: YES user_id=1110 Originator: NO I can only agree, unfortunately this will break the ABI and thus require another SONAME bump... -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1815692&group_id=125852 - 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
[libssh2] [ libssh2-Bugs-1862727 ] libssh2_poll doesn't work on win32
Bugs item #1862727, was opened at 2008-01-02 22:33 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1862727&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: jls (apjenkins) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2_poll doesn't work on win32 Initial Comment: [Sorry, this is a duplicate of bug 1862722, which I submitted anonymously by mistake] Using libssh2 0.18, I found that libssh2_poll doesn't work on win32. It would always return 1, and the revents field of the LIBSSH2_POLLFD object I passed in would be set to garbage. I found that the reason for this was that on WIN32, neither HAVE_SELECT nor HAVE_POLL get defined. The way libssh2_poll is written assumes that either the "ifdef HAVE_POLL" or "ifdef HAVE_SELECT" block of code will get exected. If neither executes then no packets ever actually get read, it it just returns garbage. Since Win32 does provide select, I simply defined HAVE_SELECT in win32/libssh2_config.h, and also made a small change to libssh2_priv.h so it won't try to include unix-only header files on windows. This made libssh2_poll work correctly on Windows. I've tested this patch with VStudio 2003 on a win32 machine, and VStudio 2005 on a win64 machine. -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 16:16 Message: Thanks, committed! -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1862727&group_id=125852 - 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
[libssh2] help me clean up the tracker!
Hey friends! Please head over to https://sourceforge.net/tracker/?func=browse&group_id=125852&atid=703942 and help me go over the reported bugs to see which ones we can close, which ones have decent bug reports and which ones that need further details/investigations! -- / daniel.haxx.se - 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
[libssh2] [ libssh2-Bugs-1875397 ] libssh2_channel_get_exit_status should not fail with 0
Bugs item #1875397, was opened at 2008-01-19 12:40 Message generated for change (Settings changed) made by roadrunn You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1875397&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: API Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Neil Gierman (roadrunn) Assigned to: Nobody/Anonymous (nobody) Summary: libssh2_channel_get_exit_status should not fail with 0 Initial Comment: When using libssh2_channel_get_exit_status to check the return code of an exec'ed process it returns 0 on failure. The problem is most applications and scripts will return 0 on success. I think tht if libssh2_channel_get_exit_status has a failure it should return -1, or some other value that wouldn't be confused with the exec'ed process' return code. I think if we at least stay away from 0 and 1 that would be a good start. -- Comment By: Nobody/Anonymous (nobody) Date: 2008-01-19 13:42 Message: Logged In: NO The only reliable option is to signal failure, or the return status, out of band. Compare how the waitpid() system call works. //Peter -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1875397&group_id=125852 - 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
Re: [libssh2] help me clean up the tracker!
I have closed tracker # 1875397. I'll have to figure out another way to get a better return. -Original Message- From: Daniel Stenberg [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2008 9:19 AM To: libssh2 hacking Subject: [libssh2] help me clean up the tracker! Hey friends! Please head over to https://sourceforge.net/tracker/?func=browse&group_id=125852&atid=703942 and help me go over the reported bugs to see which ones we can close, which ones have decent bug reports and which ones that need further details/investigations! -- / daniel.haxx.se - 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 - 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
Re: [libssh2] help me clean up the tracker!
Daniel Stenberg wrote: > https://sourceforge.net/tracker/?func=browse&group_id=125852&atid=703942 The SF tracker and the emails it sends make my head hurt! :\ //Peter - 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
Re: [libssh2] code hangs with sftp downloads, solved
On Mon, Sep 29, 2008 at 8:26 AM, Daniel Stenberg <[EMAIL PROTECTED]> wrote: > On Fri, 12 Sep 2008, E L wrote: > >>> Your patch was real close, but it doesn't address the above statement. >>> >>> Could you verify if the attached patch works fine for you, and report >>> back to the list, so that someone might commit it to CVS ? >> >> Right now, the code works because errno is only checked if the result of >> the socket call fail, so clearing it before the call is not needed. The >> bigger issue is that on Windows, send() and recv() do not set errno at all. >> http://msdn.microsoft.com/en-us/library/ms737828(VS.85).aspx >> >> I'm running the patched version right now and it is working. > > Right, but can you please answer to Yang's question whether his version of > the fix works for you? > > That looks cleaner code-wise to me, so I would prefer to have his version > get committed! > I missed his patch, I was focused on the first statement which talked about setting errno to 0 before the call. I found the patch in the mail archive and it does not work for all cases. That patch only covers the 2 recv() calls, but there are also 3 send() calls which have the same issue. Rather than duplicating the switch code 5 times, I thought it better to have it one spot. Also, the code needs to know whether there was an error before calling WSAGetLastError() because successful calls to win32 socket functions do not necessarily clear the stored error. Alternatively, if the result of recv() or send() is not checked, then WSASetLastError(0) should be called before calling the socket functions. http://msdn.microsoft.com/en-us/library/ms741580(VS.85).aspx. Eric - 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
Re: [libssh2] help me clean up the tracker!
On Mon, 29 Sep 2008, Peter Stuge wrote: > The SF tracker and the emails it sends make my head hurt! :\ Well, given that harldy anyone works on the bugs and the project, I would consider doing anything about the tracker completely out of the game and just a subject for a distant future goal! ;-) -- / daniel.haxx.se - 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
Re: [libssh2] help me clean up the tracker!
On Mon, 29 Sep 2008, Neil Gierman wrote: > I have been running the code modifications I suggested in the follow up > comment of tracker # 1946268 for about 5 months with no issues. I don't see > any reason this cannot be committed and the issue closed. Great, I committed what I think was what you suggested and closed the entry just now! -- / daniel.haxx.se - 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
[libssh2] New committer: Paul Thomas
Het friends, I've just added Paul Thomas as a new committer to the libssh2 project! Welcome aboard Paul! -- / daniel.haxx.se - 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
[libssh2] [ libssh2-Bugs-1943976 ] Fix MSYS+MINGW
Bugs item #1943976, was opened at 2008-04-16 15:36 Message generated for change (Comment added) made by bagder You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1943976&group_id=125852 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: misc Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Carlo Bramini (carlo_bramini) >Assigned to: Daniel Stenberg (bagder) Summary: Fix MSYS+MINGW Initial Comment: Hello, I fixed the compilation of libssh2 under MSYS+MINGW, now it works without problems. The compilation under MSVC works too. List of changes: )configure.in detect mingw32 (or mingw64) compiler, add some CFLAGS and detect the presence of W32API. select() was not found at configure time because it is declared with PASCAL calling convention, so its name is decorated with "@". Normally such conditions must be fixed by declaring correct prototype, or including good include file (i.e. winsock2.h). )scp_nonblock.c )scp_write_nonblock.c )sftp_RW_nonblock.c )sftp_mkdir_nonblock.c )sftp_nonblock.c )sftp_write_nonblock.c )sftpdir_nonblock.c fixed nonblocking examples for Win32/Win64. )libssh2_priv.h Declare some useful stuff, mainly moved from libssh2_config.h under /win32 directory )libssh2_config.h Removed some stuff for fixing compilation under MSVC Sincerely, Carlo Bramini. -- >Comment By: Daniel Stenberg (bagder) Date: 2008-09-29 21:22 Message: Thanks for your work, can you please update your patch against the current CVS as some changes now makes your patch not apply cleanly any more? -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1943976&group_id=125852 - 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
Re: [libssh2] code hangs with sftp downloads, solved
E L wrote: > Alternatively, if the result of recv() or send() is not checked, What? Checking for errors really has to be programming 101.. //Peter - 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
Re: [libssh2] code hangs with sftp downloads, solved
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