]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/common/address_helper: remove address_helper* because it will never be called 37489/head
authorhaoyixing <haoyixing@kuaishou.com>
Wed, 30 Sep 2020 03:31:03 +0000 (11:31 +0800)
committerhaoyixing <haoyixing@kuaishou.com>
Wed, 30 Sep 2020 03:31:03 +0000 (11:31 +0800)
Signed-off-by: haoyixing <haoyixing@kuaishou.com>
src/common/CMakeLists.txt
src/common/address_helper.cc [deleted file]
src/common/address_helper.h [deleted file]

index 248379ff344b2c8232114bd6a3d61b9d1fe452bc..39bc50d41fd9efad4495774c543eb99a0a169693 100644 (file)
@@ -39,7 +39,6 @@ set(common_srcs
   TracepointProvider.cc
   TrackedOp.cc
   WorkQueue.cc
-  address_helper.cc
   admin_socket.cc
   admin_socket_client.cc
   assert.cc
diff --git a/src/common/address_helper.cc b/src/common/address_helper.cc
deleted file mode 100644 (file)
index 29f99a8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * address_helper.cc
- *
- *  Created on: Oct 27, 2013
- *      Author: matt
- */
-
-#include <netdb.h>
-#include <regex>
-
-#include "common/address_helper.h"
-
-// decode strings like "tcp://<host>:<port>"
-int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url)
-{
-       std::regex expr("(tcp|rdma)://([^:]*):([\\d]+)");
-       std::cmatch m;
-
-       if (std::regex_match(url, m, expr)) {
-               std::string host(m[2].first, m[2].second);
-               std::string port(m[3].first, m[3].second);
-               addrinfo hints;
-               // FIPS zeroization audit 20191115: this memset is fine.
-               memset(&hints, 0, sizeof(hints));
-               hints.ai_family = PF_UNSPEC;
-               addrinfo *res;
-               if (!getaddrinfo(host.c_str(), nullptr, &hints, &res)) {
-                       addr->set_sockaddr((sockaddr*)res->ai_addr);
-                       addr->set_port(std::atoi(port.c_str()));
-                       freeaddrinfo(res);
-                       return 0;
-               }
-       }
-
-       return 1;
-}
diff --git a/src/common/address_helper.h b/src/common/address_helper.h
deleted file mode 100644 (file)
index 047bd0a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation.  See file COPYING.
- *
- */
-
-#ifndef ADDRESS_HELPER_H_
-#define ADDRESS_HELPER_H_
-
-#include "msg/msg_types.h"
-
-int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url);
-
-#endif /* ADDRESS_HELPER_H_ */