(self)
| 1176 | return url_obj.path, dict(urllib.parse.parse_qsl(url_obj.query)) |
| 1177 | |
| 1178 | def run(self): |
| 1179 | try: |
| 1180 | cmd = self.cmd |
| 1181 | url, queryParams = self.parse_req(cmd) |
| 1182 | if url is None: |
| 1183 | print_ts('invalid request: {}'.format(cmd)) |
| 1184 | self.connection.close() |
| 1185 | return |
| 1186 | t_start = time.perf_counter() |
| 1187 | if url == '/': |
| 1188 | html = overviewReport() |
| 1189 | httpGetResponse(self.connection, html, 'text/html') |
| 1190 | elif url == '/latest.html': |
| 1191 | html = latestReport(self.latestResults) |
| 1192 | httpGetResponse(self.connection, html, 'text/html') |
| 1193 | elif url == '/crash.html': |
| 1194 | text, mime = crashReport(self.resultPath, queryParams) |
| 1195 | httpGetResponse(self.connection, text, mime) |
| 1196 | elif url == '/timeout.html': |
| 1197 | html = timeoutReport(self.resultPath) |
| 1198 | httpGetResponse(self.connection, html, 'text/html') |
| 1199 | elif url == '/stale.html': |
| 1200 | html = staleReport(self.resultPath, queryParams) |
| 1201 | httpGetResponse(self.connection, html, 'text/html') |
| 1202 | elif url == '/diff.html': |
| 1203 | html = diffReport(self.resultPath) |
| 1204 | httpGetResponse(self.connection, html, 'text/html') |
| 1205 | elif url.startswith('/difftoday-'): |
| 1206 | messageId = url[len('/difftoday-'):] |
| 1207 | text = diffMessageIdTodayReport(self.resultPath, messageId) |
| 1208 | httpGetResponse(self.connection, text, 'text/plain') |
| 1209 | elif url.startswith('/diff-'): |
| 1210 | messageId = url[len('/diff-'):] |
| 1211 | text = diffMessageIdReport(self.resultPath, messageId) |
| 1212 | httpGetResponse(self.connection, text, 'text/plain') |
| 1213 | elif url == '/head.html': |
| 1214 | html = headReport(self.resultPath) |
| 1215 | httpGetResponse(self.connection, html, 'text/html') |
| 1216 | elif url == '/headinfo.html': |
| 1217 | html = infoReport(self.infoPath) |
| 1218 | httpGetResponse(self.connection, html, 'text/html') |
| 1219 | elif url.startswith('/headtoday-'): |
| 1220 | messageId = url[len('/headtoday-'):] |
| 1221 | text = headMessageIdTodayReport(self.resultPath, messageId) |
| 1222 | httpGetResponse(self.connection, text, 'text/plain') |
| 1223 | elif url.startswith('/headinfotoday-'): |
| 1224 | messageId = url[len('/headinfotoday-'):] |
| 1225 | text = infoMessageIdTodayReport(self.infoPath, messageId) |
| 1226 | httpGetResponse(self.connection, text, 'text/plain') |
| 1227 | elif url.startswith('/head-'): |
| 1228 | messageId = url[len('/head-'):] |
| 1229 | text = headMessageIdReport(self.resultPath, messageId, queryParams) |
| 1230 | httpGetResponse(self.connection, text, 'text/plain') |
| 1231 | elif url.startswith('/headinfo-'): |
| 1232 | messageId = url[len('/headinfo-'):] |
| 1233 | text = infoMessageIdReport(self.infoPath, messageId, queryParams) |
| 1234 | httpGetResponse(self.connection, text, 'text/plain') |
| 1235 | elif url == '/time_lt.html': |
nothing calls this directly
no test coverage detected