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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/filter/TCPReaderInit.java (file contents):
Revision 1.2 by tdb, Mon Nov 27 10:23:32 2000 UTC vs.
Revision 1.3 by tdb, Mon Nov 27 21:48:44 2000 UTC

# Line 46 | Line 46 | class TCPReaderInit extends Thread {
46      //NEED TO MAJORILY CHANGE THIS BIT !
47      public void run() {
48          try {
49 +            //variables
50 +            String filelist = "";
51 +            String lastModified = "";
52 +            String inBound = "";
53              
54 +            inBound = _socketIn.readLine();
55 +            if(!inBound.equals("HEARTBEAT")) {
56 +                _socketOut.println("ERROR");
57 +                _socketOut.flush();
58 +                throw new IOException("protocol error - expecting:HEARTBEAT got:" + inBound);
59 +            } else {
60 +                _socketOut.println("OK");
61 +                _socketOut.flush();
62 +            }
63 +            
64 +            inBound = _socketIn.readLine();
65 +            if(!inBound.equals("CONFIG")) {
66 +                _socketOut.println("ERROR");
67 +                _socketOut.flush();
68 +                throw new IOException("protocol error - expecting:CONFIG got:" + inBound);
69 +            } else {
70 +                _socketOut.println("OK");
71 +                _socketOut.flush();
72 +            }
73 +            
74 +            inBound = _socketIn.readLine();
75 +            filelist = inBound;
76 +            _socketOut.println("OK");
77 +            _socketOut.flush();
78 +            
79 +            inBound = _socketIn.readLine();
80 +            lastModified = inBound;
81 +            
82 +            boolean newConfig = _configManager.isModified(filelist, Long.parseLong(lastModified));
83 +            
84 +            if(newConfig) {
85 +                _socketOut.println("ERROR");
86 +            }
87 +            else {
88 +                _socketOut.println("OK");
89 +            }
90 +            _socketOut.flush();
91 +            
92 +            inBound = _socketIn.readLine();
93 +            if(!inBound.equals("ENDHEARTBEAT")) {
94 +                _socketOut.println("ERROR");
95 +                _socketOut.flush();
96 +                throw new IOException("protocol error - expecting:ENDHEARTBEAT got:" + inBound);
97 +            } else {
98 +                _socketOut.println("OK");
99 +                _socketOut.flush();
100 +            }
101              
102          } catch (Exception e) {
103              _logRef.write(toString(), Logger.ERROR, "ERROR: " + e.getMessage());

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines