Listing peers.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@252 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-02 21:51:40 +00:00
parent 5f102a5dcf
commit bd7849199c
13 changed files with 182 additions and 65 deletions
+3
View File
@@ -43,6 +43,9 @@ class CurlGet : public torrent::Http {
void perform(CURLMsg* msg);
private:
CurlGet(const CurlGet&);
void operator = (const CurlGet&);
friend size_t curl_get_receive_write(void* data, size_t size, size_t nmemb, void* handle);
std::string m_url;
+2 -2
View File
@@ -110,12 +110,12 @@ CurlStack::remove_get(CurlGet* get) {
}
void
CurlStack::global_init() {
CurlStack::init() {
curl_global_init(CURL_GLOBAL_ALL);
}
void
CurlStack::global_cleanup() {
CurlStack::cleanup() {
curl_global_cleanup();
}
+5 -2
View File
@@ -22,14 +22,17 @@ class CurlStack {
// TODO: Set fd_set's only once?
void fdset(fd_set* readfds, fd_set* writefds, fd_set* exceptfds, int* maxFd);
static void global_init();
static void global_cleanup();
static void init();
static void cleanup();
protected:
void add_get(CurlGet* get);
void remove_get(CurlGet* get);
private:
CurlStack(const CurlStack&);
void operator = (const CurlStack&);
void* m_handle;
int m_size;
+2 -2
View File
@@ -33,10 +33,10 @@ Poll::poll() {
timeval timeout = {t / 1000000, t % 1000000};
m_maxFd = select(m_maxFd, &m_readSet, &m_writeSet, &m_exceptSet, &timeout);
m_maxFd = select(m_maxFd + 1, &m_readSet, &m_writeSet, &m_exceptSet, &timeout);
if (m_maxFd >= 0)
return;
work();
else if (errno == EINTR)
m_slotSelectInterrupted();
+2 -1
View File
@@ -14,7 +14,6 @@ public:
typedef sigc::slot1<void, int> SlotInt;
void poll();
void work();
void register_http();
@@ -22,6 +21,8 @@ public:
void slot_select_interrupted(Slot s) { m_slotSelectInterrupted = s; }
private:
void work();
SlotInt m_slotReadStdin;
Slot m_slotSelectInterrupted;