Fix for retaining large slab buffers in node core

This commit is contained in:
Justin Matthews 2013-01-24 15:44:06 -08:00
parent 26d3646ff2
commit d2888c83f5

View File

@ -390,12 +390,15 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
// Performs a WebSocket proxy operation to the location specified by
// `this.target`.
//
HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer) {
HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, upgradeHead, buffer) {
var self = this,
outgoing = new(this.target.base),
listeners = {},
errState = false,
CRLF = '\r\n';
CRLF = '\r\n',
//copy upgradeHead to avoid retention of large slab buffers used in node core
head = new Buffer(upgradeHead.length);
upgradeHead.copy(head);
//
// WebSocket requests must have the `GET` method and