Skip to content

Commit 003575e

Browse files
committed
fix: don't sendall unless there's data
1 parent 2eb2183 commit 003575e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/prime-time/main.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ int main()
151151
fd,
152152
size,
153153
data);
154+
rs = 0;
154155
result = handle_request(sdqu, data, (size_t)size);
155156
sdsize = queue_pop_no_copy(sdqu, &sddata);
156-
rs = sendall(fd, sddata, &sdsize);
157+
if (sdsize > 0)
158+
rs = sendall(fd, sddata, &sdsize);
157159

158160
if ((result <= 0) || (rs != 0)) {
159161
if (result == 0)

0 commit comments

Comments
 (0)