Tor configured as transparent proxy buffers hundreds of MB from client connections.
Hello, I have Tor running in one VM (not very much RAM), client programs in another VM. Tor is configured as transparent proxy. When I browse the WWW or download something everything works fine, but when I try to upload a large file via HTTP (didn't try other protocols), Tor reads huge amounts of data from the client in a few seconds and obviously stores it in memory (ps indicates it uses several hundred MB, which is bad because the VM doesn't have much RAM). That is the first bug. Tor probably needs a buffer, but not so large, maybe 64k or something like that.
The second bug is that when the client terminates (interrupts) the transfer, Tor keeps sending what is in the buffer. No way for the client to stop it. Tor should notice that the connection on the client side is finished and end the corresponding stream to the Tor network. Actually this may not be a bug on its own but it aggravates the problem of the first bug, because when I start and cancel uploads the network connection is clogged and I can only restart the Tor process. But of course if the upload terminates normally and Tor has only 64kB buffer, it should not terminate before it has sent the buffered data. I hope you understand what I mean. :-)