[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.62,1.63
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.62,1.63 |
Date: |
Fri, 28 Feb 2003 05:51:49 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/msn2
In directory subversions:/tmp/cvs-serv6869/modules/msn2
Modified Files:
msn.C
Log Message:
implement msn non-blocking connections
Index: msn.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/msn.C,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- msn.C 21 Feb 2003 08:51:40 -0000 1.62
+++ msn.C 28 Feb 2003 10:51:46 -0000 1.63
@@ -75,6 +75,8 @@
#include "add_contact_window.h"
#include "prefs.h"
#include "offline_queue_mgmt.h"
+#include "tcp_util.h"
+
#include <glib.h>
#ifdef __MINGW32__
#define snprintf g_snprintf
@@ -562,7 +564,7 @@
eb_msn_local_account_data * mlad;
int port;
- if(account->connected!=0) {
+ if(account->connected || account->connecting) {
eb_debug(DBG_MSN, "called while already logged or logging
in\n");
return;
}
@@ -579,6 +581,12 @@
msn_init(mlad->mc, account->handle, mlad->password);
port=atoi(msn_port);
msn_connect(mlad->mc, msn_server, port);
+}
+
+void eb_msn_connected(eb_local_account * account)
+{
+ eb_msn_local_account_data * mlad;
+ mlad = (eb_msn_local_account_data
*)account->protocol_local_account_data;
if(account->status_menu)
{
/* Make sure set_current_state doesn't call us back */
@@ -595,7 +603,7 @@
eb_msn_local_account_data * mlad = (eb_msn_local_account_data
*)account->protocol_local_account_data;
LList *l;
- if(!account->connected)
+ if(!account->connected && !account->connecting)
return;
eb_debug(DBG_MSN, "Logging out\n");
for (l = msn_contacts; l != NULL && l->data != NULL; l = l->next) {
@@ -608,6 +616,7 @@
}
}
account->connected = 0;
+ account->connecting = 0;
eb_set_active_menu_status(account->status_menu, MSN_OFFLINE);
eb_debug(DBG_MSN, "mlad->mc now %p\n",mlad->mc);
if(mlad->mc)
@@ -1521,7 +1530,7 @@
{ strncpy(fname_pref, tmp, MAX_PREF_LEN); }
free(tmp);
- if(!ela->connected) {
+ if(!ela->connected && !ela->connecting) {
eb_debug(DBG_MSN,"not connected, shouldn't get it\n");
ela->connected = 1;
close_conn(conn);
@@ -1534,6 +1543,14 @@
{
LList *existing = get_all_accounts(SERVICE_INFO.protocol_id);
eb_debug(DBG_MSN, "Got the sync info!\n");
+
+ char* local_account_name=((authdata_SB *)conn->auth)->username;
+ eb_local_account *ela = find_local_account_by_handle(local_account_name,
SERVICE_INFO.protocol_id);
+ if (ela == NULL)
+ printf("ela is null ! :-s");
+ else
+ eb_msn_connected(ela);
+
if(fname_pref[0]!='\0') {
char * tmp = StrToUtf8(fname_pref);
msn_set_friendlyname(conn, tmp);
@@ -1997,6 +2014,11 @@
void ext_changed_state(msnconn * conn, char * state)
{
eb_debug(DBG_MSN, "Your state is now: %s\n", state);
+}
+
+int ext_async_socket(char *host, int port, void *cb, void *data)
+{
+ return ay_socket_new_async(host, port, (ay_socket_callback)cb, data);
}
int ext_connect_socket(char * hostname, int port)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/msn2 msn.C,1.62,1.63,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.299,1.300 configure.in,1.295,1.296
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.300,1.301 configure.in,1.296,1.297
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.299,1.300 configure.in,1.295,1.296
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.300,1.301 configure.in,1.296,1.297
- Index(es):