@@ -67,11 +67,6 @@ - (id)initWithAddress:(NSData *)anAddress
67
67
return self;
68
68
}
69
69
70
- - (void )dealloc
71
- {
72
- dispatch_release (_messageProcessingQueue);
73
- }
74
-
75
70
- (BOOL )isNewRunOfClient : (LoggerConnection *)aConnection
76
71
{
77
72
// Try to detect if a connection is a new run of an older, disconnected session
@@ -126,16 +121,16 @@ - (BOOL)isNewRunOfClient:(LoggerConnection *)aConnection
126
121
if (addrSize == sizeof (struct sockaddr_in))
127
122
{
128
123
struct sockaddr_in addra, addrb;
129
- [_clientAddress getBytes: &addra];
130
- [aConnection.clientAddress getBytes: &addrb];
124
+ [_clientAddress getBytes: &addra length: addrSize ];
125
+ [aConnection.clientAddress getBytes: &addrb length: MIN ([aConnection.clientAddress length ], sizeof (addrb)) ];
131
126
if (memcmp (&addra.sin_addr , &addrb.sin_addr , sizeof (addra.sin_addr )))
132
127
return NO ;
133
128
}
134
129
else if (addrSize == sizeof (struct sockaddr_in6))
135
130
{
136
131
struct sockaddr_in6 addr6a, addr6b;
137
- [_clientAddress getBytes: &addr6a];
138
- [aConnection.clientAddress getBytes: &addr6b];
132
+ [_clientAddress getBytes: &addr6a length: addrSize ];
133
+ [aConnection.clientAddress getBytes: &addr6b length: MIN ([aConnection.clientAddress length ], sizeof (addr6b)) ];
139
134
if (memcmp (&addr6a.sin6_addr , &addr6b.sin6_addr , sizeof (addr6a.sin6_addr )))
140
135
return NO ;
141
136
}
@@ -205,7 +200,6 @@ - (void)clearMessages
205
200
{
206
201
// Clear the backlog of _messages, only keeping the top (client info) message
207
202
// This MUST be called on the _messageProcessingQueue
208
- assert (dispatch_get_current_queue () == _messageProcessingQueue);
209
203
if (![_messages count ])
210
204
return ;
211
205
0 commit comments