Remove deprecated rak::socket_address.

This commit is contained in:
Jari Sundell
2025-09-17 14:44:54 +02:00
committed by GitHub
parent 677f8f45c8
commit e7a80c7b18
13 changed files with 100 additions and 905 deletions
+2 -11
View File
@@ -6,7 +6,6 @@
#include <cstdio>
#include <sstream>
#include <iomanip>
#include <rak/socket_address.h>
#include <torrent/exceptions.h>
#include <torrent/connection_manager.h>
#include <torrent/rate.h>
@@ -31,7 +30,7 @@
namespace display {
char*
print_string(char* first, char* last, char* str) {
print_string(char* first, char* last, const char* str) {
if (first == last)
return first;
@@ -80,17 +79,9 @@ print_ddmmyyyy(char* first, char* last, time_t t) {
return print_buffer(first, last, "%02u/%02u/%04u", u->tm_mday, (u->tm_mon + 1), (1900 + u->tm_year));
}
char*
print_address(char* first, char* last, const rak::socket_address* sa) {
if (!sa->address_c_str(first, last - first))
return first;
return std::find(first, last, '\0');
}
inline char*
print_address(char* first, char* last, const sockaddr* sa) {
return print_address(first, last, rak::socket_address::cast_from(sa));
return print_string(first, last, torrent::sa_addr_str(sa).c_str());
}
char*
+3 -3
View File
@@ -1,10 +1,10 @@
#include "config.h"
#include <stdexcept>
#include <rak/socket_address.h>
#include <torrent/rate.h>
#include <torrent/data/block_transfer.h>
#include <torrent/data/piece.h>
#include <torrent/net/socket_address.h>
#include <torrent/peer/client_list.h>
#include <torrent/peer/peer_info.h>
@@ -63,7 +63,7 @@ WindowPeerList::redraw() {
x = 0;
std::string ip_address = rak::socket_address::cast_from(p->address())->address_str();
auto ip_address = torrent::sa_addr_str(p->address());
if (ip_address.size() >= 24) {
ip_address.replace(ip_address.begin() + 21, ip_address.end(), "...");
@@ -92,7 +92,7 @@ WindowPeerList::redraw() {
peerType = 'u';
else if (p->peer_info()->is_preferred())
peerType = 'p';
else
else
peerType = ' ';
m_canvas->print(x, y, "%c%c/%c%c/%c%c",