|
|
3a27f0 |
From 2e973be50f75d0a85dcb995f7823f00b1fc85c2f Mon Sep 17 00:00:00 2001
|
|
|
3a27f0 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
3a27f0 |
Date: Mon, 7 Oct 2013 16:07:50 +0200
|
|
|
3a27f0 |
Subject: [PATCH] ssh: improve the logic for detecting blocking direction
|
|
|
3a27f0 |
|
|
|
3a27f0 |
This fixes a regression introduced by commit 0feeab78 limiting the speed
|
|
|
3a27f0 |
of SCP upload to 16384 B/s on a fast connection (such as localhost).
|
|
|
3a27f0 |
|
|
|
86693f |
[upstream commit d015f4ccac627852869cb45e31ccdc9fbd97dc47]
|
|
|
3a27f0 |
---
|
|
|
3a27f0 |
lib/ssh.c | 8 +++++---
|
|
|
3a27f0 |
1 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
3a27f0 |
|
|
|
3a27f0 |
diff --git a/lib/ssh.c b/lib/ssh.c
|
|
|
3a27f0 |
index 422357b..93c65c3 100644
|
|
|
3a27f0 |
--- a/lib/ssh.c
|
|
|
3a27f0 |
+++ b/lib/ssh.c
|
|
|
3a27f0 |
@@ -2287,6 +2287,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
|
|
3a27f0 |
sshc->actualcode = result;
|
|
|
3a27f0 |
}
|
|
|
3a27f0 |
else {
|
|
|
3a27f0 |
+ /* store this original bitmask setup to use later on if we can't
|
|
|
3a27f0 |
+ figure out a "real" bitmask */
|
|
|
3a27f0 |
+ sshc->orig_waitfor = data->req.keepon;
|
|
|
3a27f0 |
+
|
|
|
3a27f0 |
/* we want to use the _sending_ function even when the socket turns
|
|
|
3a27f0 |
out readable as the underlying libssh2 scp send function will deal
|
|
|
3a27f0 |
with both accordingly */
|
|
|
3a27f0 |
@@ -2603,9 +2607,7 @@ static void ssh_block2waitfor(struct connectdata *conn, bool block)
|
|
|
3a27f0 |
{
|
|
|
3a27f0 |
struct ssh_conn *sshc = &conn->proto.sshc;
|
|
|
3a27f0 |
int dir;
|
|
|
3a27f0 |
- if(!block)
|
|
|
3a27f0 |
- conn->waitfor = 0;
|
|
|
3a27f0 |
- else if((dir = libssh2_session_block_directions(sshc->ssh_session))) {
|
|
|
3a27f0 |
+ if(block && (dir = libssh2_session_block_directions(sshc->ssh_session))) {
|
|
|
3a27f0 |
/* translate the libssh2 define bits into our own bit defines */
|
|
|
3a27f0 |
conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND)?KEEP_RECV:0) |
|
|
|
3a27f0 |
((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND)?KEEP_SEND:0);
|
|
|
3a27f0 |
--
|
|
|
3a27f0 |
1.7.1
|
|
|
3a27f0 |
|