synchronized void requestCompleted(
            InternalHTTPConnection<InternalHTTPResponse> connectionToRelease,
            boolean success) {
        // If we've been destroyed, do nothing.
        if(connections == null)
            return;

        // LOG.log(Level.WARNING, "Packet completed (" + (success? "success":"fail") + ")");

        if(success && connectionToRelease == null)
            throw new IllegalStateException("Connection ended successfully, but without a connection");

        // If the connection doesn't support keepalive, shut down the connection, if any.
        if(connectionToRelease != null) {
            boolean shutdown = connectionToRelease.isAborted();
            if(supportsKeepAlive == null || !supportsKeepAlive)
                shutdown = true;

            // If this connection is not reusable, release it.
            if(shutdown) {
                // LOG.log(Level.WARNING, "Connection closed on server not supporting keepalive; shutting down connection");
                connectionToRelease.abort();
                connections.remove(connectionToRelease);
                connectionToRelease = null;
            }
        }
    }