This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] streambuf.tcc fix (i hope :)


well, after about 24 hours in ddd, I've solved my mystery. I think.

in _S_copy_streambufs(...) __bufsize was being set only once. this 
caused the last sputn() to write a full buffer length when only
a portion of the buffer was last read in.

the change below fixes my case, and seems sane enough to me, but then
it took me nearly three days to find it, so my sanity appraisal could
be _way_ off base :)

hoping this is sane,
  brent

===========================

diff -ru libstdc++-v3/ChangeLog libstdc++-v3.hacked/ChangeLog
--- libstdc++-v3/ChangeLog	Fri Jun  2 21:52:32 2000
+++ libstdc++-v3.hacked/ChangeLog	Mon Jun  5 07:01:34 2000
@@ -1,3 +1,6 @@
+2000-06-05  Brent Verner <brent@hesketh.com>
+  * bits/streambuf.tcc: repaired _S_copy_streambufs()
+
 2000-06-02  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>
 
 	* bits/locale_facets.h: Tweak.
diff -ru libstdc++-v3/bits/streambuf.tcc libstdc++-v3.hacked/bits/streambuf.tcc
--- libstdc++-v3/bits/streambuf.tcc	Fri May 19 05:33:23 2000
+++ libstdc++-v3.hacked/bits/streambuf.tcc	Mon Jun  5 07:18:34 2000
@@ -242,6 +242,10 @@
 	      }
 	    else
 	      break;
+
+	    __bufsize = __sbin->in_avail();
+	    // could cheat and use _M_buf_size to save a fn call -=db=-
+	    // __bufsize = __sbin->_M_buf_size;
 	  }
       }
       catch(exception& __fail) {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]