Improve ssh_channel_from_local().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@674 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
c31893d246
Коммит
0534fee674
@ -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) {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user