[30581] trunk/dports/devel/libssh2
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 31 12:32:13 PDT 2007
Revision: 30581
http://trac.macosforge.org/projects/macports/changeset/30581
Author: pmq at macports.org
Date: 2007-10-31 12:32:13 -0700 (Wed, 31 Oct 2007)
Log Message:
-----------
Adds a patch stolen from foofus.net that prevents libssh2 from looping forever when the SSH server doesn't answer.
Modified Paths:
--------------
trunk/dports/devel/libssh2/Portfile
Added Paths:
-----------
trunk/dports/devel/libssh2/files/
trunk/dports/devel/libssh2/files/libssh2-0.17-banner-wait.diff
Modified: trunk/dports/devel/libssh2/Portfile
===================================================================
--- trunk/dports/devel/libssh2/Portfile 2007-10-31 19:32:06 UTC (rev 30580)
+++ trunk/dports/devel/libssh2/Portfile 2007-10-31 19:32:13 UTC (rev 30581)
@@ -4,6 +4,7 @@
name libssh2
version 0.17
+revision 1
categories devel net
maintainers pmq at macports.org openmaintainer
@@ -20,4 +21,7 @@
depends_lib port:openssl port:zlib
+patchfiles libssh2-0.17-banner-wait.diff
+patch.args -p1
+
livecheck.regex "${name} ${name}-(.*) released"
Added: trunk/dports/devel/libssh2/files/libssh2-0.17-banner-wait.diff
===================================================================
--- trunk/dports/devel/libssh2/files/libssh2-0.17-banner-wait.diff (rev 0)
+++ trunk/dports/devel/libssh2/files/libssh2-0.17-banner-wait.diff 2007-10-31 19:32:13 UTC (rev 30581)
@@ -0,0 +1,23 @@
+diff -rub libssh2-0.17/src/session.c libssh2-0.17-jmk/src/session.c
+--- libssh2-0.17/src/session.c 2007-08-06 15:41:31.000000000 -0500
++++ libssh2-0.17-jmk/src/session.c 2007-08-28 14:56:40.000000000 -0500
+@@ -93,6 +93,7 @@
+ {
+ int ret;
+ int banner_len;
++ int wait_count = 0;
+
+ if (session->banner_TxRx_state == libssh2_NB_state_idle) {
+ banner_len = 0;
+@@ -107,6 +108,11 @@
+ || (session->banner_TxRx_banner[banner_len - 1] != '\n'))) {
+ char c = '\0';
+
++ /* If server is not responding, don't wait in loop forever */
++ wait_count++;
++ if (wait_count > 1000)
++ return 1;
++
+ ret =
+ recv(session->socket_fd, &c, 1,
+ LIBSSH2_SOCKET_RECV_FLAGS(session));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071031/8507b61d/attachment.html
More information about the macports-changes
mailing list