MCPcopy
hub / github.com/localtunnel/server / done

Function done

proxy.js:148–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146 var done_called = false;
147 // put the socket back
148 function done() {
149 if (done_called) {
150 throw new Error('done called multiple times');
151 }
152
153 done_called = true;
154 if (!sock.destroyed) {
155 debug('retuning socket');
156 self.sockets.push(sock);
157 }
158
159 // no sockets left to process waiting requests
160 if (self.sockets.length === 0) {
161 return;
162 }
163
164 var wait = self.waiting.shift();
165 debug('processing queued cb');
166 if (wait) {
167 return self.next_socket(cb);
168 }
169 };
170
171 debug('processing request');
172 cb(sock, done);

Callers 5

maybe_bounceFunction · 0.85
basic.jsFile · 0.85
queue.jsFile · 0.85
maybe_doneFunction · 0.85
websocket.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected