Page MenuHomePhabricator

Large channel_write not successful
Open, NormalPublic

Description

both client and server run 0.5.1, communication is over a localhost socket.

client is doing a

channel//write(channel, buffer, 100000);  // returns 0
ssh//channel//poll(channel, 0);  // workaround for libssh bug

server is doing a

channel//read(channel, buffer, 100000);  // returns 32000

Log output:
[2] Authentication successful
[2] Creating a channel 43 with 64000 window and 32768 max packet
[2] Received a CHANNELOPENCONFIRMATION for channel 43:43
[2] Remote window : 32000, maxpacket : 35000
[2] Channel request subsystem success
[2] Read (100000) buffered : 0 bytes. Window: 32000
[2] Remote window is 32000 bytes. going to write 100000 bytes
[2] growing window (channel 43:43) to 128000 bytes
[1] channelwrite wrote 32000 bytes
[2] Remote window is 0 bytes. going to write 68000 bytes
[2] Wait for a growing window message...
[2] Channel receiving 32000 bytes data in 0 (local win=128000 remote win=64000)
[2] Adding 96000 bytes to channel (43:43) (from 0 bytes)
[1] placing 32000 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=96000 remote win=64000)
..\src\comm\ssh
test.cpp(71): error: Value of: 100000
Expected: client->Write("hello", 100000)
Which is: 0
[2] Read (5) buffered : 0 bytes. Window: 64000
..\src\comm\ssh//test.cpp(13): error: Value of: conn->Read(buffer, 100000)

Actual: 32000

Expected: 100000
[1] channel//write wrote 5 bytes
[2] Channel receiving 5 bytes data in 0 (local win=64000 remote win=96000)
[1] placing 5 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=63995 remote win=96000)
[2] growing window (channel 43:43) to 128000 bytes

Event Timeline

migration created this object with visibility "Restricted Project (Project)".
migration created this object with edit policy "Restricted Project (Project)".

On Tuesday, August 9th 2011 19:53:04, Felix Hupfeld wrote:

when cutting writes into blocks of sshchannelwindowsize(channel) size, the writes work, but read still doesn't.
[2] Authentication successful
[2] Creating a channel 43 with 64000 window and 32768 max packet
[2] Received a CHANNEL
OPENCONFIRMATION for channel 43:43
[2] Remote window : 32000, maxpacket : 35000
[2] Channel request subsystem success
[2] Read (16384) buffered : 0 bytes. Window: 32000
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 32000, writing 32000
[1] channelwrite wrote 32000 bytes
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
I 10308 ssh.cpp:520 sshchannelwindowsize returns 0, writing 0
[2] Channel receiving 32000 bytes data in 0 (local win=32000 remote win=64000)
[1] placing 32000 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=0 remote win=64000)
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
[2] growing window (channel 43:43) to 128000 bytes
[2] Read (16384) buffered : 15616 bytes. Window: 128000
[2] Adding 128000 bytes to channel (43:43) (from 0 bytes)
E 10308 ssh.cpp:547 Short read: 15616 < 16384
I 10308 ssh.cpp:520 sshchannelwindowsize returns 128000, writing 68000
..\src\comm\ssh
test.cpp(13): error: Value of: conn->Read(buffer, 100000)

Actual: 0

Expected: 100000
I 10308 ssh.cpp:520 sshchannelwindowsize returns 64000, writing 5
[1] channel
write wrote 5 bytes
[1] channelwrite wrote 34990 bytes
[1] channel
write wrote 33010 bytes
[2] Channel receiving 5 bytes data in 0 (local win=64000 remote win=60000)
[1] placing 5 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=63995 remote win=60000)
[2] Read (5) buffered : 5 bytes. Window: 63995
[2] growing window (channel 43:43) to 128000 bytes

and:

  • unassigned Aris Adamantiadis

On Tuesday, August 9th 2011 19:53:04, Felix Hupfeld wrote:

when cutting writes into blocks of sshchannelwindowsize(channel) size, the writes work, but read still doesn't.
[2] Authentication successful
[2] Creating a channel 43 with 64000 window and 32768 max packet
[2] Received a CHANNEL
OPENCONFIRMATION for channel 43:43
[2] Remote window : 32000, maxpacket : 35000
[2] Channel request subsystem success
[2] Read (16384) buffered : 0 bytes. Window: 32000
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 32000, writing 32000
[1] channelwrite wrote 32000 bytes
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
I 10308 ssh.cpp:520 sshchannelwindowsize returns 0, writing 0
[2] Channel receiving 32000 bytes data in 0 (local win=32000 remote win=64000)
[1] placing 32000 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=0 remote win=64000)
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
[2] growing window (channel 43:43) to 128000 bytes
[2] Read (16384) buffered : 15616 bytes. Window: 128000
[2] Adding 128000 bytes to channel (43:43) (from 0 bytes)
E 10308 ssh.cpp:547 Short read: 15616 < 16384
I 10308 ssh.cpp:520 sshchannelwindowsize returns 128000, writing 68000
..\src\comm\ssh
test.cpp(13): error: Value of: conn->Read(buffer, 100000)

Actual: 0

Expected: 100000
I 10308 ssh.cpp:520 sshchannelwindowsize returns 64000, writing 5
[1] channel
write wrote 5 bytes
[1] channelwrite wrote 34990 bytes
[1] channel
write wrote 33010 bytes
[2] Channel receiving 5 bytes data in 0 (local win=64000 remote win=60000)
[1] placing 5 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=63995 remote win=60000)
[2] Read (5) buffered : 5 bytes. Window: 63995
[2] growing window (channel 43:43) to 128000 bytes

and:

  • unassigned Aris Adamantiadis

On Tuesday, August 9th 2011 19:53:04, Felix Hupfeld wrote:

when cutting writes into blocks of sshchannelwindowsize(channel) size, the writes work, but read still doesn't.
[2] Authentication successful
[2] Creating a channel 43 with 64000 window and 32768 max packet
[2] Received a CHANNEL
OPENCONFIRMATION for channel 43:43
[2] Remote window : 32000, maxpacket : 35000
[2] Channel request subsystem success
[2] Read (16384) buffered : 0 bytes. Window: 32000
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 32000, writing 32000
[1] channelwrite wrote 32000 bytes
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
I 10308 ssh.cpp:520 sshchannelwindowsize returns 0, writing 0
[2] Channel receiving 32000 bytes data in 0 (local win=32000 remote win=64000)
[1] placing 32000 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=0 remote win=64000)
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
[2] growing window (channel 43:43) to 128000 bytes
[2] Read (16384) buffered : 15616 bytes. Window: 128000
[2] Adding 128000 bytes to channel (43:43) (from 0 bytes)
E 10308 ssh.cpp:547 Short read: 15616 < 16384
I 10308 ssh.cpp:520 sshchannelwindowsize returns 128000, writing 68000
..\src\comm\ssh
test.cpp(13): error: Value of: conn->Read(buffer, 100000)

Actual: 0

Expected: 100000
I 10308 ssh.cpp:520 sshchannelwindowsize returns 64000, writing 5
[1] channel
write wrote 5 bytes
[1] channelwrite wrote 34990 bytes
[1] channel
write wrote 33010 bytes
[2] Channel receiving 5 bytes data in 0 (local win=64000 remote win=60000)
[1] placing 5 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=63995 remote win=60000)
[2] Read (5) buffered : 5 bytes. Window: 63995
[2] growing window (channel 43:43) to 128000 bytes

and:

  • unassigned Aris Adamantiadis

On Tuesday, August 9th 2011 19:53:04, Felix Hupfeld wrote:

when cutting writes into blocks of sshchannelwindowsize(channel) size, the writes work, but read still doesn't.
[2] Authentication successful
[2] Creating a channel 43 with 64000 window and 32768 max packet
[2] Received a CHANNEL
OPENCONFIRMATION for channel 43:43
[2] Remote window : 32000, maxpacket : 35000
[2] Channel request subsystem success
[2] Read (16384) buffered : 0 bytes. Window: 32000
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 32000, writing 32000
[1] channelwrite wrote 32000 bytes
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
I 10308 ssh.cpp:520 sshchannelwindowsize returns 0, writing 0
[2] Channel receiving 32000 bytes data in 0 (local win=32000 remote win=64000)
[1] placing 32000 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=0 remote win=64000)
I 10308 ssh.cpp:520 ssh
channelwindowsize returns 0, writing 0
[2] growing window (channel 43:43) to 128000 bytes
[2] Read (16384) buffered : 15616 bytes. Window: 128000
[2] Adding 128000 bytes to channel (43:43) (from 0 bytes)
E 10308 ssh.cpp:547 Short read: 15616 < 16384
I 10308 ssh.cpp:520 sshchannelwindowsize returns 128000, writing 68000
..\src\comm\ssh
test.cpp(13): error: Value of: conn->Read(buffer, 100000)

Actual: 0

Expected: 100000
I 10308 ssh.cpp:520 sshchannelwindowsize returns 64000, writing 5
[1] channel
write wrote 5 bytes
[1] channelwrite wrote 34990 bytes
[1] channel
write wrote 33010 bytes
[2] Channel receiving 5 bytes data in 0 (local win=64000 remote win=60000)
[1] placing 5 bytes into channel buffer (stderr=0)
[2] Channel windows are now (local win=63995 remote win=60000)
[2] Read (5) buffered : 5 bytes. Window: 63995
[2] growing window (channel 43:43) to 128000 bytes

and:

  • unassigned Aris Adamantiadis
asn changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".Sep 4 2018, 8:41 PM