docs: public void process(final String uri, final String hostAddress, RequestHandler requestHandler)
            throws IOException {
      // Prepare the response headers.
  
      /**
       * Parse the query parameters into an announce request message.
       *
       * We need to rely on our own query parsing function because
       * SimpleHTTP's Query map will contain UTF-8 decoded parameters, which
       * doesn't work well for the byte-encoded strings we expect.
       */
      HTTPAnnounceRequestMessage announceRequest;
      try {
        announceRequest = this.parseQuery(uri, hostAddress);
      } catch (MessageValidationException mve) {
        LoggerUtils.warnAndDebugDetails(logger, "Unable to parse request message. Request url is {}", uri, mve);
        serveError(Status.BAD_REQUEST, mve.getMessage(), requestHandler);
        return;
      }
  
      AnnounceRequestMessage.RequestEvent event = announceRequest.getEvent();
  
      if (event == null) {
        event = AnnounceRequestMessage.RequestEvent.NONE;
      }
      TrackedTorrent torrent = myTorrentsRepository.getTorrent(announceRequest.getHexInfoHash());
  
      // The requested torrent must be announced by the tracker if and only if myAcceptForeignTorrents is false
      if (!myAcceptForeignTorrents && torrent == null) {
        logger.warn("Requested torrent hash was: {}", announceRequest.getHexInfoHash());
        serveError(Status.BAD_REQUEST, ErrorMessage.FailureReason.UNKNOWN_TORRENT, requestHandler);
        return;
      }
  
      final boolean isSeeder = (event == AnnounceRequestMessage.RequestEvent.COMPLETED)
              || (announceRequest.getLeft() == 0);
  
      if (myAddressChecker.isBadAddress(announceRequest.getIp())) {
        if (torrent == null) {
          writeEmptyResponse(announceRequest, requestHandler);
        } else {
          writeAnnounceResponse(torrent, null, isSeeder, requestHandler);
        }
        return;
      }
  
      final Peer peer = new Peer(announceRequest.getIp(), announceRequest.getPort());
  
      try {
        torrent = myTorrentsRepository.putIfAbsentAndUpdate(announceRequest.getHexInfoHash(),
                new TrackedTorrent(announceRequest.getInfoHash()),
                event,
                ByteBuffer.wrap(announceRequest.getPeerId()),
                announceRequest.getHexPeerId(),
                announceRequest.getIp(),
                announceRequest.getPort(),
                announceRequest.getUploaded(),
                announceRequest.getDownloaded(),
                announceRequest.getLeft());
      } catch (IllegalArgumentException iae) {
        LoggerUtils.warnAndDebugDetails(logger, "Unable to update peer torrent. Request url is {}", uri, iae);
        serveError(Status.BAD_REQUEST, ErrorMessage.FailureReason.INVALID_EVENT, requestHandler);
        return;
      }
  
      // Craft and output the answer
      writeAnnounceResponse(torrent, peer, isSeeder, requestHandler);
    }