File tree Expand file tree Collapse file tree
orchid/src/com/subgraph/orchid/connections Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,29 +289,33 @@ private void processCell(Cell cell) {
289289 }
290290
291291 private void processRelayCell (Cell cell ) {
292+ Circuit circuit ;
292293 circuitsLock .lock ();
293294 try {
294- final Circuit circuit = circuitMap .get (cell .getCircuitId ());
295+ circuit = circuitMap .get (cell .getCircuitId ());
295296 if (circuit == null ) {
296297 logger .warning ("Could not deliver relay cell for circuit id = " + cell .getCircuitId () +" on connection " + this +". Circuit not found" );
297298 return ;
298299 }
299- circuit .deliverRelayCell (cell );
300300 } finally {
301301 circuitsLock .unlock ();
302302 }
303+
304+ circuit .deliverRelayCell (cell );
303305 }
304306
305307 private void processControlCell (Cell cell ) {
308+ Circuit circuit ;
306309 circuitsLock .lock ();
307310 try {
308- final Circuit circuit = circuitMap .get (cell .getCircuitId ());
309- if (circuit != null ) {
310- circuit .deliverControlCell (cell );
311- }
311+ circuit = circuitMap .get (cell .getCircuitId ());
312312 } finally {
313313 circuitsLock .unlock ();
314314 }
315+
316+ if (circuit != null ) {
317+ circuit .deliverControlCell (cell );
318+ }
315319 }
316320
317321 void idleCloseCheck () {
You can’t perform that action at this time.
0 commit comments