aboutsummaryrefslogtreecommitdiff
path: root/examples/senddata.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/senddata.c')
-rw-r--r--examples/senddata.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/senddata.c b/examples/senddata.c
index d74081a5..bd8d1175 100644
--- a/examples/senddata.c
+++ b/examples/senddata.c
@@ -3,12 +3,15 @@
#include <libssh/libssh.h>
#include "examples_common.h"
+#define LIMIT 0x100000000
+
int main(void) {
ssh_session session;
ssh_channel channel;
char buffer[1024*1024];
int rc;
-
+ long total=0;
+ long lastshown=4096;
session = connect_ssh("localhost", NULL, 0);
if (session == NULL) {
return 1;
@@ -36,6 +39,13 @@ int main(void) {
while ((rc = ssh_channel_write(channel, buffer, sizeof(buffer))) > 0) {
+ total += rc;
+ if(total/2 >= lastshown){
+ printf("written %lx\n",total);
+ lastshown=total;
+ }
+ if(total > LIMIT)
+ break;
}
if (rc < 0) {