summaryrefslogtreecommitdiff
path: root/roaming_common.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2009-06-21 19:08:48 +1000
committerDarren Tucker <dtucker@zip.com.au>2009-06-21 19:08:48 +1000
commite6b590e8d40e2b2ab0aab9da1b7d34cd357caf6a (patch)
treeee33e59104f4613065cc423548eaad9aa802a5a6 /roaming_common.c
parent6ae35ac5762b6abcbd416e7db9246e730b401f10 (diff)
- dtucker@cvs.openbsd.org 2009/06/21 09:04:03
[roaming.h roaming_common.c roaming_dummy.c] Add tags for the benefit of the sync scripts Also: pull in the changes for 1.1->1.2 missed in the previous sync.
Diffstat (limited to 'roaming_common.c')
-rw-r--r--roaming_common.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/roaming_common.c b/roaming_common.c
index 5a871b23e..065542520 100644
--- a/roaming_common.c
+++ b/roaming_common.c
@@ -1,3 +1,4 @@
1/* $OpenBSD: roaming_common.c,v 1.4 2009/06/21 09:04:03 dtucker Exp $ */
1/* 2/*
2 * Copyright (c) 2004-2009 AppGate Network Security AB 3 * Copyright (c) 2004-2009 AppGate Network Security AB
3 * 4 *
@@ -55,9 +56,9 @@ get_sent_bytes(void)
55} 56}
56 57
57void 58void
58roam_set_bytes(u_int64_t sent, u_int64_t recv) 59roam_set_bytes(u_int64_t sent, u_int64_t recvd)
59{ 60{
60 read_bytes = recv; 61 read_bytes = recvd;
61 write_bytes = sent; 62 write_bytes = sent;
62} 63}
63 64
@@ -70,7 +71,8 @@ roaming_write(int fd, const void *buf, size_t count, int *cont)
70 if (ret > 0 && !resume_in_progress) { 71 if (ret > 0 && !resume_in_progress) {
71 write_bytes += ret; 72 write_bytes += ret;
72 } 73 }
73 debug("Wrote %d bytes for a total of %lld", ret, write_bytes); 74 debug3("Wrote %ld bytes for a total of %llu", (long)ret,
75 (unsigned long long)write_bytes);
74 return ret; 76 return ret;
75} 77}
76 78
@@ -86,12 +88,13 @@ roaming_read(int fd, void *buf, size_t count, int *cont)
86 return ret; 88 return ret;
87} 89}
88 90
89ssize_t 91size_t
90roaming_atomicio(ssize_t(*f)(), int fd, void *buf, size_t count) 92roaming_atomicio(ssize_t(*f)(int, void*, size_t), int fd, void *buf,
93 size_t count)
91{ 94{
92 ssize_t ret = atomicio(f, fd, buf, count); 95 size_t ret = atomicio(f, fd, buf, count);
93 96
94 if ((f == write || f == vwrite) && ret > 0 && !resume_in_progress) { 97 if (f == vwrite && ret > 0 && !resume_in_progress) {
95 write_bytes += ret; 98 write_bytes += ret;
96 } else if (f == read && ret > 0 && !resume_in_progress) { 99 } else if (f == read && ret > 0 && !resume_in_progress) {
97 read_bytes += ret; 100 read_bytes += ret;