summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-21 05:57:15 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-21 05:57:15 +0000
commitc5eb365011581bdf9987b538f0df04a1d6feb723 (patch)
tree864382612649f95848b9b81eacb6c39bdf7a7edf
parent2f326946a17abd0ab4bf3f14e5284c2d04f243c0 (diff)
downloadrsync-c5eb365011581bdf9987b538f0df04a1d6feb723.tar.gz
rsync-c5eb365011581bdf9987b538f0df04a1d6feb723.tar.bz2
rsync-c5eb365011581bdf9987b538f0df04a1d6feb723.zip
formatting changes. committed separately so they don't mask the coming
token changes.
-rw-r--r--token.c55
1 files changed, 27 insertions, 28 deletions
diff --git a/token.c b/token.c
index a377b295..543031e4 100644
--- a/token.c
+++ b/token.c
@@ -26,27 +26,26 @@ extern int do_compression;
/* non-compressing recv token */
static int simple_recv_token(int f,char **data)
{
- static int residue;
- static char *buf;
- int n;
-
- if (!buf) {
- buf = (char *)malloc(CHUNK_SIZE);
- if (!buf) out_of_memory("simple_recv_token");
- }
+ static int residue;
+ static char *buf;
+ int n;
+ if (!buf) {
+ buf = (char *)malloc(CHUNK_SIZE);
+ if (!buf) out_of_memory("simple_recv_token");
+ }
- if (residue == 0) {
- int i = read_int(f);
- if (i <= 0) return i;
- residue = i;
- }
+ if (residue == 0) {
+ int i = read_int(f);
+ if (i <= 0) return i;
+ residue = i;
+ }
- *data = buf;
- n = MIN(CHUNK_SIZE,residue);
- residue -= n;
- read_buf(f,buf,n);
- return n;
+ *data = buf;
+ n = MIN(CHUNK_SIZE,residue);
+ residue -= n;
+ read_buf(f,buf,n);
+ return n;
}
@@ -54,16 +53,16 @@ static int simple_recv_token(int f,char **data)
static void simple_send_token(int f,int token,
struct map_struct *buf,int offset,int n)
{
- if (n > 0) {
- int l = 0;
- while (l < n) {
- int n1 = MIN(CHUNK_SIZE,n-l);
- write_int(f,n1);
- write_buf(f,map_ptr(buf,offset+l,n1),n1);
- l += n1;
- }
- }
- write_int(f,-(token+1));
+ if (n > 0) {
+ int l = 0;
+ while (l < n) {
+ int n1 = MIN(CHUNK_SIZE,n-l);
+ write_int(f,n1);
+ write_buf(f,map_ptr(buf,offset+l,n1),n1);
+ l += n1;
+ }
+ }
+ write_int(f,-(token+1));
}