ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/msn2/libmsn2 msn_core.C,1.18,1.19


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/msn2/libmsn2 msn_core.C,1.18,1.19
Date: Sun, 26 Jan 2003 17:29:39 -0500

Update of /cvsroot/ayttm/ayttm/modules/msn2/libmsn2
In directory subversions:/tmp/cvs-serv15498/modules/msn2/libmsn2

Modified Files:
        msn_core.C 
Log Message:
spec debug for msn


Index: msn_core.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn_core.C,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- msn_core.C  21 Jan 2003 13:22:22 -0000      1.18
+++ msn_core.C  26 Jan 2003 22:29:16 -0000      1.19
@@ -36,7 +36,8 @@
 struct timeval zerotime = {0,0};
 #endif
 
-// #define DEBUG 1
+extern int do_msn_debug;
+#define DEBUG do_msn_debug
 
 // Define all those extern'ed variables in msn_core.h:
 llist * connections=NULL;
@@ -205,14 +206,18 @@
 void msn_add_to_list(msnconn * conn, char * list, char * username)
 {
   sprintf(buf, "ADD %d %s %s %s\r\n", next_trid++, list, username, username);
+if(DEBUG)
   printf("%s\n",buf);
+
   write(conn->sock, buf, strlen(buf));
 }
 
 void msn_del_from_list(msnconn * conn, char * list, char * username)
 {
   sprintf(buf, "REM %d %s %s\r\n", next_trid++, list, username);
+if(DEBUG)
   printf("%s\n",buf);
+  
   write(conn->sock, buf, strlen(buf));
 }
 
@@ -392,9 +397,9 @@
     int is_on_al=0;
 
     contact = (userdata *)list->data;
-#ifdef DEBUG    
+if(DEBUG)    
     printf("checking if %s is on AL\n",contact->username);
-#endif    
+    
     for(olist=info->al; olist != NULL && olist->data != NULL; 
olist=olist->next) {
       ocontact = (userdata *)olist->data;
       if(!strcasecmp(ocontact->username, contact->username))
@@ -403,9 +408,9 @@
          break;
     }
     if (!is_on_al) {
-#ifdef DEBUG    
+if(DEBUG)    
        printf("  adding %s to AL\n",contact->username);
-#endif
+
        msn_add_to_list(conn, "AL", contact->username);
     }
     list=list->next;
@@ -424,7 +429,9 @@
       while(olist!=NULL)
       {
         ocontact=(userdata *)olist->data;
+if(DEBUG)
         printf("Comparing %s to %s\n", ocontact->username, fcontact->username);
+
         if(!strcasecmp(ocontact->username, fcontact->username))
         {
           is_on_list=1;
@@ -761,22 +768,22 @@
     msn_show_verbose_error(conn, atoi(args[0]));
     if(conn->type==CONN_SB)
     {
-      #ifdef DEBUG
+      if(DEBUG)
       printf("As it is a Switchboard connection, terminating on error.\n");
-      #endif
+      
       msn_clean_up(conn);
     }
     return;
   }
 
-  #ifdef DEBUG
-  printf("Don't know what to do with this one, ignoring it:\n"); // DEBUG
-  for(int a=0; a<numargs; a++)
-  {
-    printf("%s ", args[a]);
-  }
-  printf("\n");
-  #endif
+  if(DEBUG) {
+    printf("Don't know what to do with this one, ignoring it:\n"); // DEBUG
+    for(int a=0; a<numargs; a++)
+    {
+      printf("%s ", args[a]);
+    }
+    printf("\n");
+  }  
 }
 
 void msn_handle_MSG(msnconn * conn, char ** args, int numargs)
@@ -820,9 +827,9 @@
          delete msg; 
          return; 
   }
-  #ifdef DEBUG
-  printf("Content type: \"%s\"\n", content);
-  #endif
+  if(DEBUG)
+    printf("Content type: \"%s\"\n", content);
+  
   if((tmp=strstr(content, "; charset"))!=NULL) { *tmp='\0'; }
 
   if(!strcmp(content, "text/plain"))
@@ -858,9 +865,9 @@
   } else if(!strcmp(content, "text/x-msmsgsinvite")) {
     msn_handle_invite(conn, args[1], msn_decode_URL(args[2]), mime, body);
   } else {
-    #ifdef DEBUG
-    printf("Unknown content-type: \"%s\"\n", content);
-    #endif
+    if(DEBUG)
+      printf("Unknown content-type: \"%s\"\n", content);
+    
   }
   delete content;
   free(msg);
@@ -921,7 +928,9 @@
     { if(!inv_is_out) { l=conn->invitations_out; inv_is_out=1; continue; } 
else { break; } }
     inv=(invitation *)l->data;
     if(inv) {
+if(DEBUG)
     printf("invitation: checking %s against %s\n", inv->cookie, cookie);
+
     if(!strcmp(inv->cookie, cookie))
     { break ; }
     }
@@ -939,7 +948,9 @@
 
     if(!inv_is_out && inv->app==APP_FTP)
     {
+if(DEBUG)
       printf("Downloading file from remote host..\n");
+
       msn_recv_file((invitation_ftp *)inv, body);
     } else if(inv_is_out && inv->app==APP_FTP) {
       msn_send_file((invitation_ftp *)inv, body);
@@ -1069,9 +1080,9 @@
 {
   authdata_FTP * auth=(authdata_FTP *)conn->auth;
 
-  #ifdef DEBUG
+  if(DEBUG)
   printf("Incoming from file sender\n");
-  #endif
+  
 
   if(auth->direction==MSNFTP_RECV)
   {
@@ -1461,7 +1472,9 @@
   if (numargs == 7) return; /* group add */    
   if(!strcmp(args[2], "RL"))
   {
+if(DEBUG)
     printf("Via ADD:\n");
+
     ext_new_RL_entry(conn, args[4], msn_decode_URL(args[5]));
   }
 
@@ -1543,6 +1556,7 @@
    msn_send_IM(inv->conn, NULL, msg);
    delete msg;
 
+if(DEBUG)
    printf("Rejecting file transfer\n");
 
    msn_del_from_llist(inv->conn->invitations_in, inv);
@@ -1561,7 +1575,9 @@
    msn_send_IM(inv->conn, NULL, msg);
    delete msg;
 
+if(DEBUG)
    printf("Accepting file transfer\n");
+
 }
 
 void msn_filetrans_cancel(invitation_ftp * inv)
@@ -1692,9 +1708,9 @@
 
   ext_register_sock(conn->sock, 1, 0);
 
-  #ifdef DEBUG
+  if(DEBUG)
   printf("Connected\n"); // DEBUG
-  #endif
+  
 
   sprintf(buf, "VER %d MSNP7\r\n", next_trid);
   write(conn->sock, buf, strlen(buf));
@@ -1828,7 +1844,9 @@
 
 void msn_add_group(msnconn *conn, char *newgroup) {
        if (newgroup == NULL) {
+               if(DEBUG)
                printf("Groupname is null !\n");
+
                return;
        }
 
@@ -1839,7 +1857,9 @@
 
 void msn_change_group(msnconn *conn, char *handle, char *oldgroup, char 
*newgroup) {
        if (newgroup == NULL) {
+if(DEBUG)
                printf("Group doesn't exist !\n");
+
                return;
        }
        sprintf(buf, "ADD %d FL %s %s %s\r\n", next_trid, handle, handle, 
newgroup);
@@ -1854,7 +1874,9 @@
 
 void msn_del_group(msnconn *conn, char *group_id) {
        if (group_id == NULL) {
+if(DEBUG)
                printf("Group_id is null !\n");
+
                return;
        }
 
@@ -1865,7 +1887,9 @@
 
 void msn_rename_group(msnconn *conn, char *id, char *newname) {
        if (newname == NULL || id == NULL) {
+if(DEBUG)
                printf("Groupname or ID is null !\n");
+
                return;
        }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]