diff options
author | Damien Miller <djm@mindrot.org> | 2010-09-24 14:15:11 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-09-24 14:15:11 +0200 |
commit | 65e42f87fe945a2bf30d7e02358554dbaefa8a4c (patch) | |
tree | 102c10a0b5328a40c79dca19d208f0ca0c1671b5 /atomicio.h | |
parent | - jmc@cvs.openbsd.org 2010/09/22 08:30:08 (diff) | |
download | openssh-65e42f87fe945a2bf30d7e02358554dbaefa8a4c.tar.xz openssh-65e42f87fe945a2bf30d7e02358554dbaefa8a4c.zip |
- djm@cvs.openbsd.org 2010/09/22 22:58:51
[atomicio.c atomicio.h misc.c misc.h scp.c sftp-client.c]
[sftp-client.h sftp.1 sftp.c]
add an option per-read/write callback to atomicio
factor out bandwidth limiting code from scp(1) into a generic bandwidth
limiter that can be attached using the atomicio callback mechanism
add a bandwidth limit option to sftp(1) using the above
"very nice" markus@
Diffstat (limited to 'atomicio.h')
-rw-r--r-- | atomicio.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/atomicio.h b/atomicio.h index 2fcd25d43..0d728ac86 100644 --- a/atomicio.h +++ b/atomicio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.h,v 1.10 2006/08/03 03:34:41 deraadt Exp $ */ +/* $OpenBSD: atomicio.h,v 1.11 2010/09/22 22:58:51 djm Exp $ */ /* * Copyright (c) 2006 Damien Miller. All rights reserved. @@ -32,6 +32,9 @@ /* * Ensure all of data on socket comes through. f==read || f==vwrite */ +size_t +atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, + int (*cb)(void *, size_t), void *); size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); #define vwrite (ssize_t (*)(int, void *, size_t))write @@ -39,6 +42,9 @@ size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); /* * ensure all of data on socket comes through. f==readv || f==writev */ +size_t +atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd, + const struct iovec *_iov, int iovcnt, int (*cb)(void *, size_t), void *); size_t atomiciov(ssize_t (*)(int, const struct iovec *, int), int, const struct iovec *, int); |