Changeset 14461

Show
Ignore:
Timestamp:
06/23/08 18:03:46 (13 months ago)
Author:
lyokato
Message:

lang/objective-c/Atompub: applied a patch

Location:
lang/objective-c/Atompub/trunk/Classes
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-c/Atompub/trunk/Classes/AtompubClient.m

    r14442 r14461  
    5757} 
    5858 
    59 - (id)delegate { 
     59- (NSObject <AtompubClientDelegate> *)delegate { 
    6060  return [ [ delegate retain ] autorelease ] ; 
    6161} 
    6262 
    63 - (void)setDelegate:(id)target { 
     63- (void)setDelegate:(NSObject <AtompubClientDelegate> *)target { 
    6464  [ target retain ]; 
    6565  [ delegate release ]; 
     
    144144      //break; 
    145145  } 
    146   connection = [ [ NSURLConnection alloc ] initWithRequest:request 
    147                                                   delegate:self ]; 
     146 
    148147  [ self startConnectionWithRequest:request 
    149148                               mode:mode ]; 
     
    361360  switch (mode) { 
    362361 
    363     GettingService: 
     362  case GettingService: 
    364363      NSLog(@"Got service"); 
    365364      [ self handleResponseWithType:@"application/atomsvc+xml" 
     
    367366                              class:[ AtomService class ] ]; 
    368367      break; 
    369     GettingCategories: 
     368  case GettingCategories: 
    370369      NSLog(@"Got categories"); 
    371370      [ self handleResponseWithType:@"application/atomcat+xml" 
     
    373372                              class:[ AtomCategories class ] ]; 
    374373      break; 
    375     GettingFeed: 
     374  case GettingFeed: 
    376375      NSLog(@"Got feed"); 
    377376      [ self handleResponseWithType:@"application/atom+xml;type=feed" 
     
    379378                              class:[ AtomFeed class ] ]; 
    380379      break; 
    381     GettingEntry: 
     380  case GettingEntry: 
    382381      NSLog(@"Got entry"); 
    383382      [ self handleResponseForGettingEntry ]; 
    384383      break; 
    385     GettingMedia: 
     384  case GettingMedia: 
    386385      NSLog(@"Got media"); 
    387386      [ self handleResponseForGettingMedia ]; 
    388387      break; 
    389     PostingEntry: 
     388  case PostingEntry: 
    390389      NSLog(@"Posted entry"); 
    391390      [ self handleResponseForPostingResourceWithDispatcher: 
    392391        @selector(clientDidCreateEntry:withLocation:) ]; 
    393392      break; 
    394     PostingMedia: 
     393  case PostingMedia: 
    395394      NSLog(@"Posted media"); 
    396395      [ self handleResponseForPostingResourceWithDispatcher: 
    397396        @selector(clientDidCreateMediaLinkEntry:withLocation:) ]; 
    398397      break; 
    399     PuttingEntry: 
     398  case PuttingEntry: 
    400399      NSLog(@"Putted entry"); 
    401400      [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 
    402401        @selector(clientDidUpdateEntry) ]; 
    403402      break; 
    404     PuttingMedia: 
     403  case PuttingMedia: 
    405404      NSLog(@"Putted media"); 
    406405      [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 
    407406        @selector(clientDidUpdateMedia) ]; 
    408407      break; 
    409     DeletingEntry: 
     408  case DeletingEntry: 
    410409      NSLog(@"Deleted entry"); 
    411410      [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 
    412411        @selector(clientDidDeleteEntry) ]; 
    413412      break; 
    414     DeletingMedia: 
     413  case DeletingMedia: 
    415414      NSLog(@"Deleted media"); 
    416415      [ self handleResponseForPuttingOrDeletingResourceWithDispatcher: 
  • lang/objective-c/Atompub/trunk/Classes/W3CDTF.m

    r13814 r14461  
    8383 
    8484+ (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; 
    8990} 
    9091 
  • lang/objective-c/Atompub/trunk/Classes/WSSEUsernameToken.m

    r13814 r14461  
    2323  } 
    2424  [ crypto setClearTextWithString:nonce ]; 
    25   NSString *base64nonce = [ [ crypto clearTextAsData ] encodeBase64WithNewLine:NO ]; 
     25  NSString *base64nonce = [ [ crypto clearTextAsData ] encodeBase64WithNewlines:NO ]; 
    2626  if (timestamp == nil) { 
    2727    timestamp = [ NSDate date ]; 
     
    3030  NSString *combined = [ NSString stringWithFormat:@"%@%@%@", nonce, created, password ]; 
    3131  [ crypto setClearTextWithString:combined ]; 
    32   NSString *passwordDigest = [ [crypto digest:@"SHA-1" ] encodeBase64WithNewLine:NO ]; 
     32  NSString *passwordDigest = [ [crypto digest:@"SHA1" ] encodeBase64WithNewlines:NO ]; 
    3333  [ crypto release ]; 
    3434  return [ NSString stringWithFormat:@"UsernameToken Username=\"%@\", PasswordDigest=\"%@\", Nonce=\"%@\", Created=\"%@\"",