File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 2929@implementation NGHttpStringHeaderFieldParser
3030
3131- (id )parseValue : (id )_data ofHeaderField : (NSString *)_field {
32- unsigned len = 0 ;
33- const unsigned char *src = NULL ;
34- id value = nil ;
35- NSString *str = nil ;
32+ unsigned len = 0 ;
33+ const unsigned char *src = NULL ;
34+ id value = nil ;
35+ NSString *str = nil ;
3636
3737 if ([_data isKindOfClass: [NSData class ]]) {
3838 len = [_data length ];
@@ -341,8 +341,14 @@ - (void)dealloc {
341341- (id )parseValuePart : (const char *)_bytes length : (unsigned )_len
342342 zone : (NSZone *)_z
343343{
344- NGHttpCookie *cookie = nil ;
344+ NGHttpCookie *cookie = nil ;
345345 unsigned pos, toGo;
346+
347+ if (_bytes == NULL ) {
348+ NSLog (@" ERROR(%s :%i ): got `nil` value for cookie pair: %u " ,
349+ __PRETTY_FUNCTION__, __LINE__, _len);
350+ return nil ;
351+ }
346352
347353 for (pos = 0 , toGo = _len; (toGo > 0 ) && (_bytes[pos] != ' =' ); toGo--, pos++)
348354 ;
@@ -438,9 +444,9 @@ - (id)parseValue:(id)_data ofHeaderField:(NSString *)_field {
438444 else
439445 s = _data;
440446
441- NSLog (@" ERROR(%s :%i ): got invalid cookie pairs for field %@ data %@ ." ,
447+ NSLog (@" ERROR(%s :%i ): got invalid cookie pairs for field ' %@ ' data ' %@ ', class= %@ ." ,
442448 __PRETTY_FUNCTION__, __LINE__,
443- _field, s);
449+ _field, s != nil ? @" <nil> " : s, [_data class ] );
444450 RELEASE (s);
445451#endif
446452 // return nil;
Original file line number Diff line number Diff line change @@ -704,7 +704,7 @@ - (void)performExpirationCheck:(NSTimer *)_timer {
704704 if ([self isRefusingNewSessions ] &&
705705 ([self activeSessionsCount ] < [self minimumActiveSessionsCount ])) {
706706 /* check whether the application instance is still valid .. */
707- [self debugWithFormat :
707+ [self logWithFormat :
708708 @" application terminates because it refuses new sessions and "
709709 @" the active session count (%i ) is below the minimum (%i )." ,
710710 [self activeSessionsCount ], [self minimumActiveSessionsCount ]];
@@ -1209,7 +1209,7 @@ - (BOOL)shouldTerminate {
12091209}
12101210
12111211- (void )terminate {
1212- [self debugWithFormat :
1212+ [self logWithFormat :
12131213 @" application terminates:\n "
12141214 @" %i active sessions\n "
12151215 @" %i minimum active sessions\n "
You can’t perform that action at this time.
0 commit comments