mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 12:42:31 +00:00
Moved main thread object to libtorrent.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
|
||||
#include <torrent/poll.h>
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/utils/thread_base.h>
|
||||
|
||||
#include "control.h"
|
||||
|
||||
@@ -69,22 +70,22 @@ CurlSocket::receive_socket(void* easy_handle, curl_socket_t fd, int what, void*
|
||||
|
||||
if (socket == NULL) {
|
||||
socket = stack->new_socket(fd);
|
||||
main_thread->poll()->open(socket);
|
||||
torrent::main_thread()->poll()->open(socket);
|
||||
|
||||
// No interface for libcurl to signal when it's interested in error events.
|
||||
// Assume that hence it must always be interested in them.
|
||||
main_thread->poll()->insert_error(socket);
|
||||
torrent::main_thread()->poll()->insert_error(socket);
|
||||
}
|
||||
|
||||
if (what == CURL_POLL_NONE || what == CURL_POLL_OUT)
|
||||
main_thread->poll()->remove_read(socket);
|
||||
torrent::main_thread()->poll()->remove_read(socket);
|
||||
else
|
||||
main_thread->poll()->insert_read(socket);
|
||||
torrent::main_thread()->poll()->insert_read(socket);
|
||||
|
||||
if (what == CURL_POLL_NONE || what == CURL_POLL_IN)
|
||||
main_thread->poll()->remove_write(socket);
|
||||
torrent::main_thread()->poll()->remove_write(socket);
|
||||
else
|
||||
main_thread->poll()->insert_write(socket);
|
||||
torrent::main_thread()->poll()->insert_write(socket);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -99,7 +100,7 @@ CurlSocket::close() {
|
||||
if (m_fileDesc == -1)
|
||||
throw torrent::internal_error("CurlSocket::close() m_fileDesc == -1.");
|
||||
|
||||
main_thread->poll()->closed(this);
|
||||
torrent::main_thread()->poll()->closed(this);
|
||||
m_fileDesc = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user