40 |
|
{ |
41 |
|
update(agent); |
42 |
|
} |
43 |
+ |
else if (agent.find("Host Update Sharp/") == 0 && method == "POST" && |
44 |
+ |
agent.find(" (") != string::npos && agent.find(')') != string::npos) |
45 |
+ |
{ |
46 |
+ |
update(agent); |
47 |
+ |
} |
48 |
|
else |
49 |
|
{ |
50 |
|
display(); |
86 |
|
false; |
87 |
|
|
88 |
|
for (multimap<string, string>::iterator itor = cgi.find("mode"); itor != |
89 |
< |
cgi.upper_bound("mode"); itor++) |
89 |
> |
cgi.upper_bound("mode") && itor != cgi.end(); itor++) |
90 |
|
{ |
91 |
|
string mode = itor->second; |
92 |
|
|
133 |
|
string host = itor->second, name = sgetenv("REMOTE_HOST"), address = |
134 |
|
sgetenv("REMOTE_ADDR"); |
135 |
|
|
136 |
< |
string::size_type begin = agent.find('(') + 1, end = agent.find(')', |
137 |
< |
begin); |
136 |
> |
string::size_type begin = agent.find('(') + 1, end = agent.rfind(')'); |
137 |
> |
|
138 |
> |
if (begin >= end) return; |
139 |
> |
|
140 |
|
string platform = agent.substr(begin, end - begin); |
141 |
|
|
142 |
|
Host client(host, name, address, platform), saved(host); |
154 |
|
bool request = false; |
155 |
|
|
156 |
|
for (multimap<string, string>::iterator itor = cgi.find("host"); itor != |
157 |
< |
cgi.upper_bound("host"); itor++) |
157 |
> |
cgi.upper_bound("host") && itor != cgi.end(); itor++) |
158 |
|
{ |
159 |
|
if (itor->second != "") |
160 |
|
{ |