Hello, RFC 5321 states in 3.3 : "If the mailbox specification is not acceptable for
some reason, the server MUST return a reply indicating whether the failure is permanent (i.e., will occur again if the client tries to send the same address again) or temporary (i.e., the address might be accepted if the client tries again later). " In other words, waiting to complete the DotReader operation seems appropriate unless canceling of the operation is explicit to allow a failure message. Regards, On Monday, May 7, 2018 at 7:39:52 PM UTC+2, julianweise wrote: > > Hey guys, > > I am not quite sure whether the following behavior is intended or not. > Therefore, I am seeking for your advice. > > Using DotReader's Read() function from the textproto package requires me > to provide an predefined buffer to fill in processed data (as usual for > Read() functions). > Let's consider the case I provided a small buffer (in my case for a smtp > server only supporting small mails) but we receive a big mail. > The Read() function of DotReader terminates it's foor loop providing no > error (nil). The textproto Reader still has it's DotReader initialized > (net/textproto line 20). > As a result of this, all other Read functions of the textproto reader now > try finalize the DotReader operation fist (by calling closeDot()). > CloseDot() calls Read() of the DotReader which will only finish > successfully (and setting dotReader to nil) when it detects an dot. > So, no other operation on the textproto Reader is possible until an dot > has been detected. > > I am wondering whether this is intended behavior? Isn't the assumption > valid to just read a certain amount of data and cancel the entire operation > if an certain threshold is reached, still being able to use the reader for > other operations afterwords? > > I would be grateful for any input concerning this topic. > > Cheers, > > Julian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.