|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56387 libssh automatically decrease a window frame, but pecl module does not
Submitted: 2005-05-03 11:24 UTC Modified: 2005-05-04 14:59 UTC
From: deadem at mail dot ru Assigned: pollita (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5.0.3 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: deadem at mail dot ru
New email:
PHP Version: OS:


 [2005-05-03 11:24 UTC] deadem at mail dot ru
diff ssh2_fopen_wrappers.c.orig ssh2_fopen_wrappers.c 
<               if (bytesread != libssh2_channel_write(remote_file, buffer, bytesread)) {
>         size_t realwrite = 0;
>         size_t stepwrite = 0;
>         while ((stepwrite = libssh2_channel_write(remote_file, buffer + realwrite, bytesread - realwrite)) > 0) {
>             realwrite += stepwrite;
>             if (bytesread <= realwrite) {
>                 break;
>             }
>         }
>               if (bytesread != realwrite) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-03 15:26 UTC]
libssh2 automatically handles this sort of partial write chunking when the channel is set to blocking.
 [2005-05-03 16:31 UTC] deadem at mail dot ru
no. see in libssh2-0.8/src/channel.c
LIBSSH2_API int libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id, const char *buf, size_t buflen)

this function only wait for first window frame and send data of it's size, instead of buflen.

    if (buflen > channel->local.window_size) {
        buflen = channel->local.window_size;
    if (buflen > channel->local.packet_size) {
        buflen = channel->local.packet_size;
 [2005-05-04 14:59 UTC]
Ah, I see what you're talking about now.

I'm actually going to fix this in libssh2_channel_write so that blocking write really does mean blocking write.

Thanks for your persistence.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 16:01:29 2024 UTC