Index: vos.c
===================================================================
RCS file: /cvs/openafs/src/volser/vos.c,v
retrieving revision 1.2
diff -u -r1.2 vos.c
--- vos.c	2000/11/04 10:06:34	1.2
+++ vos.c	2001/03/16 20:18:37
@@ -406,6 +406,7 @@
     long blksize;
     int ufdIsOpen = 0;
 
+system("date");
     /* Open the output file */
     if (!filename || !*filename) {
 	usd_StandardOutput(&ufd);
@@ -432,6 +433,7 @@
 
   error_exit:
     /* Close the output file */
+#if 0
     if (ufdIsOpen) {
        code = USD_CLOSE(ufd);
        if (code) {
@@ -440,6 +442,9 @@
 	  if (!error) error = code;
        }
     }
+#endif
+
+system("date");
 
     return(error);
 }   
Index: dumpstuff.c
===================================================================
RCS file: /cvs/openafs/src/volser/dumpstuff.c,v
retrieving revision 1.3
diff -u -r1.3 dumpstuff.c
--- dumpstuff.c	2000/12/13 21:43:45	1.3
+++ dumpstuff.c	2001/03/16 20:18:38
@@ -42,6 +42,8 @@
 
 extern int DoLogging;
 
+#define IOD_BUFSIZE 1
+
 /* This iod stuff is a silly little package to emulate the old qi_in stuff, which
    emulated the stdio stuff.  There is a big assumption here, that the
    rx_Read will never be called directly, by a routine like readFile, when
@@ -60,6 +62,8 @@
     int *codes;                 /* one return code for each call */
     char haveOldChar;		/* state for pushing back a character */
     char oldChar;
+	int buffer_used;
+	char buffer[IOD_BUFSIZE];
 };
 
 
@@ -86,17 +90,18 @@
     iodp->haveOldChar = 0;
     iodp->ncalls = 1;
     iodp->calls = (struct rx_call **) 0;
+	iodp->buffer_used = 0;
 }
 
 static void iod_InitMulti(struct iod *iodp, struct rx_call **calls, int ncalls,
 		   int *codes)
 {
-
-  iodp->calls = calls;
-  iodp->haveOldChar = 0;
-  iodp->ncalls = ncalls;
-  iodp->codes = codes;
-  iodp->call = (struct rx_call *) 0;
+	iodp->calls = calls;
+	iodp->haveOldChar = 0;
+	iodp->ncalls = ncalls;
+	iodp->codes = codes;
+	iodp->call = (struct rx_call *) 0;
+	iodp->buffer_used = 0;
 }
 
 /* N.B. iod_Read doesn't check for oldchar (see previous comment) */
@@ -108,6 +113,7 @@
  * I don't think we want half the replicas to go bad just because one 
  * connection timed out, but if they all time out, then we should give up. 
  */
+/* call with nbytes = -1 to flush the buffer */
 static int iod_Write(struct iod *iodp, char *buf, int nbytes)
 {
   int code, i;
@@ -116,26 +122,55 @@
   assert ((iodp->call && iodp->ncalls == 1 && !iodp->calls) ||
 	  (!iodp->call && iodp->ncalls >= 1 && iodp->calls));
 
-  if (iodp->call) {
-    code = rx_Write(iodp->call, buf, nbytes); 
-    return code;     
+  /* buffer for now, unless nbytes == -1, in which case we flush the
+	buffer */
+  if ( nbytes != -1 && (iodp->buffer_used + nbytes <= IOD_BUFSIZE) )
+  {
+	memcpy(iodp->buffer + iodp->buffer_used, buf, nbytes);
+	iodp->buffer_used += nbytes;
+// Log("used buffer for %d send, now using %d\n", nbytes, iodp->buffer_used);
+	return nbytes; /* act like it worked */
   }
-
-  for (i=0; i < iodp->ncalls; i++) {
-    if (iodp->calls[i] && !iodp->codes[i]) {
-      code = rx_Write(iodp->calls[i], buf, nbytes);
-      if (code != nbytes) { /* everything gets merged into a single error */
-      	iodp->codes[i] = VOLSERDUMPERROR;  /* but that's exactly what the */
-      }       	 		           /* standard dump does, anyways */
-      else {
-      	one_success = TRUE;
-      }
-    }
-  } /* for all calls */
+  else /* we're flushing and sending */
+  {
+	int used = iodp->buffer_used;
+	iodp->buffer_used = 0;
+// Log("real send for buffer %d, and %d\n", used, nbytes);
+
+	  if (iodp->call) {
+		code = rx_Write(iodp->call, iodp->buffer, used);
+		if ( code != used ) { return 0; }
+
+	    code = rx_Write(iodp->call, buf, nbytes); 
+	    return code;
+	  }
+
+	  for (i=0; i < iodp->ncalls; i++) {
+	    if (iodp->calls[i] && !iodp->codes[i]) {
+		  code = rx_Write(iodp->calls[i], iodp->buffer, used);
+		  if ( code != used ) {
+			iodp->codes[i] = VOLSERDUMPERROR;
+		  }
+			else
+			{
+				one_success = TRUE;
+			}
+
+	      code = rx_Write(iodp->calls[i], buf, nbytes);
+	      if (code != nbytes) { /* everything gets merged into a single error */
+	      	iodp->codes[i] = VOLSERDUMPERROR;  /* but that's exactly what the */
+	      }       	 		           /* standard dump does, anyways */
+	      else {
+	      	one_success = TRUE;
+	      }
+	    }
+	  } /* for all calls */
+	
+	if (one_success)
+	  return nbytes;
+	else return 0;
 
-if (one_success)
-  return nbytes;
-else return 0;
+	}
 }
 
 static void iod_ungetc(struct iod *iodp, int achar)
@@ -566,7 +601,9 @@
 
 static int DumpEnd(register struct iod *iodp)
 {
-    return(DumpInt32(iodp, D_DUMPEND, DUMPENDMAGIC));
+	int code = DumpInt32(iodp, D_DUMPEND, DUMPENDMAGIC);
+	iod_Write(iodp, NULL, 0); /* flush the buffer */
+	return code;
 }
 
 /* Guts of the dump code */
