|
From: Thomas T. <to...@us...> - 2007-06-05 00:21:21
|
Update of /cvsroot/macattrick/macattrick In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18050 Modified Files: HattrickOrg.m HattrickOrg.h Log Message: cookie handling. login error fixed Index: HattrickOrg.h =================================================================== RCS file: /cvsroot/macattrick/macattrick/HattrickOrg.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** HattrickOrg.h 27 Mar 2005 12:23:32 -0000 1.13 --- HattrickOrg.h 5 Jun 2007 00:21:17 -0000 1.14 *************** *** 44,47 **** --- 44,48 ---- NSString *loginName; NSString *password; + NSString *cookie; } *************** *** 52,55 **** --- 53,58 ---- - (NSString *) password; - (void) setPassword: (NSString *) newPassword; + - (NSString *) cookie; + - (void) setCookie: (NSString *) newCookie; Index: HattrickOrg.m =================================================================== RCS file: /cvsroot/macattrick/macattrick/HattrickOrg.m,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** HattrickOrg.m 9 Oct 2005 15:28:04 -0000 1.25 --- HattrickOrg.m 5 Jun 2007 00:21:17 -0000 1.26 *************** *** 229,232 **** --- 229,234 ---- } else { + NSString * cookieString = [[(NSHTTPURLResponse *) response allHeaderFields] objectForKey:@"Set-Cookie"]; + [self setCookie:cookieString]; [[NSFileManager defaultManager] removeFileAtPath:file handler:nil]; [data writeToFile:file atomically:YES]; *************** *** 239,245 **** --- 241,255 ---- NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: urlString ]]; [request addValue:@"Macattrick v0.8" forHTTPHeaderField:@"User-Agent"]; + [request addValue:[self cookie] forHTTPHeaderField:@"Cookie"]; return request; } + - (NSString *) cookie { return cookie; } + - (void) setCookie: (NSString *) newCookie { + [newCookie retain]; + [cookie release]; + cookie = newCookie; + } + @end |