projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos-mapd: Install systemd service file and defaults file
[fw/altos]
/
map-server
/
altos-mapd
/
AltosMapdClient.java
diff --git
a/map-server/altos-mapd/AltosMapdClient.java
b/map-server/altos-mapd/AltosMapdClient.java
index fb0c08e60f8422bfb698f87854776446b2fdb7bb..09833363a0c4f6255ba4e0369059fe664fbbd063 100644
(file)
--- a/
map-server/altos-mapd/AltosMapdClient.java
+++ b/
map-server/altos-mapd/AltosMapdClient.java
@@
-26,7
+26,10
@@
public class AltosMapdClient extends Thread implements AltosMapStoreListener {
private AltosJson request;
private AltosJson reply;
private AltosJson request;
private AltosJson reply;
+ private int http_status;
+
private void set_status(int status) {
private void set_status(int status) {
+ http_status = status;
reply.put("status", status);
}
reply.put("status", status);
}
@@
-77,10
+80,11
@@
public class AltosMapdClient extends Thread implements AltosMapStoreListener {
addr == null)
{
set_status(400);
addr == null)
{
set_status(400);
+ } else if (!AltosMapd.check_lat_lon(lat, lon)) {
+ set_status(403); /* Forbidden */
} else {
} else {
- store_ready = new Semaphore(0);
-
System.out.printf("Fetching tile for %g %g %d\n", lat, lon, zoom
);
+
store_ready = new Semaphore(0
);
AltosMapStore map_store = AltosMapStore.get(new AltosLatLon(lat, lon),
zoom,
AltosMapStore map_store = AltosMapStore.get(new AltosLatLon(lat, lon),
zoom,
@@
-90,13
+94,10
@@
public class AltosMapdClient extends Thread implements AltosMapStoreListener {
int status;
if (map_store == null) {
int status;
if (map_store == null) {
- System.out.printf("no store?\n");
status = AltosMapTile.failed;
} else {
map_store.add_listener(this);
status = AltosMapTile.failed;
} else {
map_store.add_listener(this);
- System.out.printf("Waiting for tile\n");
-
try {
store_ready.acquire();
} catch (Exception ie) {
try {
store_ready.acquire();
} catch (Exception ie) {
@@
-120,6
+121,9
@@
public class AltosMapdClient extends Thread implements AltosMapStoreListener {
set_status(400);
}
}
set_status(400);
}
}
+ System.out.printf("%s: %.6f %.6f %d status %d\n",
+ addr, lat, lon, zoom, http_status);
+
} catch (Exception e) {
System.out.printf("client exception %s\n", e.toString());
e.printStackTrace(System.out);
} catch (Exception e) {
System.out.printf("client exception %s\n", e.toString());
e.printStackTrace(System.out);
@@
-137,7
+141,6
@@
public class AltosMapdClient extends Thread implements AltosMapStoreListener {
socket.close();
} catch (IOException ie) {
}
socket.close();
} catch (IOException ie) {
}
- System.out.printf("client done\n");
}
}
}
}