qulogic/pidgin

Drop extra code from servconn.
draft msnp21
2014-12-23, Elliott Sales de Andrade
3f51b551eacf
Parents fd6f3126d8c1
Children ad294805c5c2
Drop extra code from servconn.
--- a/libpurple/protocols/msn/servconn.c Tue Dec 23 00:52:38 2014 -0500
+++ b/libpurple/protocols/msn/servconn.c Tue Dec 23 02:33:03 2014 -0500
@@ -52,13 +52,9 @@
servconn->num = session->servconns_count++;
- servconn->tx_buf = purple_circ_buffer_new(MSN_BUF_LEN);
- servconn->tx_handler = 0;
servconn->timeout_sec = 0;
servconn->timeout_handle = 0;
- servconn->fd = -1;
-
return servconn;
}
@@ -83,9 +79,6 @@
g_free(servconn->host);
- purple_circ_buffer_destroy(servconn->tx_buf);
- if (servconn->tx_handler > 0)
- purple_input_remove(servconn->tx_handler);
if (servconn->timeout_handle > 0)
purple_timeout_remove(servconn->timeout_handle);
@@ -210,21 +203,6 @@
{
g_return_if_fail(servconn != NULL);
- if (servconn->connect_data != NULL)
- {
- purple_proxy_connect_cancel(servconn->connect_data);
- servconn->connect_data = NULL;
- }
-
- if (!servconn->connected)
- {
- /* We could not connect. */
- if (servconn->disconnect_cb != NULL)
- servconn->disconnect_cb(servconn);
-
- return;
- }
-
if (servconn->disconnect_cb != NULL)
servconn->disconnect_cb(servconn);
}
@@ -345,94 +323,3 @@
g_free(old_rx_buf);
return servconn;
}
-
-#if 0
-static int
-create_listener(int port)
-{
- int fd;
- int flags;
- const int on = 1;
-
-#if 0
- struct addrinfo hints;
- struct addrinfo *c, *res;
- char port_str[5];
-
- snprintf(port_str, sizeof(port_str), "%d", port);
-
- memset(&hints, 0, sizeof(hints));
-
- hints.ai_flags = AI_PASSIVE;
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
-
- if (getaddrinfo(NULL, port_str, &hints, &res) != 0)
- {
- purple_debug_error("msn", "Could not get address info: %s.\n",
- port_str);
- return -1;
- }
-
- for (c = res; c != NULL; c = c->ai_next)
- {
- fd = socket(c->ai_family, c->ai_socktype, c->ai_protocol);
-
- if (fd < 0)
- continue;
-
- setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
-
- if (bind(fd, c->ai_addr, c->ai_addrlen) == 0)
- break;
-
- close(fd);
- }
-
- if (c == NULL)
- {
- purple_debug_error("msn", "Could not find socket: %s.\n", port_str);
- return -1;
- }
-
- freeaddrinfo(res);
-#else
- struct sockaddr_in sockin;
-
- fd = socket(AF_INET, SOCK_STREAM, 0);
-
- if (fd < 0)
- return -1;
-
- if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) != 0)
- {
- close(fd);
- return -1;
- }
-
- memset(&sockin, 0, sizeof(struct sockaddr_in));
- sockin.sin_family = AF_INET;
- sockin.sin_port = htons(port);
-
- if (bind(fd, (struct sockaddr *)&sockin, sizeof(struct sockaddr_in)) != 0)
- {
- close(fd);
- return -1;
- }
-#endif
-
- if (listen (fd, 4) != 0)
- {
- close (fd);
- return -1;
- }
-
- flags = fcntl(fd, F_GETFL);
- fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-#ifndef _WIN32
- fcntl(fd, F_SETFD, FD_CLOEXEC);
-#endif
-
- return fd;
-}
-#endif
--- a/libpurple/protocols/msn/servconn.h Tue Dec 23 00:52:38 2014 -0500
+++ b/libpurple/protocols/msn/servconn.h Tue Dec 23 02:33:03 2014 -0500
@@ -62,8 +62,6 @@
MsnSession *session; /**< The MSN session of this connection. */
MsnCmdProc *cmdproc; /**< The command processor of this connection. */
- PurpleProxyConnectData *connect_data;
-
gboolean connected; /**< A flag that states if it's connected. */
gboolean processing; /**< A flag that states if something is working
with this connection. */
@@ -75,9 +73,6 @@
MsnHttpConn *httpconn; /**< The HTTP connection this connection should use. */
- int fd; /**< The connection's file descriptor. */
- int inpa; /**< The connection's input handler. */
-
char *rx_buf; /**< The receive buffer. */
int rx_len; /**< The receive buffer lenght. */
@@ -85,8 +80,6 @@
It's only set when we've received a command that
has a payload. */
- PurpleCircBuffer *tx_buf;
- guint tx_handler;
guint timeout_sec;
guint timeout_handle;