Removed debugging + small fix.
This commit is contained in:
parent
0031c5b6c9
commit
79552bf040
1 changed files with 3 additions and 7 deletions
|
|
@ -56,7 +56,7 @@ public class WebServerRequest extends Thread {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
|
||||||
handlers.put("/", new FilesystemHandler(mgr.webDirectory));
|
handlers.put("/", new FilesystemHandler(mgr.webDirectory));
|
||||||
handlers.put("/tiles/", new FilesystemHandler(mgr.webDirectory));
|
handlers.put("/tiles/", new FilesystemHandler(mgr.tileDirectory));
|
||||||
handlers.put("/up/", new ClientUpdateHandler());
|
handlers.put("/up/", new ClientUpdateHandler());
|
||||||
handlers.put("/up/configuration", new ClientConfigurationHandler());
|
handlers.put("/up/configuration", new ClientConfigurationHandler());
|
||||||
handlers.put("/test/", new HttpHandler() {
|
handlers.put("/test/", new HttpHandler() {
|
||||||
|
|
@ -84,7 +84,6 @@ public class WebServerRequest extends Thread {
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
while((line = r.readLine()) != null) {
|
while((line = r.readLine()) != null) {
|
||||||
log.info("Header line: " + line);
|
|
||||||
if (line.equals(""))
|
if (line.equals(""))
|
||||||
break;
|
break;
|
||||||
m = requestHeaderField.matcher(line);
|
m = requestHeaderField.matcher(line);
|
||||||
|
|
@ -124,9 +123,7 @@ public class WebServerRequest extends Thread {
|
||||||
socket.setSoTimeout(30000);
|
socket.setSoTimeout(30000);
|
||||||
|
|
||||||
HttpRequest request = new HttpRequest();
|
HttpRequest request = new HttpRequest();
|
||||||
log.info("Reading request...");
|
|
||||||
if (!readRequestHeader(socket.getInputStream(), request)) {
|
if (!readRequestHeader(socket.getInputStream(), request)) {
|
||||||
log.info("Invalid request header, aborting...");
|
|
||||||
socket.close();
|
socket.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -161,7 +158,6 @@ public class WebServerRequest extends Thread {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("No handler found");
|
|
||||||
socket.close();
|
socket.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -241,9 +237,9 @@ public class WebServerRequest extends Thread {
|
||||||
int current = (int) (System.currentTimeMillis() / 1000);
|
int current = (int) (System.currentTimeMillis() / 1000);
|
||||||
long cutoff = 0;
|
long cutoff = 0;
|
||||||
|
|
||||||
if (path.charAt(0) == '/') {
|
if (path.length() > 0) {
|
||||||
try {
|
try {
|
||||||
cutoff = ((long) Integer.parseInt(path.substring(1))) * 1000;
|
cutoff = ((long) Integer.parseInt(path)) * 1000;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue