Commit fe4da122 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Reduce unnecessary encoding work

parent 9fdaa95a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -331,11 +331,11 @@ class Session:
			raise RuntimeError(
				"Session.extension() may only be awaited before the HEADERS phase",
			)
		bname = name.encode("utf-8")
		while self.phase <= Phase.ENVELOPE:
			message = await self._broadcast.receive()
			match message:
				case Unknown():
					bname = name.encode("utf-8")
					if message.content[:len(bname)] == bname:
						return message.content
				# fake buffers for MAIL and RCPT commands