if (remoteClient.getRemoteIP() != null) { checkAddress(remoteClient.getRemoteIP()); Data.getInstance().addHost(netName, remoteClient);
if (remoteParam.getRemoteIP() != null) { stats.IPUpdateRequestsGWC1.bumpCount(); checkAddress(remoteParam.getRemoteIP()); Data.getInstance().addHost(netName, remoteParam);
    public void doV1(HttpServletRequest request,                        HttpServletResponse response)                        throws ServletException, IOException {        PrintWriter out = response.getWriter();        stats.bumpHour(System.currentTimeMillis());        stats.bumpRequests();        ClientVersion clientVersion = clientVersionFromParams(request);		stats.bumpByClient(clientVersion);		        try {            String netName = "gnutella";            if (request.getParameter("ping") != null) {                out.println("PONG jumswebcache/" + getVersion());            } else if (request.getParameter("urlfile") != null) {            	stats.bumpUrlRequests();                Iterator it = Data.getInstance().getURLs(netName, RemoteURL.PROTO_V1).iterator();                while (it.hasNext()) {                    RemoteURL url = (RemoteURL)it.next();                    out.println(url.getRemoteURL());                }            } else if (request.getParameter("hostfile") != null) {            	stats.bumpHostRequests();                Iterator it = Data.getInstance().getHosts(netName).iterator();                while (it.hasNext()) {                    RemoteClient host = (RemoteClient)it.next();                    out.println(host.getRemoteIP() + ":" + host.getPort());                }            } else if (request.getParameter("url") != null || request.getParameter("ip") != null) {                stats.bumpGWC1Updates();                String remoteIP = request.getRemoteAddr();				RemoteClient remoteClient = remoteFromParams(request,clientVersion);                String c = remoteClient.getClientVersion().getClient();                if (c.equals("GNUT"))                    throw new WebCacheException("phatbot not allowd here");                String url = request.getParameter("url");                out.println("OK");                if (Data.getInstance().isRateLimited(remoteIP)) {                    out.println("WARNING: update denied due to rate limit");                    return;                }                if (remoteClient.getRemoteIP() != null) {                    checkAddress(remoteClient.getRemoteIP());                    Data.getInstance().addHost(netName, remoteClient);                }                if (url != null) {                    try {                        url = URLDecoder.decode(url, "ISO-8859-1");                    } catch (UnsupportedEncodingException ex) {                        throw new WebCacheException("bad encoding");                    }                    RemoteURL remoteURL = new RemoteURL(url, RemoteURL.PROTO_V1, remoteClient.getClientVersion());                    Data.getInstance().addURL(netName, remoteURL);                }            } else if (request.getParameter("statfile") != null) {                out.println(stats.numRequests.getTotalCount());                out.println(stats.numRequests.getLastHourCount());                out.println(stats.numUpdates.getLastHourCount());                out.println(stats.numUpdates);            } else {                out.println("ERROR: unknown command");            }        } catch (WebCacheException ex) {            out.println("ERROR: " + ex.getMessage());            //log("doV1", ex);        }    }