Browse Source

IOS-2888 renames var. We are not using defaultCStringEncoding any more. Because its wrong most of the time and, according to Apple docs, "should be used rarely, if at all"

IOS-2888
Andreas Buff 11 months ago
parent
commit
6919ba8c9b
6 changed files with 14 additions and 14 deletions
  1. +1
    -1
      pantomime-lib/Framework/Pantomime/CWIMAPStore+Protected.m
  2. +3
    -3
      pantomime-lib/Framework/Pantomime/CWIMAPStore.m
  3. +1
    -1
      pantomime-lib/Framework/Pantomime/CWSMTP+Protected.m
  4. +7
    -7
      pantomime-lib/Framework/Pantomime/CWSMTP.m
  5. +1
    -1
      pantomime-lib/Framework/Pantomime/CWService+Protected.h
  6. +1
    -1
      pantomime-lib/Framework/Pantomime/CWService.m

+ 1
- 1
pantomime-lib/Framework/Pantomime/CWIMAPStore+Protected.m View File

@ -205,7 +205,7 @@
[self bulkWriteData:@[self.currentQueueObject.tag,
[NSData dataWithBytes: " " length: 1],
[self.currentQueueObject.arguments dataUsingEncoding: _defaultCStringEncoding],
[self.currentQueueObject.arguments dataUsingEncoding: _defaultStringEncoding],
_crlf]];
PERFORM_SELECTOR_2(_delegate, @selector(commandSent:), @"PantomimeCommandSent", [NSNumber numberWithInt: _lastCommand], @"Command");


+ 3
- 3
pantomime-lib/Framework/Pantomime/CWIMAPStore.m View File

@ -1490,7 +1490,7 @@ static inline int has_literal(char *buf, NSUInteger c)
aString = [[NSString alloc] initWithData: [[aString dataUsingEncoding: NSASCIIStringEncoding] encodeBase64WithLineLength: 0]
encoding: NSASCIIStringEncoding];
[self bulkWriteData:@[[aString dataUsingEncoding: _defaultCStringEncoding],
[self bulkWriteData:@[[aString dataUsingEncoding: _defaultStringEncoding],
_crlf]];
RELEASE(aMD5);
RELEASE(aString);
@ -1634,7 +1634,7 @@ static inline int has_literal(char *buf, NSUInteger c)
NSData *aData;
aData = [_responsesFromServer objectAtIndex: 0];
aString = [[NSString alloc] initWithData: aData encoding: _defaultCStringEncoding];
aString = [[NSString alloc] initWithData: aData encoding: _defaultStringEncoding];
[_capabilities addObjectsFromArray: [[aString substringFromIndex: 13] componentsSeparatedByString: @" "]];
RELEASE(aString);
@ -2405,7 +2405,7 @@ static inline int has_literal(char *buf, NSUInteger c)
NSUInteger len;
aString = [[NSString alloc] initWithData: [_responsesFromServer lastObject]
encoding: _defaultCStringEncoding];
encoding: _defaultStringEncoding];
if (!aString)
{


+ 1
- 1
pantomime-lib/Framework/Pantomime/CWSMTP+Protected.m View File

@ -130,7 +130,7 @@
}
_lastCommand = aQueueObject->command;
[self bulkWriteData:@[[aQueueObject->arguments
dataUsingEncoding: _defaultCStringEncoding],
dataUsingEncoding: _defaultStringEncoding],
_crlf]];
} else {
LogInfo(@"Sending with nil queue object");


+ 7
- 7
pantomime-lib/Framework/Pantomime/CWSMTP.m View File

@ -493,7 +493,7 @@ static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, B
[aMD5 computeDigest];
aString = [NSString stringWithFormat: @"%@ %@", _username, [aMD5 hmacAsStringUsingPassword: _password]];
[self bulkWriteData:@[[[aString dataUsingEncoding: _defaultCStringEncoding] encodeBase64WithLineLength: 0],
[self bulkWriteData:@[[[aString dataUsingEncoding: _defaultStringEncoding] encodeBase64WithLineLength: 0],
_crlf]];
RELEASE(aMD5);
}
@ -521,8 +521,8 @@ static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, B
{
NSString *aString;
aString = [[NSString alloc] initWithData: [[_username dataUsingEncoding: _defaultCStringEncoding] encodeBase64WithLineLength: 0]
encoding: _defaultCStringEncoding];
aString = [[NSString alloc] initWithData: [[_username dataUsingEncoding: _defaultStringEncoding] encodeBase64WithLineLength: 0]
encoding: _defaultStringEncoding];
[self sendCommand: SMTP_AUTH_LOGIN_CHALLENGE arguments: aString];
RELEASE(aString);
}
@ -546,8 +546,8 @@ static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, B
{
NSString *aString;
aString = [[NSString alloc] initWithData: [[_password dataUsingEncoding: _defaultCStringEncoding] encodeBase64WithLineLength: 0]
encoding: _defaultCStringEncoding];
aString = [[NSString alloc] initWithData: [[_password dataUsingEncoding: _defaultStringEncoding] encodeBase64WithLineLength: 0]
encoding: _defaultStringEncoding];
[self sendCommand: SMTP_AUTH_LOGIN_CHALLENGE arguments: aString];
RELEASE(aString);
@ -574,7 +574,7 @@ static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, B
if ([aData hasCPrefix: "334"]) {
NSString *stringToSend = [NSString stringWithFormat:@"\0%@\0%@", _username, _password];
NSData *dataToSend = [stringToSend dataUsingEncoding:_defaultCStringEncoding];
NSData *dataToSend = [stringToSend dataUsingEncoding:_defaultStringEncoding];
[self bulkWriteData:@[[dataToSend encodeBase64WithLineLength: 0],
_crlf]];
} else if ([aData hasCPrefix: "235"]) {
@ -730,7 +730,7 @@ static inline CWInternetAddress *next_recipient(NSMutableArray *theRecipients, B
aData = [aData subdataFromIndex: 4];
// We add it to our capabilities
[_capabilities addObject: AUTORELEASE([[NSString alloc] initWithData: aData encoding: _defaultCStringEncoding])];
[_capabilities addObject: AUTORELEASE([[NSString alloc] initWithData: aData encoding: _defaultStringEncoding])];
// Example of responses:
//


+ 1
- 1
pantomime-lib/Framework/Pantomime/CWService+Protected.h View File

@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
__block NSString *_password;
__block NSString *_name;
NSData *_crlf;
NSStringEncoding _defaultCStringEncoding;
NSStringEncoding _defaultStringEncoding;
#ifdef MACOSX
CFRunLoopSourceRef _runLoopSource;


+ 1
- 1
pantomime-lib/Framework/Pantomime/CWService.m View File

@ -67,7 +67,7 @@
self = [super init];
if (self) {
_crlf = [[NSData alloc] initWithBytes: "\r\n" length: 2];
_defaultCStringEncoding = NSUTF8StringEncoding; //[NSString defaultCStringEncoding]; //???
_defaultStringEncoding = NSUTF8StringEncoding;
_supportedMechanisms = [[CWThreadSafeArray alloc] init];
_responsesFromServer = [[CWThreadSafeArray alloc] init];


Loading…
Cancel
Save