@@ -13,7 +13,6 @@ import Connection from './Connection';
1313import * as networkUtils from './utils' ;
1414import * as networkErrors from './errors' ;
1515import * as keysUtils from '../keys/utils' ;
16- import * as nodesUtils from '../nodes/utils' ;
1716import { promise } from '../utils' ;
1817import * as contextsErrors from '../contexts/errors' ;
1918import { timedCancellable , context } from '../contexts/index' ;
@@ -43,15 +42,6 @@ class ConnectionForward extends Connection {
4342 data : Buffer ,
4443 remoteInfo : { address : string ; port : number } ,
4544 ) => {
46- if ( remoteInfo . port !== 1314 ) {
47- console . log (
48- new Date ( ) ,
49- 'CONNECTION FORWARD RECEIVED MESSAGE' ,
50- nodesUtils . encodeNodeId ( this . nodeId ) ,
51- remoteInfo ,
52- data ,
53- ) ;
54- }
5545 // Ignore messages not intended for this target
5646 if ( remoteInfo . address !== this . host || remoteInfo . port !== this . port ) {
5747 return ;
@@ -69,14 +59,6 @@ class ConnectionForward extends Connection {
6959 this . startKeepAliveTimeout ( ) ;
7060 }
7161 if ( msg . type === 'ping' ) {
72- if ( remoteInfo . port !== 1314 ) {
73- console . log (
74- new Date ( ) ,
75- 'CONNECTION FORWARD RECEIVED PING MESSAGE, RESPONDING WITH PONG' ,
76- nodesUtils . encodeNodeId ( this . nodeId ) ,
77- remoteInfo ,
78- ) ;
79- }
8062 this . resolveReadyP ( ) ;
8163 // Respond with ready message
8264 await this . send ( networkUtils . pongBuffer ) ;
@@ -93,7 +75,7 @@ class ConnectionForward extends Connection {
9375 * Handler is removed and not executed when `end` is initiated here
9476 */
9577 protected handleEnd = async ( ) => {
96- this . logger . info ( 'Receives tlsSocket ending' ) ;
78+ this . logger . debug ( 'Receives tlsSocket ending' ) ;
9779 if ( this . utpConn . destroyed ) {
9880 this . tlsSocket . destroy ( ) ;
9981 this . logger . debug ( 'Destroyed tlsSocket' ) ;
@@ -112,7 +94,6 @@ class ConnectionForward extends Connection {
11294 * If already stopped, then this does nothing
11395 */
11496 protected handleClose = async ( ) => {
115- this . logger . info ( 'Receives tlsSocket close' ) ;
11697 await this . stop ( ) ;
11798 } ;
11899
@@ -144,7 +125,7 @@ class ConnectionForward extends Connection {
144125 // Promise for abortion and timeout
145126 const { p : abortedP , resolveP : resolveAbortedP } = promise < void > ( ) ;
146127 if ( ctx . signal . aborted ) {
147- this . logger . info ( `Failed to start Connection Forward: aborted` ) ;
128+ this . logger . debug ( `Failed to start Connection Forward: aborted` ) ;
148129 // This is for arbitrary abortion reason provided by the caller
149130 // Re-throw the default timeout error as a network timeout error
150131 if (
@@ -184,32 +165,14 @@ class ConnectionForward extends Connection {
184165 let punchInterval ;
185166 try {
186167 // Send punch signal
187- // if (this.port !== 1314) {
188- // console.log(
189- // new Date(),
190- // 'CONNECTION FORWARD SENDING PING MESSAGE',
191- // nodesUtils.encodeNodeId(this.nodeId),
192- // this.host,
193- // this.port,
194- // );
195- // }
196168 await this . send ( networkUtils . pingBuffer ) ;
197169 punchInterval = setInterval ( async ( ) => {
198- // If (this.port !== 1314) {
199- // console.log(
200- // new Date(),
201- // 'CONNECTION FORWARD SENDING PING MESSAGE',
202- // nodesUtils.encodeNodeId(this.nodeId),
203- // this.host,
204- // this.port,
205- // );
206- // }
207170 await this . send ( networkUtils . pingBuffer ) ;
208171 } , this . punchIntervalTime ) ;
209172 await Promise . race ( [
210173 Promise . all ( [ readyP , secureConnectP ] ) ,
211174 errorP ,
212- // abortedP,
175+ abortedP ,
213176 ] ) ;
214177 } catch ( e ) {
215178 // Clean up partial start
@@ -219,7 +182,7 @@ class ConnectionForward extends Connection {
219182 this . tlsSocket . destroy ( ) ;
220183 }
221184 this . utpSocket . off ( 'message' , this . handleMessage ) ;
222- this . logger . info ( `Failed to start Connection Forward: ${ e . message } ` ) ;
185+ this . logger . debug ( `Failed to start Connection Forward: ${ e . message } ` ) ;
223186 throw new networkErrors . ErrorConnectionStart ( undefined , {
224187 cause : e ,
225188 } ) ;
@@ -229,7 +192,7 @@ class ConnectionForward extends Connection {
229192 this . tlsSocket . on ( 'error' , this . handleError ) ;
230193 this . tlsSocket . off ( 'error' , handleStartError ) ;
231194 if ( ctx . signal . aborted ) {
232- this . logger . info ( `Failed to start Connection Forward: aborted` ) ;
195+ this . logger . debug ( `Failed to start Connection Forward: aborted` ) ;
233196 // Clean up partial start
234197 // TLSSocket isn't established yet, so it is destroyed
235198 if ( ! this . tlsSocket . destroyed ) {
@@ -250,7 +213,7 @@ class ConnectionForward extends Connection {
250213 try {
251214 networkUtils . verifyServerCertificateChain ( this . nodeId , serverCertChain ) ;
252215 } catch ( e ) {
253- this . logger . info (
216+ this . logger . debug (
254217 `Failed to start Connection Forward: verification failed` ,
255218 ) ;
256219 // Clean up partial start
0 commit comments