MCPcopy Index your code
hub / github.com/nodejs/node / _writeRaw

Function _writeRaw

lib/_http_outgoing.js:400–426  ·  view source on GitHub ↗
(data, encoding, callback, size)

Source from the content-addressed store, hash-verified

398
399OutgoingMessage.prototype._writeRaw = _writeRaw;
400function _writeRaw(data, encoding, callback, size) {
401 const conn = this[kSocket];
402 if (conn?.destroyed) {
403 // The socket was destroyed. If we're still trying to write to it,
404 // then we haven't gotten the 'close' event yet.
405 return false;
406 }
407
408 if (typeof encoding === 'function') {
409 callback = encoding;
410 encoding = null;
411 }
412
413 if (conn && conn._httpMessage === this && conn.writable) {
414 // There might be pending data in the this.output buffer.
415 if (this.outputData.length) {
416 this._flushOutput(conn);
417 }
418 // Directly write to socket.
419 return conn.write(data, encoding, callback);
420 }
421 // Buffer, as long as we're not destroyed.
422 this.outputData.push({ data, encoding, callback });
423 this.outputSize += data.length;
424 this._onPendingData(data.length);
425 return this.outputSize < this[kHighWaterMark];
426}
427
428
429OutgoingMessage.prototype._storeHeader = _storeHeader;

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…