make write more fair...until now it was written as long a possible given no chance for reading anymore...
fix return value...the situation should result in a connection close.
accept as much as possible and stop processing as soon as possible