mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-06 02:02:30 +00:00
* Moved PF_LOCAL to rak/socket_address.h and made it portable.
* Added "d." to '{create,delete}_link', and marked the old names as
obsolete.
* Added "d.{get,set}_message'.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@962 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -63,13 +63,18 @@ class socket_address_inet6;
|
||||
class socket_address {
|
||||
public:
|
||||
static const sa_family_t af_inet = AF_INET;
|
||||
static const int pf_inet = PF_INET;
|
||||
static const sa_family_t af_inet6 = AF_INET6;
|
||||
static const int pf_inet6 = PF_INET6;
|
||||
static const sa_family_t af_unspec = AF_UNSPEC;
|
||||
static const int pf_unspec = PF_UNSPEC;
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
static const sa_family_t af_local = AF_LOCAL;
|
||||
static const int pf_local = PF_LOCAL;
|
||||
#else
|
||||
static const sa_family_t af_local = AF_UNIX;
|
||||
static const itn pf_local = PF_UNIX;
|
||||
#endif
|
||||
|
||||
bool is_valid() const;
|
||||
|
||||
+11
-1
@@ -294,9 +294,12 @@ t_multicall(core::Download* download, const torrent::Object& rawArgs) {
|
||||
#define ADD_CD_F_VOID(key, slot) \
|
||||
ADD_CD_SLOT_PUBLIC("d." key, call_unknown, rpc::object_void_d_fn(slot), "i:", "")
|
||||
|
||||
#define ADD_CD_LIST(key, slot) \
|
||||
#define ADD_CD_LIST_OBSOLETE(key, slot) \
|
||||
ADD_CD_SLOT_PUBLIC(key, call_list, slot, "i:", "")
|
||||
|
||||
#define ADD_CD_LIST(key, slot) \
|
||||
ADD_CD_SLOT_PUBLIC("d." key, call_list, slot, "i:", "")
|
||||
|
||||
#define ADD_CD_VARIABLE_VALUE(key, firstKey, secondKey) \
|
||||
ADD_CD_SLOT_PUBLIC("d.get_" key, call_unknown, rpc::get_variable_d_fn(firstKey, secondKey), "i:", ""); \
|
||||
ADD_CD_SLOT("d.set_" key, call_value, rpc::set_variable_d_fn(firstKey, secondKey), "i:i", "");
|
||||
@@ -346,6 +349,9 @@ initialize_command_download() {
|
||||
ADD_CD_VOID("base_filename", &retrieve_d_base_filename);
|
||||
ADD_CD_STRING_UNI("name", rak::on(std::mem_fun(&core::Download::download), std::mem_fun(&torrent::Download::name)));
|
||||
|
||||
ADD_CD_LIST_OBSOLETE("create_link", rak::bind_ptr_fn(&apply_d_change_link, 0));
|
||||
ADD_CD_LIST_OBSOLETE("delete_link", rak::bind_ptr_fn(&apply_d_change_link, 1));
|
||||
|
||||
ADD_CD_LIST("create_link", rak::bind_ptr_fn(&apply_d_change_link, 0));
|
||||
ADD_CD_LIST("delete_link", rak::bind_ptr_fn(&apply_d_change_link, 1));
|
||||
ADD_CD_V_VOID("delete_tied", &apply_d_delete_tied);
|
||||
@@ -391,6 +397,10 @@ initialize_command_download() {
|
||||
|
||||
ADD_CD_STRING_BI("connection_current", std::ptr_fun(&apply_d_connection_type), std::ptr_fun(&retrieve_d_connection_type));
|
||||
|
||||
// This command really needs to be improved, so we have proper
|
||||
// logging support.
|
||||
ADD_CD_STRING_BI("message", std::mem_fun(&core::Download::set_message), std::mem_fun(&core::Download::message));
|
||||
|
||||
add_copy_to_download("get_connection_leech", "d.get_connection_leech");
|
||||
add_copy_to_download("set_connection_leech", "d.set_connection_leech");
|
||||
add_copy_to_download("get_connection_seed", "d.get_connection_seed");
|
||||
|
||||
@@ -130,17 +130,17 @@ SocketFd::get_error() const {
|
||||
|
||||
bool
|
||||
SocketFd::open_stream() {
|
||||
return (m_fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) != -1;
|
||||
return (m_fd = socket(rak::socket_address::pf_inet, SOCK_STREAM, IPPROTO_TCP)) != -1;
|
||||
}
|
||||
|
||||
bool
|
||||
SocketFd::open_datagram() {
|
||||
return (m_fd = socket(PF_INET, SOCK_DGRAM, 0)) != -1;
|
||||
return (m_fd = socket(rak::socket_address::pf_inet, SOCK_DGRAM, 0)) != -1;
|
||||
}
|
||||
|
||||
bool
|
||||
SocketFd::open_local() {
|
||||
return (m_fd = socket(PF_LOCAL, SOCK_STREAM, 0)) != -1;
|
||||
return (m_fd = socket(rak::socket_address::pf_local, SOCK_STREAM, 0)) != -1;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user