Merge branch 'master' of github.com:hanzz/libtransport
This commit is contained in:
commit
b8dc29b0a8
5 changed files with 16 additions and 54 deletions
|
@ -108,7 +108,7 @@ else()
|
|||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ADD_DEFINITIONS(-O0)
|
||||
ADD_DEFINITIONS(-O3)
|
||||
ADD_DEFINITIONS(-ggdb)
|
||||
ADD_DEFINITIONS(-DDEBUG)
|
||||
ADD_DEFINITIONS(-Wall)
|
||||
|
|
|
@ -169,6 +169,11 @@ process_link(GString *ret,
|
|||
return c;
|
||||
}
|
||||
|
||||
static gboolean ft_ui_ready(void *data) {
|
||||
purple_xfer_ui_ready((PurpleXfer *) data);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static char *
|
||||
spectrum_markup_linkify(const char *text)
|
||||
{
|
||||
|
@ -863,7 +868,8 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
|
|||
tmp.swap(m_waitingXfers);
|
||||
|
||||
BOOST_FOREACH(PurpleXfer *xfer, tmp) {
|
||||
purple_xfer_ui_ready(xfer);
|
||||
purple_timeout_add(1, ft_ui_ready, xfer);
|
||||
// purple_xfer_ui_ready(xfer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1365,11 +1371,6 @@ static void fileSendStart(PurpleXfer *xfer) {
|
|||
// repeater->fileSendStart();
|
||||
}
|
||||
|
||||
static gboolean ft_ui_ready(void *data) {
|
||||
purple_xfer_ui_ready((PurpleXfer *) data);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void fileRecvStart(PurpleXfer *xfer) {
|
||||
// FiletransferRepeater *repeater = (FiletransferRepeater *) xfer->ui_data;
|
||||
// repeater->fileRecvStart();
|
||||
|
@ -1385,7 +1386,10 @@ static void newXfer(PurpleXfer *xfer) {
|
|||
if (pos != std::string::npos)
|
||||
w.erase((int) pos, w.length() - (int) pos);
|
||||
|
||||
xfer->ui_data = (void *) new FTData;
|
||||
FTData *ftdata = new FTData;
|
||||
ftdata->paused = false;
|
||||
ftdata->id = 0;
|
||||
xfer->ui_data = (void *) ftdata;
|
||||
|
||||
np->m_unhandledXfers[np->m_accounts[account] + filename + w] = xfer;
|
||||
|
||||
|
@ -1408,7 +1412,9 @@ static void XferSendComplete(PurpleXfer *xfer) {
|
|||
static gssize XferWrite(PurpleXfer *xfer, const guchar *buffer, gssize size) {
|
||||
FTData *ftData = (FTData *) xfer->ui_data;
|
||||
std::string data((const char *) buffer, (size_t) size);
|
||||
if (ftData->paused) {
|
||||
// std::cout << "xferwrite\n";
|
||||
if (!ftData->paused) {
|
||||
// std::cout << "adding xfer to waitingXfers queue\n";
|
||||
np->m_waitingXfers.push_back(xfer);
|
||||
}
|
||||
np->handleFTData(ftData->id, data);
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Remko Tronçon
|
||||
* Licensed under the GNU General Public License v3.
|
||||
* See Documentation/Licenses/GPLv3.txt for more information.
|
||||
*/
|
||||
|
||||
#include <Swiften/Network/DummyConnectionFactory.h>
|
||||
#include <Swiften/Network/DummyConnection.h>
|
||||
|
||||
namespace Swift {
|
||||
|
||||
DummyConnectionFactory::DummyConnectionFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {
|
||||
}
|
||||
|
||||
boost::shared_ptr<Connection> DummyConnectionFactory::createConnection() {
|
||||
return boost::shared_ptr<Connection>(new DummyConnection(eventLoop));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Remko Tronçon
|
||||
* Licensed under the GNU General Public License v3.
|
||||
* See Documentation/Licenses/GPLv3.txt for more information.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
|
||||
#include <Swiften/Network/ConnectionFactory.h>
|
||||
#include <Swiften/Network/DummyConnection.h>
|
||||
|
||||
namespace Swift {
|
||||
class DummyConnection;
|
||||
|
||||
class DummyConnectionFactory : public ConnectionFactory {
|
||||
public:
|
||||
DummyConnectionFactory(EventLoop* eventLoop);
|
||||
|
||||
virtual boost::shared_ptr<Connection> createConnection();
|
||||
|
||||
private:
|
||||
EventLoop* eventLoop;
|
||||
};
|
||||
}
|
|
@ -73,6 +73,7 @@ boost::shared_ptr<std::vector<unsigned char> > MemoryReadBytestream::read(size_t
|
|||
}
|
||||
|
||||
bool MemoryReadBytestream::isFinished() const {
|
||||
// std::cout << "finished? " << m_finished << "\n";
|
||||
return m_finished;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue