Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for slab buffer retention, leading to large memory consumption #370

Merged
merged 1 commit into from Apr 9, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/node-http-proxy/http-proxy.js
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