1
1

Update the window *after* effective read

Этот коммит содержится в:
Aris Adamantiadis 2010-10-01 18:56:57 +02:00
родитель 5675fbe73e
Коммит 9f7e2c3252

Просмотреть файл

@ -2142,6 +2142,12 @@ int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_std
ssh_handle_packets(session,-1);
}
len = buffer_get_rest_len(stdbuf);
/* Read count bytes if len is greater, everything otherwise */
len = (len > count ? count : len);
memcpy(dest, buffer_get_rest(stdbuf), len);
buffer_pass_bytes(stdbuf,len);
/* Authorize some buffering while userapp is busy */
if (channel->local_window < WINDOWLIMIT) {
if (grow_window(session, channel, 0) < 0) {
@ -2150,12 +2156,6 @@ int ssh_channel_read(ssh_channel channel, void *dest, uint32_t count, int is_std
}
}
len = buffer_get_rest_len(stdbuf);
/* Read count bytes if len is greater, everything otherwise */
len = (len > count ? count : len);
memcpy(dest, buffer_get_rest(stdbuf), len);
buffer_pass_bytes(stdbuf,len);
leave_function();
return len;
}