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.37,1.38 ms


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/msn2/libmsn2 msn_core.C,1.37,1.38 msn_core.h,1.11,1.12
Date: Thu, 20 Mar 2003 04:10:15 -0500

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

Modified Files:
        msn_core.C msn_core.h 
Log Message:
fix cancel of incoming file transfers


Index: msn_core.C
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn_core.C,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- msn_core.C  20 Mar 2003 00:32:03 -0000      1.37
+++ msn_core.C  20 Mar 2003 09:10:12 -0000      1.38
@@ -1142,16 +1142,10 @@
 void msn_filetrans_cancel(invitation_ftp * inv)
 {
   llist *l;
-  int inv_is_out=0;
-  for(l=inv->conn->invitations_out; l && l->data; l=l->next) {
-         if (inv == l->data)
-                 inv_is_out=1;
-  }
-  if(inv_is_out)
-       inv->cancelled = 1;
-  else {
-       write(inv->conn->sock, "CCL\r\n", 5);
-  }
+
+  if (!inv)
+         return;
+  inv->cancelled = 1;
 }
 
 void msn_filetrans_cancel_clean(invitation_ftp *inv) 
@@ -1222,6 +1216,16 @@
       auth->num_ignore=3;
     }
 
+    
+    if (auth->inv->cancelled) {
+           write(conn->sock,"CCL\r\n",5);
+           if(DEBUG) printf("Cancelling reception\n");
+           ext_filetrans_failed((invitation_ftp *)auth->inv, 0, "Connection 
dropped");
+           msn_del_from_llist(auth->inv->conn->invitations_in, auth->inv);
+            msn_clean_up(conn);
+           return;
+    }
+    
 #ifndef __MINGW32__
     struct pollfd pfd;
 #endif
@@ -1270,7 +1274,9 @@
       }
       if(auth->bytes_done%2045==0) { auth->num_ignore=3; }
       if(auth->bytes_done%1024==0) 
-        ext_filetrans_progress(auth->inv, "Receiving file", auth->bytes_done, 
auth->inv->filesize);      
+        ext_filetrans_progress(auth->inv, "Receiving file", auth->bytes_done, 
auth->inv->filesize);
+      if(auth->bytes_done%8192==0) /* force getting out of loop to be able to 
do something else */
+             return;
     }
 
   } else {
@@ -1429,9 +1435,10 @@
 
           if(auth->bytes_done==auth->inv->filesize)
           {
-            ext_filetrans_success(auth->inv);
-
-            msn_del_from_llist(auth->inv->conn->invitations_in, auth->inv);
+           if(auth->inv) {
+                   ext_filetrans_success(auth->inv);
+                   msn_del_from_llist(auth->inv->conn->invitations_in, 
auth->inv);
+           }
             msn_clean_up(conn);
             return;
           }

Index: msn_core.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/msn2/libmsn2/msn_core.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- msn_core.h  20 Mar 2003 00:18:09 -0000      1.11
+++ msn_core.h  20 Mar 2003 09:10:12 -0000      1.12
@@ -136,7 +136,7 @@
   char * cookie;
   char * other_user;
   msnconn * conn;
-
+  
   invitation() { cookie=other_user=NULL; }
   ~invitation() { if(cookie!=NULL) { delete cookie; } if(other_user!=NULL) { 
delete other_user; } }
 };





reply via email to

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