*** camel-stub-marshal.c.orig	2006-05-08 16:09:40.000000000 -0400
--- camel-stub-marshal.c	2006-06-23 09:22:37.000000000 -0400
***************
*** 86,92 ****
  static gboolean
  do_read (CamelStubMarshal *marshal, char *buf, size_t len)
  {
! 	if (camel_read (marshal->fd, buf, len) == -1) {
  		close (marshal->fd);
  		marshal->fd = -1;
  		return FALSE;
--- 86,101 ----
  static gboolean
  do_read (CamelStubMarshal *marshal, char *buf, size_t len)
  {
! 	size_t nread = 0;
! 	ssize_t n;
! 
! 	do {
! 		if ((n = camel_read (marshal->fd, buf + nread, len - nread)) <= 0)
! 			break;
! 		nread += n;
! 	} while (nread <len);
! 
! 	if (nread < len) {
  		close (marshal->fd);
  		marshal->fd = -1;
  		return FALSE;
