diff options
| author | Shulhan <ms@kilabit.info> | 2023-11-24 21:45:41 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-11-26 21:32:52 +0700 |
| commit | 93c7f9f18eafb68ff892a2ecb3de25d8a56d3e84 (patch) | |
| tree | b9ecfe6c27036cbc633eef4e3ea2e4b05e6eb9f9 | |
| parent | 423c3fde1cd36d55c8fc4cdbf58394b5177dea05 (diff) | |
| download | pakakeh.go-93c7f9f18eafb68ff892a2ecb3de25d8a56d3e84.tar.xz | |
http/sseclient: remove double check for non-empty packet
Let the parseEvent handle and check for empty packet.
| -rw-r--r-- | lib/http/sseclient/sseclient.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/http/sseclient/sseclient.go b/lib/http/sseclient/sseclient.go index 71bef4c0..ed799114 100644 --- a/lib/http/sseclient/sseclient.go +++ b/lib/http/sseclient/sseclient.go @@ -125,11 +125,9 @@ func (cl *Client) Connect(header http.Header) (err error) { default: } - if len(packet) != 0 { - // The HTTP response may contains events in the body, - // consume it. - cl.parseEvent(packet) - } + // The HTTP response may contains events in the body, + // consume it. + cl.parseEvent(packet) go cl.consume() |
