1
1

Improve ssh_channel_from_local().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@674 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
Andreas Schneider 2009-05-02 20:46:10 +00:00
родитель c31893d246
Коммит 0534fee674
2 изменённых файлов: 18 добавлений и 11 удалений

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

@ -607,7 +607,7 @@ CHANNEL *channel_new(SSH_SESSION *session);
int channel_default_bufferize(CHANNEL *channel, void *data, int len,
int is_stderr);
u32 ssh_channel_new_id(SSH_SESSION *session);
CHANNEL *ssh_channel_from_local(SSH_SESSION *session,u32 num);
CHANNEL *ssh_channel_from_local(SSH_SESSION *session, u32 id);
/* options.c */

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

@ -230,17 +230,24 @@ static int channel_open(CHANNEL *channel, const char *type_c, int window,
return -1;
}
CHANNEL *ssh_channel_from_local(SSH_SESSION *session,u32 num){
// we assume we are always the local
CHANNEL *initchan,*channel;
initchan=session->channels;
if(!initchan)
return NULL;
for(channel=initchan;channel->local_channel!=num;channel=channel->next){
if(channel->next==initchan)
return NULL;
/* get ssh channel from local session? */
CHANNEL *ssh_channel_from_local(SSH_SESSION *session, u32 id) {
CHANNEL *initchan = session->channels;
CHANNEL *channel;
/* We assume we are always the local */
if (initchan == NULL) {
return NULL;
}
for (channel = initchan; channel->local_channel != id;
channel=channel->next) {
if (channel->next == initchan) {
return NULL;
}
return channel;
}
return channel;
}
static int grow_window(SSH_SESSION *session, CHANNEL *channel, int minimumsize) {