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

Function freeParser

lib/_http_common.js:188–210  ·  view source on GitHub ↗
(parser, req, socket)

Source from the content-addressed store, hash-verified

186// be done in FreeList.free. `parsers.free(parser)`
187// should be all that is needed.
188function freeParser(parser, req, socket) {
189 if (parser) {
190 if (parser._consumed)
191 parser.unconsume();
192 parser.remove();
193 cleanParser(parser);
194 if (parsers.free(parser) === false) {
195 // Make sure the parser's stack has unwound before deleting the
196 // corresponding C++ object through .close().
197 setImmediate(closeParserInstance, parser);
198 } else {
199 // Since the Parser destructor isn't going to run the destroy() callbacks
200 // it needs to be triggered manually.
201 parser.free();
202 }
203 }
204 if (req) {
205 req.parser = null;
206 }
207 if (socket) {
208 socket.parser = null;
209 }
210}
211
212// Character code ranges for valid HTTP tokens
213// Valid chars: ^_`a-zA-Z-0-9!#$%&'*+.|~

Callers 8

socketCloseListenerFunction · 0.85
socketErrorListenerFunction · 0.85
socketOnEndFunction · 0.85
socketOnDataFunction · 0.85
socketOnCloseFunction · 0.85
onParserExecuteCommonFunction · 0.85
sendFunction · 0.85
testFunction · 0.85

Calls 5

cleanParserFunction · 0.85
unconsumeMethod · 0.80
freeMethod · 0.80
setImmediateFunction · 0.70
removeMethod · 0.45

Tested by 1

testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…