[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HOW to use ssh_channel_write multi times
[Thread Prev] | [Thread Next]
- Subject: HOW to use ssh_channel_write multi times
- From: "=?gb18030?b?wfXUqtXc?=" <945695107@xxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 13 Apr 2020 19:07:20 +0800
- To: "=?gb18030?b?bGlic3No?=" <libssh@xxxxxxxxxx>
Hi
I want to implement channel_exec_request_function, which capture the display and write back to client.
the code:
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
ssh_channel_write(chan, buffer, strlen(buffer));
memset(buffer, 0, sizeof(buffer));
}
Since there maybe many outputs, so I want to send it one line each time.
Here only the first write success, then all failed with return value -1.
I wonder does this mean I can write ONLY 1 line in this function? no matter how much data, the libssh will handle it?
Or I miss something?
Thanks,
Yuanzhe
Archive administrator: postmaster@lists.cynapses.org