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

http: rename var to let and const #30279

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
http: remove bytesParsed var
  • Loading branch information
telenord committed Nov 6, 2019
commit eca6860f3667be371f23d970474480e4dc02aa3f
3 changes: 1 addition & 2 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
socketOnError.call(socket, ret);
} else if (parser.incoming && parser.incoming.upgrade) {
// Upgrade or CONNECT
const bytesParsed = ret;
const req = parser.incoming;
debug('SERVER upgrade or connect', req.method);

Expand All @@ -594,7 +593,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
const eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade';
if (eventName === 'upgrade' || server.listenerCount(eventName) > 0) {
debug('SERVER have listener for %s', eventName);
const bodyHead = d.slice(bytesParsed, d.length);
const bodyHead = d.slice(ret, d.length);

socket.readableFlowing = null;
server.emit(eventName, req, socket, bodyHead);
Expand Down