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

Commit 19b3b6e7 authored by Mike Yu's avatar Mike Yu Committed by Automerger Merge Worker
Browse files

Don't use Fwmark to rename threads am: cb902c94 am: 79dbcde3

Change-Id: I3f1e6ad2667d22dbdb817bcb1b0ddda87b04fb57
parents c2d5e84f 79dbcde3
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -37,11 +37,13 @@


namespace android {
namespace android {


using android::base::StringPrintf;
using android::net::NetworkDnsEventReported;
using android::net::NetworkDnsEventReported;
using netdutils::DumpWriter;
using netdutils::DumpWriter;
using netdutils::IPAddress;
using netdutils::IPAddress;
using netdutils::IPPrefix;
using netdutils::IPPrefix;
using netdutils::ScopedAddrinfo;
using netdutils::ScopedAddrinfo;
using netdutils::setThreadName;


namespace net {
namespace net {


@@ -64,7 +66,7 @@ void Dns64Configuration::startPrefixDiscovery(unsigned netId) {


    // Note that capturing |cfg| in this lambda creates a copy.
    // Note that capturing |cfg| in this lambda creates a copy.
    std::thread discovery_thread([this, cfg, netId] {
    std::thread discovery_thread([this, cfg, netId] {
        netdutils::setThreadName(android::base::StringPrintf("Nat64Pfx_%u", netId).c_str());
        setThreadName(StringPrintf("Nat64Pfx_%u", netId).c_str());


        // Make a mutable copy rather than mark the whole lambda mutable.
        // Make a mutable copy rather than mark the whole lambda mutable.
        // No particular reason.
        // No particular reason.
+3 −3
Original line number Original line Diff line number Diff line
@@ -49,9 +49,11 @@


namespace android {
namespace android {


using base::StringPrintf;
using netdutils::enableSockopt;
using netdutils::enableSockopt;
using netdutils::enableTcpKeepAlives;
using netdutils::enableTcpKeepAlives;
using netdutils::isOk;
using netdutils::isOk;
using netdutils::setThreadName;
using netdutils::Slice;
using netdutils::Slice;
using netdutils::Status;
using netdutils::Status;


@@ -321,9 +323,7 @@ void DnsTlsSocket::loop() {
    std::deque<std::vector<uint8_t>> q;
    std::deque<std::vector<uint8_t>> q;
    const int timeout_msecs = DnsTlsSocket::kIdleTimeout.count() * 1000;
    const int timeout_msecs = DnsTlsSocket::kIdleTimeout.count() * 1000;


    Fwmark mark;
    setThreadName(StringPrintf("TlsListen_%u", mMark & 0xffff).c_str());
    mark.intValue = mMark;
    netdutils::setThreadName(android::base::StringPrintf("TlsListen_%u", mark.netId).c_str());
    while (true) {
    while (true) {
        // poll() ignores negative fds
        // poll() ignores negative fds
        struct pollfd fds[2] = { { .fd = -1 }, { .fd = -1 } };
        struct pollfd fds[2] = { { .fd = -1 }, { .fd = -1 } };
+4 −4
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@


#include "DnsTlsTransport.h"
#include "DnsTlsTransport.h"


#include <Fwmark.h>
#include <android-base/logging.h>
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
#include <android-base/stringprintf.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
@@ -28,6 +27,9 @@
#include "DnsTlsSocketFactory.h"
#include "DnsTlsSocketFactory.h"
#include "IDnsTlsSocketFactory.h"
#include "IDnsTlsSocketFactory.h"


using android::base::StringPrintf;
using android::netdutils::setThreadName;

namespace android {
namespace android {
namespace net {
namespace net {


@@ -112,9 +114,7 @@ void DnsTlsTransport::onClosed() {


void DnsTlsTransport::doReconnect() {
void DnsTlsTransport::doReconnect() {
    std::lock_guard guard(mLock);
    std::lock_guard guard(mLock);
    Fwmark mark;
    setThreadName(StringPrintf("TlsReconn_%u", mMark & 0xffff).c_str());
    mark.intValue = mMark;
    netdutils::setThreadName(android::base::StringPrintf("TlsReconn_%u", mark.netId).c_str());
    if (mClosing) {
    if (mClosing) {
        return;
        return;
    }
    }
+3 −1
Original line number Original line Diff line number Diff line
@@ -31,6 +31,8 @@
#include "resolv_cache.h"
#include "resolv_cache.h"
#include "util.h"
#include "util.h"


using android::base::StringPrintf;
using android::netdutils::setThreadName;
using std::chrono::milliseconds;
using std::chrono::milliseconds;


namespace android {
namespace android {
@@ -180,7 +182,7 @@ void PrivateDnsConfiguration::validatePrivateDnsProvider(const DnsTlsServer& ser


    // Note that capturing |server| and |netId| in this lambda create copies.
    // Note that capturing |server| and |netId| in this lambda create copies.
    std::thread validate_thread([this, server, netId, mark] {
    std::thread validate_thread([this, server, netId, mark] {
        netdutils::setThreadName(android::base::StringPrintf("TlsVerify_%u", netId).c_str());
        setThreadName(StringPrintf("TlsVerify_%u", netId).c_str());


        // cat /proc/sys/net/ipv4/tcp_syn_retries yields "6".
        // cat /proc/sys/net/ipv4/tcp_syn_retries yields "6".
        //
        //