File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 76
76
-- is no data to read. If there is no data, then it MUST return
77
77
-- `nil, self.signal_idle` to indicate it no data was there and we need to retry later.
78
78
--
79
+ -- If there is partial data, it should return that data (less than the requested
80
+ -- number of bytes), with no error/signal.
81
+ --
79
82
-- If the receive errors, because of a closed connection it should return
80
83
-- `nil, self.signal_closed` to indicate this. Any other errors can be returned
81
84
-- as a regular `nil, err`.
Original file line number Diff line number Diff line change @@ -118,8 +118,10 @@ function luasocket:plain_receive(size)
118
118
119
119
sock :settimeout (0 )
120
120
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
123
125
return data
124
126
end
125
127
You can’t perform that action at this time.
0 commit comments