| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 53fb7af commit c07a065
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -744,6 +744,9 @@ Returns `true` if the entire data was flushed successfully to the kernel | |||
| 744 | 744 | buffer. Returns `false` if all or part of the data was queued in user memory. | |
| 745 | 745 | `'drain'` will be emitted when the buffer is free again. | |
| 746 | 746 | ||
| 747 | + When `write` function is called with empty string or buffer, it does | ||
| 748 | + nothing and waits for more input. | ||
| 749 | + | ||
| 747 | 750 | ## Class: http.Server | |
| 748 | 751 | <!-- YAML | |
| 749 | 752 | added: v0.1.17 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -599,7 +599,10 @@ function write_(msg, chunk, encoding, callback, fromEnd) { | |||
| 599 | 599 | ||
| 600 | 600 | // If we get an empty string or buffer, then just do nothing, and | |
| 601 | 601 | // signal the user to keep writing. | |
| 602 | - if (chunk.length === 0) return true; | ||
| 602 | + if (chunk.length === 0) { | ||
| 603 | + debug('received empty string or buffer and waiting for more input'); | ||
| 604 | + return true; | ||
| 605 | + } | ||
| 603 | 606 | ||
| 604 | 607 | if (!fromEnd && msg.connection && !msg[kIsCorked]) { | |
| 605 | 608 | msg.connection.cork(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments