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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostInit.java (file contents):
Revision 1.35 by tdb, Mon Feb 24 20:18:50 2003 UTC vs.
Revision 1.40 by tdb, Sun Aug 1 10:41:05 2004 UTC

# Line 1 | Line 1
1   /*
2   * i-scream central monitoring system
3 < * http://www.i-scream.org.uk
3 > * http://www.i-scream.org
4   * Copyright (C) 2000-2002 i-scream
5   *
6   * This program is free software; you can redistribute it and/or
# Line 101 | Line 101 | class HostInit extends Thread {
101                      getInBound("FQDN");
102                      _socketOut.println(_socket.getInetAddress().getHostName().toLowerCase());
103                      
104 +                    // try for IP
105 +                    getInBound("IP");
106 +                    _socketOut.println(_socket.getInetAddress().getHostAddress());
107 +                    
108                      // get properties
109                      String reqProperty = getInBound();
110                      while(!reqProperty.equals("ENDCONFIG")) {
# Line 165 | Line 169 | class HostInit extends Thread {
169                      
170                      // try for {lastModified}
171                      String lastModified = getInBound();
172 +                    long lastmod;
173 +                    try {
174 +                        lastmod = Long.parseLong(lastModified);
175 +                    }
176 +                    catch(NumberFormatException e) {
177 +                        _socketOut.println("ERROR");
178 +                        throw new IOException("Last Modified invalid: " + e);
179 +                    }
180 +                    
181                      // check to see if a config update has happen
182 <                    boolean newConfig = _configManager.isModified(filelist, Long.parseLong(lastModified));
182 >                    boolean newConfig = _configManager.isModified(filelist, lastmod);
183                      if(newConfig) {
184                          // new config !
185 <                        _socketOut.println("ERROR");
185 >                        _socketOut.println("EXPIRED");
186                      }
187                      else {
188                          // nothing has changed
# Line 223 | Line 236 | class HostInit extends Thread {
236          String inBound = getInBound();
237          // check if it's what we're expecting
238          if(!inBound.equals(expected)) {
239 +            _socketOut.println("ERROR");
240              throw new IOException("protocol error - expected:"+expected+" got:" + inBound);
241          }
242          // it should be ok then

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines