Re: How to make dump() unbuffered?
BSZ Tim <[email protected]> Tue, 18 May 2010 04:56:03 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <e059e16e-6b29-43a9-955a-ed357570044e@o39g2000vbd.googlegroups.com> |
On 18 mai, 05:19, Boris Zbarsky <[email protected]> wrote: > On 5/17/10 6:35 PM, BSZ Tim wrote: > > > Is window.dump() 's output buffered? > > Here's the relevant part of dump(): > > 4091 if (cstr) { > 4092 FILE *fp = gDumpFile ? gDumpFile : stdout; > 4093 fputs(cstr, fp); > 4094 fflush(fp); > 4095 nsMemory::Free(cstr); > 4096 } > > That's about as unbuffered as we can get on our end; what libc and the > OS (and possibly your shell) do at that point is up to them. Thanks for the answer and exonerating dump(). With some trial and error I managed to see unbuffered output, when running FF with the - console option. <offtopic> After some research I also found that problems caused by buffering in pipes are documented in e.g msys+rxvt consoles; see http://readlist.com/lists/lists.sourceforge.net/mingw-users/0/3113.html or http://old.nabble.com/problem-with-unbuffered-read-ts1173321.html#a1173321 Given that I need the pipes for my setup, the recommended workaround (msys+cmd) does not work. I ended up with the kludge of sending a 4K padding with each message to make sure that the buffer flushes. </offtopic> BSZ