Changeset - 1db5be3db8cf
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-10-17 21:26:13
hanzz.k@gmail.com
Working libpurple FT again
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -1700,6 +1700,7 @@ static void spectrum_sigchld_handler(int sig)
 
}
 

	
 
static void transportDataReceived(gpointer data, gint source, PurpleInputCondition cond) {
 
	if (cond & PURPLE_INPUT_READ) {
 
		char buffer[65535];
 
		char *ptr = buffer;
 
		ssize_t n = read(source, ptr, sizeof(buffer));
 
@@ -1710,6 +1711,10 @@ static void transportDataReceived(gpointer data, gint source, PurpleInputConditi
 
		std::string d = std::string(buffer, n);
 
		np->handleDataRead(d);
 
	}
 
	else {
 
		np->readyForData();
 
	}
 
}
 

	
 
int main(int argc, char **argv) {
 
	GError *error = NULL;
 
@@ -1821,6 +1826,7 @@ int main(int argc, char **argv) {
 
		fcntl(m_sock, F_SETFL, flags);
 

	
 
		purple_input_add(m_sock, PURPLE_INPUT_READ, &transportDataReceived, NULL);
 
		purple_input_add(m_sock, PURPLE_INPUT_WRITE, &transportDataReceived, NULL);
 

	
 
		np = new SpectrumNetworkPlugin(host, port);
 
		bool libev = KEYFILE_STRING("service", "eventloop") == "libev";
0 comments (0 inline, 0 general)