ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/ConnectionHandler.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/ConnectionHandler.java (file contents):
Revision 1.15 by ajm, Sun Feb 4 00:05:24 2001 UTC vs.
Revision 1.16 by ajm, Sun Feb 4 23:46:08 2001 UTC

# Line 225 | Line 225 | public class ConnectionHandler extends Thread {
225                              Conient.addMessage("ERROR{control link}: " + e);
226                              _controlLink = null;
227                              // and the firewall handler if there is one
228 <                            if (_controlFirewallProcess != null) {
229 <                                _controlFirewallProcess.destroy();
230 <                                _controlFirewallProcess = null;
231 <                            }
228 >                            closeFirewall(_controlFirewallProcess);
229                              _actionQueue.clearQueue(_myQueue);
230                              Conient.setControlStatus("Disconnected");
231                          }
# Line 300 | Line 297 | public class ConnectionHandler extends Thread {
297                                  // print the error and tidy up what's left
298                                  Conient.addMessage("ERROR{data link}: " + e);
299                                  _dataLink = null;
303                                _actionQueue.clearQueue(_myQueue);
300                                  // and the firewall handler if there is one
301 <                                if (_dataFirewallProcess != null) {
302 <                                    _dataFirewallProcess.destroy();
307 <                                    _dataFirewallProcess = null;
308 <                                }
301 >                                closeFirewall(_dataFirewallProcess);
302 >                                _actionQueue.clearQueue(_myQueue);
303                                  Conient.setDataStatus("Disconnected");
304                              }
305                          }
# Line 356 | Line 350 | public class ConnectionHandler extends Thread {
350                              _dataLink = null;
351                              
352                              // and the firewall handler if there is one
353 <                            if (_dataFirewallProcess != null) {
360 <                                _dataFirewallProcess.destroy();
361 <                                _dataFirewallProcess = null;
362 <                            }
353 >                            closeFirewall(_dataFirewallProcess);
354                              
355                              Conient.setDataStatus("Disconnected");
356                          } catch (IOException e) {
# Line 370 | Line 361 | public class ConnectionHandler extends Thread {
361                                  _dataInBound.close();
362                                  _dataLink.close();
363                                  // and the firewall handler if there is one
364 <                                if (_dataFirewallProcess != null) {
374 <                                    _dataFirewallProcess.destroy();
375 <                                    _dataFirewallProcess = null;
376 <                                }
364 >                                closeFirewall(_dataFirewallProcess);
365                              } catch (IOException e2) {
366                                      Conient.addMessage("CRITICAL{control link}: unable to close socket - " + e2);
367                              }
# Line 415 | Line 403 | public class ConnectionHandler extends Thread {
403                                  _controlLink = null;
404                                  
405                                  // and the firewall handler if there is one
406 <                                if (_controlFirewallProcess != null) {
419 <                                    _controlFirewallProcess.destroy();
420 <                                    _controlFirewallProcess = null;
421 <                                }
406 >                                closeFirewall(_controlFirewallProcess);
407                                  
408                                  Conient.setControlStatus("Disconnected");
409                              } catch (IOException e) {
# Line 428 | Line 413 | public class ConnectionHandler extends Thread {
413                                      _outBound.close();
414                                      _controlLink.close();
415                                      // and the firewall handler if there is one
416 <                                    if (_controlFirewallProcess != null) {
432 <                                        _controlFirewallProcess.destroy();
433 <                                        _controlFirewallProcess = null;
434 <                                    }
416 >                                    closeFirewall(_controlFirewallProcess);
417                                  } catch (IOException e2) {
418                                      Conient.addMessage("CRITICAL{control link}: unable to close socket - " + e2);
419                                  }
# Line 569 | Line 551 | public class ConnectionHandler extends Thread {
551              }
552          }        
553          return server;
554 +    }
555 +
556 +    /**
557 +     * Checks to see if the given firewall process
558 +     * has been created.  If it has it calls destroy()
559 +     * on it.
560 +     *
561 +     * @param firewallProcess the process to check
562 +     */
563 +    private void closeFirewall(Process firewallProcess) {
564 +        if (firewallProcess != null) {
565 +            _dataFirewallProcess.destroy();
566 +            _dataFirewallProcess = null;
567 +            Conient.addMessage("WARNING{firewall}: firewall process destroyed");
568 +        }
569      }
570  
571      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines