projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f4f692
)
file serve: defer transaction completed to HTTP_FILE_COMPLETION
author
Andy Green
<andy@warmcat.com>
Wed, 28 Jun 2017 06:27:09 +0000
(14:27 +0800)
committer
Andy Green
<andy@warmcat.com>
Wed, 28 Jun 2017 06:27:09 +0000
(14:27 +0800)
lib/server.c
patch
|
blob
|
history
diff --git
a/lib/server.c
b/lib/server.c
index
76c914c
..
3bfd1de
100644
(file)
--- a/
lib/server.c
+++ b/
lib/server.c
@@
-2379,12
+2379,15
@@
try_pollout:
break;
}
- /* >0 == completion, <0 == error */
+ /* >0 == completion, <0 == error
+ *
+ * We'll get a LWS_CALLBACK_HTTP_FILE_COMPLETION callback when
+ * it's done. That's the case even if we just completed the
+ * send, so wait for that.
+ */
n = lws_serve_http_file_fragment(wsi);
- if (n < 0 || (n > 0 && lws_http_transaction_completed(wsi))) {
- lwsl_info("completed\n");
+ if (n < 0)
goto fail;
- }
break;