Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) adding function for user accounting which is called after each http request

thelid388292f244c
diff --git a/source/de/anomic/http/httpHeader.java b/source/de/anomic/http/httpHeader.java
index 1f21cd6e3..d086c6915 100644
--- a/source/de/anomic/http/httpHeader.java
+++ b/source/de/anomic/http/httpHeader.java
@@ -114,6 +114,7 @@ public final class httpHeader extends TreeMap implements Map {
public static final String CACHE_CONTROL = "Cache-Control";
public static final String TRANSFER_ENCODING = "Transfer-Encoding";
public static final String LOCATION = "Location";
+ public static final String ETAG = "ETag";
public static final String X_CACHE = "X-Cache";
public static final String X_CACHE_LOOKUP = "X-Cache-Lookup";
@@ -188,6 +189,7 @@ public final class httpHeader extends TreeMap implements Map {
/* PROPERTIES: General properties */
public static final String CONNECTION_PROP_HTTP_VER = "HTTP";
public static final String CONNECTION_PROP_HOST = "HOST";
+ public static final String CONNECTION_PROP_USER = "USER";
public static final String CONNECTION_PROP_METHOD = "METHOD";
public static final String CONNECTION_PROP_PATH = "PATH";
public static final String CONNECTION_PROP_EXT = "EXT";
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index 941a11508..af5656f60 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -428,6 +428,8 @@ public final class httpd implements serverHandler {
} catch (Exception e) {
logUnexpectedError(e);
return serverCore.TERMINATE_CONNECTION;
+ } finally {
+ this.doUserAccounting(this.prop);
}
}
@@ -499,7 +501,9 @@ public final class httpd implements serverHandler {
} catch (Exception e) {
logUnexpectedError(e);
return serverCore.TERMINATE_CONNECTION;
- }
+ } finally {
+ this.doUserAccounting(this.prop);
+ }
}
public Boolean POST(String arg) throws IOException {
@@ -581,7 +585,9 @@ public final class httpd implements serverHandler {
} catch (Exception e) {
logUnexpectedError(e);
return serverCore.TERMINATE_CONNECTION;
- }
+ } finally {
+ this.doUserAccounting(this.prop);
+ }
}
@@ -1207,6 +1213,13 @@ public final class httpd implements serverHandler {
return true;
}
+ public void doUserAccounting(Properties conProps) {
+ // TODO: validation of conprop fields
+ // httpHeader.CONNECTION_PROP_USER
+ // httpHeader.CONNECTION_PROP_CLIENTIP
+ // httpHeader.CONNECTION_PROP_PROXY_RESPOND_SIZE
+ // httpHeader.CONNECTION_PROP_PROXY_RESPOND_STATUS
+ }
// public static boolean isTextMime(String mime, Set whitelist) {