>>>>> "A" == Alexander Bokovoy <a.bokovoy / sam-solutions.net> writes:

A> Yes, I stated same (look at my previous email, closer to its end). The
A> problem is in how that code (_write/_flush) handles buffer overruns,
A> there were attempts to optimize it but still fragile from my point of
A> view. 

 Well, it's easy to understand :
  * it add 9362 (len) to marker
  * in flush() it substract at most 4096 (bufsize) to marker

 then (buffer - marker) > bufsize and this give rest < 0

Guy Decoux