File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 7474-- is no data to read. If there is no data, then it MUST return
7575-- `nil, self.signal_idle` to indicate it no data was there and we need to retry later.
7676--
77+ -- If there is partial data, it should return that data (less than the requested
78+ -- number of bytes), with no error/signal.
79+ --
7780-- If the receive errors, because of a closed connection it should return
7881-- `nil, self.signal_closed` to indicate this. Any other errors can be returned
7982-- as a regular `nil, err`.
Original file line number Diff line number Diff line change @@ -118,8 +118,10 @@ function luasocket:plain_receive(size)
118118
119119 sock :settimeout (0 )
120120
121- local data , err = sock :receive (size )
122- if data then
121+ local data , err , partial = sock :receive (size )
122+
123+ data = data or partial or " "
124+ if # data > 0 then
123125 return data
124126 end
125127
You can’t perform that action at this time.
0 commit comments