MCPcopy Create free account
hub / github.com/TruthHun/BookStack / ondata

Function ondata

static/word2md/mammoth.browser.js:24695–24711  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

24693 var increasedAwaitDrain = false;
24694 src.on('data', ondata);
24695 function ondata(chunk) {
24696 debug('ondata');
24697 increasedAwaitDrain = false;
24698 var ret = dest.write(chunk);
24699 if (false === ret && !increasedAwaitDrain) {
24700 // If the user unpiped during `dest.write()`, it is possible
24701 // to get stuck in a permanently paused state if that write
24702 // also returned false.
24703 // => Check whether `dest` is still a piping destination.
24704 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
24705 debug('false write response, pause', src._readableState.awaitDrain);
24706 src._readableState.awaitDrain++;
24707 increasedAwaitDrain = true;
24708 }
24709 src.pause();
24710 }
24711 }
24712
24713 // if the dest has an error, then stop piping into it.
24714 // however, don't suppress the throwing behavior for this.

Callers

nothing calls this directly

Calls 1

indexOfFunction · 0.70

Tested by

no test coverage detected