Skip to content

Commit

Permalink
Fix for retaining large slab buffers in node core
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Matthews committed Jan 24, 2013
1 parent 26d3646 commit d2888c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2888c8

Please sign in to comment.