Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 983f02ec authored by Bernie Innocenti's avatar Bernie Innocenti
Browse files

Remove the obsolete res_state typedef

Change-Id: Ia6b623628e8b2a5799246280198e20c950c30093
parent 8e42b2cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ std::list<DnsTlsServer> DnsTlsDispatcher::getOrderedAndUsableServerList(
}

DnsTlsTransport::Response DnsTlsDispatcher::query(const std::list<DnsTlsServer>& tlsServers,
                                                  res_state statp, const Slice query,
                                                  ResState* statp, const Slice query,
                                                  const Slice ans, int* resplen) {
    const std::list<DnsTlsServer> servers(
            getOrderedAndUsableServerList(tlsServers, statp->netid, statp->_mark));
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class DnsTlsDispatcher : public PrivateDnsValidationObserver {
    // The order in which servers from |tlsServers| are queried may not be the
    // order passed in by the caller.
    DnsTlsTransport::Response query(const std::list<DnsTlsServer>& tlsServers,
                                    res_state _Nonnull statp, const netdutils::Slice query,
                                    ResState* _Nonnull statp, const netdutils::Slice query,
                                    const netdutils::Slice ans, int* _Nonnull resplen);

    // Given a |query|, sends it to the server on the network indicated by |mark|,
+9 −9
Original line number Diff line number Diff line
@@ -151,9 +151,9 @@ static bool files_getaddrinfo(const size_t netid, const char* name, const addrin
                              addrinfo** res);
static int _find_src_addr(const struct sockaddr*, struct sockaddr*, unsigned, uid_t);

static int res_queryN(const char* name, res_target* target, res_state res, int* herrno);
static int res_searchN(const char* name, res_target* target, res_state res, int* herrno);
static int res_querydomainN(const char* name, const char* domain, res_target* target, res_state res,
static int res_queryN(const char* name, res_target* target, ResState* res, int* herrno);
static int res_searchN(const char* name, res_target* target, ResState* res, int* herrno);
static int res_querydomainN(const char* name, const char* domain, res_target* target, ResState* res,
                            int* herrno);

const char* const ai_errlist[] = {
@@ -1609,7 +1609,7 @@ struct QueryResult {
    NetworkDnsEventReported event;
};

QueryResult doQuery(const char* name, res_target* t, res_state res,
QueryResult doQuery(const char* name, res_target* t, ResState* res,
                    std::chrono::milliseconds sleepTimeMs) {
    HEADER* hp = (HEADER*)(void*)t->answer.data();

@@ -1674,7 +1674,7 @@ QueryResult doQuery(const char* name, res_target* t, res_state res,

}  // namespace

static int res_queryN_parallel(const char* name, res_target* target, res_state res, int* herrno) {
static int res_queryN_parallel(const char* name, res_target* target, ResState* res, int* herrno) {
    std::vector<std::future<QueryResult>> results;
    results.reserve(2);
    std::chrono::milliseconds sleepTimeMs{};
@@ -1713,7 +1713,7 @@ static int res_queryN_parallel(const char* name, res_target* target, res_state r
    return ancount;
}

static int res_queryN_wrapper(const char* name, res_target* target, res_state res, int* herrno) {
static int res_queryN_wrapper(const char* name, res_target* target, ResState* res, int* herrno) {
    const bool parallel_lookup =
            android::net::Experiments::getInstance()->getFlag("parallel_lookup_release", 1);
    if (parallel_lookup) return res_queryN_parallel(name, target, res, herrno);
@@ -1731,7 +1731,7 @@ static int res_queryN_wrapper(const char* name, res_target* target, res_state re
 *
 * Caller must parse answer and determine whether it answers the question.
 */
static int res_queryN(const char* name, res_target* target, res_state res, int* herrno) {
static int res_queryN(const char* name, res_target* target, ResState* res, int* herrno) {
    uint8_t buf[MAXPACKET];
    int n;
    struct res_target* t;
@@ -1807,7 +1807,7 @@ static int res_queryN(const char* name, res_target* target, res_state res, int*
 * If enabled, implement search rules until answer or unrecoverable failure
 * is detected.  Error code, if any, is left in *herrno.
 */
static int res_searchN(const char* name, res_target* target, res_state res, int* herrno) {
static int res_searchN(const char* name, res_target* target, ResState* res, int* herrno) {
    const char* cp;
    HEADER* hp;
    uint32_t dots;
@@ -1924,7 +1924,7 @@ static int res_searchN(const char* name, res_target* target, res_state res, int*

// Perform a call on res_query on the concatenation of name and domain,
// removing a trailing dot from name if domain is NULL.
static int res_querydomainN(const char* name, const char* domain, res_target* target, res_state res,
static int res_querydomainN(const char* name, const char* domain, res_target* target, ResState* res,
                            int* herrno) {
    char nbuf[MAXDNAME];
    const char* longname = nbuf;
+2 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@

#include "res_comp.h"
#include "res_debug.h"
#include "resolv_private.h"  // res_state
#include "resolv_private.h"  // ResState*

// Queries will be padded to a multiple of this length when EDNS0 is active.
constexpr uint16_t kEdns0Padding = 128;
@@ -191,7 +191,7 @@ int res_nmkquery(int op, // opcode of query
    return (cp - buf);
}

int res_nopt(res_state statp, int n0, /* current offset in buffer */
int res_nopt(ResState* statp, int n0, /* current offset in buffer */
             uint8_t* buf,            /* buffer to put query */
             int buflen,              /* size of buffer */
             int anslen)              /* UDP answer buffer size */
+3 −3
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@
 *
 * Caller must parse answer and determine whether it answers the question.
 */
int res_nquery(res_state statp, const char* name,  // domain name
int res_nquery(ResState* statp, const char* name,  // domain name
               int cl, int type,                   // class and type of query
               uint8_t* answer,                    // buffer to put answer
               int anslen,                         // size of answer buffer
@@ -201,7 +201,7 @@ again:
 * If enabled, implement search rules until answer or unrecoverable failure
 * is detected.  Error code, if any, is left in *herrno.
 */
int res_nsearch(res_state statp, const char* name, /* domain name */
int res_nsearch(ResState* statp, const char* name, /* domain name */
                int cl, int type,                  /* class and type of query */
                uint8_t* answer,                   /* buffer to put answer */
                int anslen,                        /* size of answer */
@@ -325,7 +325,7 @@ int res_nsearch(res_state statp, const char* name, /* domain name */
 * Perform a call on res_query on the concatenation of name and domain,
 * removing a trailing dot from name if domain is NULL.
 */
int res_nquerydomain(res_state statp, const char* name, const char* domain, int cl,
int res_nquerydomain(ResState* statp, const char* name, const char* domain, int cl,
                     int type,        /* class and type of query */
                     uint8_t* answer, /* buffer to put answer */
                     int anslen,      /* size of answer */
Loading