Changeset 14461
- Timestamp:
- 06/23/08 18:03:46 (5 months ago)
- Location:
- lang/objective-c/Atompub/trunk/Classes
- Files:
-
- 3 modified
-
AtompubClient.m (modified) (6 diffs)
-
W3CDTF.m (modified) (1 diff)
-
WSSEUsernameToken.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-c/Atompub/trunk/Classes/AtompubClient.m
r14442 r14461 57 57 } 58 58 59 - ( id)delegate {59 - (NSObject <AtompubClientDelegate> *)delegate { 60 60 return [ [ delegate retain ] autorelease ] ; 61 61 } 62 62 63 - (void)setDelegate:( id)target {63 - (void)setDelegate:(NSObject <AtompubClientDelegate> *)target { 64 64 [ target retain ]; 65 65 [ delegate release ]; … … 144 144 //break; 145 145 } 146 connection = [ [ NSURLConnection alloc ] initWithRequest:request 147 delegate:self ]; 146 148 147 [ self startConnectionWithRequest:request 149 148 mode:mode ]; … … 361 360 switch (mode) { 362 361 363 GettingService:362 case GettingService: 364 363 NSLog(@"Got service"); 365 364 [ self handleResponseWithType:@"application/atomsvc+xml" … … 367 366 class:[ AtomService class ] ]; 368 367 break; 369 GettingCategories:368 case GettingCategories: 370 369 NSLog(@"Got categories"); 371 370 [ self handleResponseWithType:@"application/atomcat+xml" … … 373 372 class:[ AtomCategories class ] ]; 374 373 break; 375 GettingFeed:374 case GettingFeed: 376 375 NSLog(@"Got feed"); 377 376 [ self handleResponseWithType:@"application/atom+xml;type=feed" … … 379 378 class:[ AtomFeed class ] ]; 380 379 break; 381 GettingEntry:380 case GettingEntry: 382 381 NSLog(@"Got entry"); 383 382 [ self handleResponseForGettingEntry ]; 384 383 break; 385 GettingMedia:384 case GettingMedia: 386 385 NSLog(@"Got media"); 387 386 [ self handleResponseForGettingMedia ]; 388 387 break; 389 PostingEntry:388 case PostingEntry: 390 389 NSLog(@"Posted entry"); 391 390 [ self handleResponseForPostingResourceWithDispatcher: 392 391 @selector(clientDidCreateEntry:withLocation:) ]; 393 392 break; 394 PostingMedia:393 case PostingMedia: 395 394 NSLog(@"Posted media"); 396 395 [ self handleResponseForPostingResourceWithDispatcher: 397 396 @selector(clientDidCreateMediaLinkEntry:withLocation:) ]; 398 397 break; 399 PuttingEntry:398 case PuttingEntry: 400 399 NSLog(@"Putted entry"); 401 400 [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 402 401 @selector(clientDidUpdateEntry) ]; 403 402 break; 404 PuttingMedia:403 case PuttingMedia: 405 404 NSLog(@"Putted media"); 406 405 [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 407 406 @selector(clientDidUpdateMedia) ]; 408 407 break; 409 DeletingEntry:408 case DeletingEntry: 410 409 NSLog(@"Deleted entry"); 411 410 [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 412 411 @selector(clientDidDeleteEntry) ]; 413 412 break; 414 DeletingMedia:413 case DeletingMedia: 415 414 NSLog(@"Deleted media"); 416 415 [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: -
lang/objective-c/Atompub/trunk/Classes/W3CDTF.m
r13814 r14461 83 83 84 84 + (NSString *)stringFromDate:(NSDate *)date { 85 NSDateFormatter *formatter 86 = [ [ NSDateFormatter alloc ] initWithDateFormat:@"%Y-%m-%dT%H:%M:%S%z" 87 allowNaturalLanguage:NO ]; 88 return [ formatter stringFromDate:date ]; 85 NSTimeZone *utc = [ NSTimeZone timeZoneWithName: @"UTC" ]; 86 NSString *created = [ date descriptionWithCalendarFormat:@"%Y-%m-%dT%H:%M:%SZ" 87 timeZone:utc 88 locale:nil ]; 89 return created; 89 90 } 90 91 -
lang/objective-c/Atompub/trunk/Classes/WSSEUsernameToken.m
r13814 r14461 23 23 } 24 24 [ crypto setClearTextWithString:nonce ]; 25 NSString *base64nonce = [ [ crypto clearTextAsData ] encodeBase64WithNew Line:NO ];25 NSString *base64nonce = [ [ crypto clearTextAsData ] encodeBase64WithNewlines:NO ]; 26 26 if (timestamp == nil) { 27 27 timestamp = [ NSDate date ]; … … 30 30 NSString *combined = [ NSString stringWithFormat:@"%@%@%@", nonce, created, password ]; 31 31 [ crypto setClearTextWithString:combined ]; 32 NSString *passwordDigest = [ [crypto digest:@"SHA -1" ] encodeBase64WithNewLine:NO ];32 NSString *passwordDigest = [ [crypto digest:@"SHA1" ] encodeBase64WithNewlines:NO ]; 33 33 [ crypto release ]; 34 34 return [ NSString stringWithFormat:@"UsernameToken Username=\"%@\", PasswordDigest=\"%@\", Nonce=\"%@\", Created=\"%@\"",
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)