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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@827 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent c7b7c69484
commit d388292f24

@ -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";

@ -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) {

Loading…
Cancel
Save