File tree Expand file tree Collapse file tree
addons/httprox/common/src/main/java/org/commonjava/indy/httprox/handler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,24 +143,24 @@ public void handleEvent( AcceptingChannel<StreamConnection> channel )
143143 try
144144 {
145145 accepted = channel .accept ();
146-
147- MDC .put ( REQUEST_PHASE , REQUEST_PHASE_START );
148- LoggerFactory .getLogger ( PROXY_METRIC_LOGGER )
149- .info ( "START HTTProx request (from: {})" , accepted .getPeerAddress () );
150- MDC .remove ( REQUEST_PHASE );
151-
152146 }
153147 catch ( IOException e )
154148 {
155- logger .error ( "Failed to addMetadata httprox connection: " + e .getMessage (), e );
156- return ;
149+ logger .error ( "Failed to accept httprox connection: " + e .getMessage (), e );
150+ accepted = null ;
157151 }
158152
153+ // to remove the return in the catch clause, which is bad form...
159154 if ( accepted == null )
160155 {
161156 return ;
162157 }
163158
159+ MDC .put ( REQUEST_PHASE , REQUEST_PHASE_START );
160+ LoggerFactory .getLogger ( PROXY_METRIC_LOGGER )
161+ .info ( "START HTTProx request (from: {})" , accepted .getPeerAddress () );
162+ MDC .remove ( REQUEST_PHASE );
163+
164164 logger .debug ( "accepted {}" , accepted .getPeerAddress () );
165165
166166 final ConduitStreamSourceChannel source = accepted .getSourceChannel ();
You can’t perform that action at this time.
0 commit comments