Revision: 28595
          http://sourceforge.net/p/bibdesk/svn/28595
Author:   hofman
Date:     2024-01-11 18:08:55 +0000 (Thu, 11 Jan 2024)
Log Message:
-----------
Make sure cookie does not become invalid, no need to pass operation in delegate 
methods

Modified Paths:
--------------
    trunk/bibdesk/BDSKISIGroupServer.m
    trunk/bibdesk/BDSKSoapBinding.h
    trunk/bibdesk/BDSKSoapBinding.m

Modified: trunk/bibdesk/BDSKISIGroupServer.m
===================================================================
--- trunk/bibdesk/BDSKISIGroupServer.m  2024-01-11 17:58:35 UTC (rev 28594)
+++ trunk/bibdesk/BDSKISIGroupServer.m  2024-01-11 18:08:55 UTC (rev 28595)
@@ -319,9 +319,10 @@
     }
 }
 
-- (void)operation:(BDSKSoapBindingOperation *)anOperation 
completedWithResponse:(NSArray *)response error:(NSError *)error {
+- (void)soapOperationCompletedWithResponse:(NSArray *)response error:(NSError 
*)error {
     
-    // calling release may make the operation and response invalid
+    // clearing the operation may make the cookies invalid
+    id cookie = [[[operation binding] cookies] firstObject];
     operation = nil;
     
     id result = nil;
@@ -339,7 +340,7 @@
         
         if (result) {
             // if we reach this point the only session cookie should be the SID
-            sessionCookie = [[[anOperation binding] cookies] firstObject];
+            sessionCookie = cookie;
             if (needsReset) {
                 // the server was changed during the authentication, wait for 
a new search action
                 state = BDSKWOKStateIdle;
@@ -390,7 +391,7 @@
     }
 }
 
-- (NSWindow *)operationWindowForAuthenticationSheet:(BDSKSoapBindingOperation 
*)anOperation {
+- (NSWindow *)soapOperationWindowForAuthenticationSheet {
     return [group windowForSheetForObject:self];
     
 }

Modified: trunk/bibdesk/BDSKSoapBinding.h
===================================================================
--- trunk/bibdesk/BDSKSoapBinding.h     2024-01-11 17:58:35 UTC (rev 28594)
+++ trunk/bibdesk/BDSKSoapBinding.h     2024-01-11 18:08:55 UTC (rev 28595)
@@ -5,9 +5,9 @@
 @class BDSKDownload;
 
 @protocol BDSKSoapBindingOperationDelegate <NSObject>
-- (void)operation:(BDSKSoapBindingOperation *)operation 
completedWithResponse:(NSArray *)response error:(NSError *)error;
+- (void)soapOperationCompletedWithResponse:(NSArray *)response error:(NSError 
*)error;
 @optional
-- (NSWindow *)operationWindowForAuthenticationSheet:(BDSKSoapBindingOperation 
*)anOperation;
+- (NSWindow *)soapOperationWindowForAuthenticationSheet;
 @end
 
 @interface BDSKSoapBinding : NSObject {

Modified: trunk/bibdesk/BDSKSoapBinding.m
===================================================================
--- trunk/bibdesk/BDSKSoapBinding.m     2024-01-11 17:58:35 UTC (rev 28594)
+++ trunk/bibdesk/BDSKSoapBinding.m     2024-01-11 18:08:55 UTC (rev 28595)
@@ -203,7 +203,7 @@
        } else {
         NSWindow *window = nil;
         if  ([delegate 
respondsToSelector:@selector(operationWindowForAuthenticationSheet:)]){
-            window = [delegate operationWindowForAuthenticationSheet:self];
+            window = [delegate soapOperationWindowForAuthenticationSheet];
         }
         [[BDSKAuthenticationHandler sharedHandler] 
startAuthentication:challenge window:window 
completionHandler:completionHandler];
        }
@@ -250,7 +250,7 @@
             // ignore explict cancellation of the connection or the 
authentication
             // we call ourselves with a more detailed error in that case, and 
we should not call this twice
             complete = YES;
-            [delegate operation:self completedWithResponse:nil error:error];
+            [delegate soapOperationCompletedWithResponse:nil error:error];
         }
         return;
     }
@@ -272,7 +272,7 @@
                        error = [NSError 
errorWithDomain:@"BDSKSoapBindingResponseXML" code:1 userInfo:userInfo];
             
             complete = YES;
-            [delegate operation:self completedWithResponse:nil error:error];
+            [delegate soapOperationCompletedWithResponse:nil error:error];
                } else {
             NSMutableArray *responseBodyParts = nil;
                        NSXMLElement *node = [doc rootElement];
@@ -304,7 +304,7 @@
                        }
             
             complete = YES;
-            [delegate operation:self completedWithResponse:responseBodyParts 
error:nil];
+            [delegate soapOperationCompletedWithResponse:responseBodyParts 
error:nil];
                }
        }
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to