ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostStatus/HostStatus.cpp
(Generate patch)

Comparing HostStatus/HostStatus.cpp (file contents):
Revision 29 by Douglas Thrift, 2003-11-14T12:44:58-08:00 vs.
Revision 34 by Douglas Thrift, 2003-11-15T01:06:43-08:00

# Line 5 | Line 5
5   // $Id$
6  
7   #include "HostStatus.hpp"
8 + #include "Host.hpp"
9  
10   int main(int argc, char* argv[])
11   {
# Line 15 | Line 16 | int main(int argc, char* argv[])
16  
17   HostStatus::HostStatus()
18   {
19 +        sputenv("TZ=:America/Los_Angeles");
20 +
21          string method = sgetenv("REQUEST_METHOD");
22  
23          parse(method);
# Line 83 | Line 86 | void HostStatus::display(const string& m
86                          hostupdate << itor->first << '=' << itor->second << '&';
87                  }
88  
89 <                hostupdate << '\n';
89 >                hostupdate << '\n' << flush;
90          }
91  
92 +        hostupdate.ignore(string::npos, '\n');
93 +        hostupdate.ignore(string::npos, '\n');
94 +
95 +        list<Host> hosts;
96 +        bool done = false;
97 +
98          do
99          {
100 <                string line;
100 >                Host host;
101 >
102 >                hostupdate >> host;
103 >
104 >                hosts.push_back(host);
105 >
106 >                switch (hostupdate.peek())
107 >                {
108 >                case 'h':
109 >                case 'n':
110 >                case 'a':
111 >                case 'p':
112 >                case 's':
113 >                        break;
114 >                default:
115 >                        done = true;
116 >                        break;
117 >                }
118 >        }
119 >        while (!done && hostupdate.good());
120  
121 <                getline(hostupdate, line);
121 >        if (format == page) header();
122  
123 <                cout << line << '\n';
123 >        for (list<Host>::iterator itor = hosts.begin(); itor != hosts.end(); itor++)
124 >        {
125 >                Host host = *itor;
126 >
127 >                cout << host << flush;
128          }
129 <        while (hostupdate.good());
129 >
130 >        if (format == page) footer();
131   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines