SMTP Pipelining
uberbrady opened this issue · comments
Maybe nextTick() on the next line? If I paste an entire SMTP conversation into the proxy, it seems to only see the last line.
I think this works.
I think I want to do stuff where I don't emit lines unless there's someone listening. I think when newListener
is emitted on the EventEmitter, or removeListener
comes out - I can pause or resume the emitting of lines.
No, it doesn't work - the responses don't always get associated with the right things. Still needs work.
Argh. Problem is, I don't know which line it's responding to - I know which line I'm sending - part of a request - by the act of calling write() - but that could be buffered, and the next line I receive might be from a few lines prior.
I test this by pasting a whole SMTP conversation into telnet and watching things get confused. :(
There's a callback to write() that will only get called when the write is actually complete - that's probably what we need to hook into - basically not listening for the next line until the command is sent?