Hmm, I think the infinite loop was just a bug, so I would not add a timeout to accommodate for that.  But what a user of the library generally should do (I think we don't do that in sproxy) is putting a timeout when reading from a client.