/*
 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
 *
 * Squid software is distributed under GPLv2+ license and includes
 * contributions from numerous individuals and organizations.
 * Please see the COPYING and CONTRIBUTORS files for details.
 */

/* DEBUG: section 85    Client-side Request Routines */

#include "Store.h"

StoreEntry *
ClientHttpRequest::storeEntry() const
{
    return entry_;
}

MemObject *
ClientHttpRequest::memObject() const
{
    if (storeEntry())
        return storeEntry()->mem_obj;

    return NULL;
}

ConnStateData *
ClientHttpRequest::getConn() const
{
    if (!cbdataReferenceValid(conn_))
        return NULL;

    return conn_;
}

void
ClientHttpRequest::setConn(ConnStateData * aConn)
{
    assert (conn_ == NULL || aConn == NULL);

    if (conn_)
        cbdataReferenceDone(conn_);

    conn_ = cbdataReference(aConn);
}

StoreEntry *
ClientHttpRequest::loggingEntry() const
{
    return loggingEntry_;
}

