author | hgs |
Tue, 02 Nov 2010 15:42:21 +0000 | |
changeset 301 | 172f33f13d7d |
parent 300 | 1d28c8722707 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// f32\sfile\sf_notifier.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include "sf_notifier.h" |
|
19 |
#include "sf_file_cache.h" |
|
20 |
||
21 |
CFsObjectCon* FsNotificationManager::iNotifyRequests = NULL; |
|
22 |
RFastLock FsNotificationManager::iChainLock; |
|
23 |
TInt FsNotificationManager::iFilterRegister[]; |
|
24 |
CFsPool<CFsNotificationBlock>* FsNotificationManager::iPool; |
|
25 |
||
26 |
||
300 | 27 |
CFsNotificationPathFilter* CFsNotificationPathFilter::NewL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum) |
0 | 28 |
{ |
29 |
CFsNotificationPathFilter* self = new (ELeave) CFsNotificationPathFilter(); |
|
30 |
CleanupStack::PushL(self); |
|
300 | 31 |
self->ConstructL(aPath,aFilename,aDriveNum); |
0 | 32 |
CleanupStack::Pop(self); |
33 |
return self; |
|
34 |
} |
|
35 |
||
300 | 36 |
void CFsNotificationPathFilter::ConstructL(const TDesC& aPath, const TDesC& aFilename, TInt aDriveNum) |
0 | 37 |
{ |
38 |
//Allocate the path and filename |
|
39 |
iPath = aPath.AllocL(); |
|
40 |
iFilename = aFilename.AllocL(); |
|
300 | 41 |
iDriveNum = aDriveNum; |
0 | 42 |
} |
43 |
||
44 |
CFsNotificationPathFilter::~CFsNotificationPathFilter() |
|
45 |
{ |
|
46 |
if(iFilename) |
|
47 |
delete iFilename; |
|
48 |
if(iPath) |
|
49 |
delete iPath; |
|
50 |
} |
|
51 |
||
52 |
CFsNotificationPathFilter::CFsNotificationPathFilter() |
|
53 |
: iPath(NULL), iFilename(NULL) |
|
54 |
{ |
|
55 |
} |
|
56 |
||
57 |
CFsNotifyRequest* CFsNotifyRequest::NewL() |
|
58 |
{ |
|
59 |
CFsNotifyRequest* self = new(ELeave) CFsNotifyRequest(); |
|
60 |
CleanupStack::PushL(self); |
|
61 |
self->ConstructL(); |
|
62 |
CleanupStack::Pop(); |
|
63 |
return self; |
|
64 |
} |
|
65 |
||
66 |
void CFsNotifyRequest::ConstructL() |
|
67 |
{ |
|
68 |
User::LeaveIfError(iClientSyncLock.CreateLocal()); |
|
69 |
User::LeaveIfError(iTailSemaphore.CreateLocal()); |
|
70 |
} |
|
71 |
||
72 |
CFsNotifyRequest::CFsNotifyRequest() |
|
73 |
{ |
|
74 |
SetActive(EInactive); |
|
75 |
} |
|
76 |
||
77 |
CFsNotifyRequest::~CFsNotifyRequest() |
|
78 |
{ |
|
79 |
__PRINT(_L("CFsNotifyRequest::~CFsNotifyRequest()")); |
|
80 |
||
81 |
RemoveFilters(); |
|
82 |
||
83 |
if(ClientMsgHandle()!=0) |
|
84 |
iClientMsg.Complete(KErrCancel); |
|
85 |
||
86 |
if(iBufferMsg.Handle()!=0) |
|
87 |
iBufferMsg.Complete(KErrCancel); |
|
88 |
||
89 |
iClientSyncLock.Close(); |
|
90 |
iTailSemaphore.Close(); |
|
91 |
} |
|
92 |
||
93 |
/* |
|
94 |
* Returns the Array of TypeFilters. |
|
95 |
* Each TFsNotificationTypeFilter matches to a particular TFsNotification::TFsNotificationType |
|
96 |
* and has a CFsNotificationFilter which stores the iPath and iName associated with this filter type. |
|
97 |
* |
|
98 |
* (These are speerated so that we can have multiple type filters for every name filter) |
|
99 |
*/ |
|
100 |
TFsNotificationTypeArray* CFsNotifyRequest::FilterTypeList(TInt aDrive,TInt aIndex) |
|
101 |
{ |
|
102 |
__ASSERT_DEBUG(aIndex < KNumRegisterableFilters,Fault(ENotificationFault)); |
|
103 |
||
104 |
TFsNotificationTypeDriveArray* filters = iDrivesTypesFiltersMap.Find(aDrive); |
|
105 |
if(filters) |
|
106 |
return &((*filters)[aIndex]); |
|
107 |
else |
|
108 |
return NULL; |
|
109 |
} |
|
110 |
||
111 |
//Sets filter's notification request status |
|
112 |
void CFsNotifyRequest::SetActive(TNotifyRequestStatus aValue) |
|
113 |
{ |
|
114 |
iNotifyRequestStatus = aValue; |
|
115 |
} |
|
116 |
||
117 |
CFsNotifyRequest::TNotifyRequestStatus CFsNotifyRequest::ActiveStatus() |
|
118 |
{ |
|
119 |
return (TNotifyRequestStatus)iNotifyRequestStatus; |
|
120 |
} |
|
121 |
||
122 |
//Completes and frees notification request |
|
123 |
//In case of KErrNone must be called with iChainLock already held |
|
124 |
void CFsNotifyRequest::CompleteClientRequest(TInt aReason,TBool aIsCancel) |
|
125 |
{ |
|
126 |
__PRINT(_L("CFsNotifyRequest::CompleteClientRequest()")); |
|
127 |
||
128 |
iClientSyncLock.Wait(); |
|
129 |
||
130 |
if(aReason==KErrNone) |
|
131 |
{ |
|
132 |
__PRINT(_L("CFsNotifyRequest::CompleteClientRequest() - Complete KErrNone")); |
|
133 |
//Synchronising the current iServerTail to the client. |
|
134 |
iClientHead = iClientTail; //Client has read all previous entries |
|
135 |
iClientTail = iServerTail; //Client's new tail is everything the server has been writing since this function was last called |
|
136 |
TInt clientTail = iClientTail; |
|
137 |
TPckg<TInt> tailDes(clientTail); |
|
138 |
iClientMsg.Write(KMsgPtr0,tailDes); |
|
139 |
} |
|
140 |
else if(aIsCancel) |
|
141 |
{ |
|
142 |
__PRINT(_L("CFsNotifyRequest::CompleteClientRequest() - Complete isCancel")); |
|
143 |
iServerTail = 0; |
|
144 |
iClientTail = 0; |
|
145 |
iClientHead = 0; |
|
146 |
TPckgBuf<TInt> tailDes(iClientTail); |
|
147 |
//Perhaps client has crashed so no point checking return: |
|
148 |
iClientMsg.Write(KMsgPtr0,tailDes); |
|
149 |
} |
|
150 |
__PRINT(_L("CFsNotifyRequest::CompleteClientRequest() - Complete Request")); |
|
151 |
iClientMsg.Complete(aReason); |
|
152 |
iClientSyncLock.Signal(); |
|
153 |
} |
|
154 |
||
155 |
TInt CFsNotifyRequest::SynchroniseBuffer(CFsNotificationBlock& aBlock,TInt aServerTail, TInt aNotificationSize) |
|
156 |
{ |
|
157 |
TPtrC8 blockDes((TText8*)aBlock.Data(),aNotificationSize); |
|
158 |
return iBufferMsg.Write(KMsgPtr0,blockDes,aServerTail); |
|
159 |
} |
|
160 |
||
161 |
//Removes all filters. |
|
162 |
//Deletes iPath, iFilename |
|
163 |
TInt CFsNotifyRequest::RemoveFilters() |
|
164 |
{ |
|
165 |
__PRINT(_L("CFsNotifyRequest::RemoveFilters()")); |
|
166 |
||
167 |
//For every drive with filters set... |
|
168 |
RHashMap<TInt,TFsNotificationTypeDriveArray>::TIter iterator(iDrivesTypesFiltersMap); |
|
169 |
TFsNotificationTypeDriveArray* currentDriveFilters = (TFsNotificationTypeDriveArray*)iterator.NextValue(); |
|
170 |
while(currentDriveFilters) |
|
171 |
{ |
|
172 |
//For every filter array (1 for each type of TFsNotificationType) |
|
173 |
for(TInt filterType = 0; filterType < KNumRegisterableFilters; filterType++) |
|
174 |
{ |
|
175 |
TFsNotificationTypeArray& filterList = (*currentDriveFilters)[filterType]; |
|
176 |
TInt filterTypeCount = filterList.Count(); |
|
177 |
if(filterTypeCount) |
|
178 |
{ |
|
179 |
//Remove this type from the filter register |
|
300 | 180 |
TFsNotification::TFsNotificationType type = CFsNotificationInfo::NotificationType(filterType); |
0 | 181 |
FsNotificationManager::SetFilterRegister(type,EFalse,filterTypeCount); |
182 |
} |
|
183 |
filterList.Reset(); |
|
184 |
filterList.Close(); |
|
185 |
} |
|
186 |
currentDriveFilters->Reset(); |
|
187 |
currentDriveFilters->Close(); |
|
188 |
iterator.RemoveCurrent(); |
|
189 |
currentDriveFilters = (TFsNotificationTypeDriveArray*)iterator.NextValue(); |
|
190 |
} |
|
191 |
iDrivesTypesFiltersMap.Close(); |
|
192 |
return KErrNone; |
|
193 |
} |
|
194 |
||
195 |
TInt CFsNotifyRequest::AddFilterL(CFsNotificationPathFilter* aFilter, TUint aMask) |
|
196 |
{ |
|
197 |
__PRINT(_L("CFsNotifyRequest::AddFilterL")); |
|
198 |
||
199 |
//Get the drive number to so know which drive array to add the filter(s) to. |
|
300 | 200 |
TInt driveNum = aFilter->iDriveNum; |
0 | 201 |
|
202 |
TInt notifyType = 1; |
|
203 |
TInt r = KErrNone; |
|
204 |
//Create/Add a TypeFilter for each type in aMask |
|
205 |
while((notifyType & KNotificationValidFiltersMask) && (aMask & KNotificationValidFiltersMask)) |
|
206 |
{ |
|
207 |
//If this notifyType is present in aMask |
|
208 |
if(aMask & notifyType) |
|
209 |
{ |
|
210 |
TFsNotificationTypeFilter typeFilter; |
|
211 |
typeFilter.iNotificationType = (TFsNotification::TFsNotificationType) notifyType; |
|
212 |
typeFilter.iPathFilter = aFilter; |
|
300 | 213 |
TInt index = CFsNotificationInfo::TypeToIndex(typeFilter.iNotificationType); |
0 | 214 |
|
215 |
//If the per-drive-filterLists have not |
|
216 |
//been set up yet then do so now. |
|
217 |
TFsNotificationTypeDriveArray* driveArray = iDrivesTypesFiltersMap.Find(driveNum); |
|
218 |
if(!driveArray) |
|
219 |
{ |
|
220 |
TFsNotificationTypeDriveArray dArray; |
|
221 |
r = iDrivesTypesFiltersMap.Insert(driveNum,dArray); |
|
222 |
User::LeaveIfError(r); |
|
223 |
driveArray = iDrivesTypesFiltersMap.Find(driveNum); |
|
224 |
||
225 |
//Create filter arrays for every type |
|
226 |
for(TInt i =0; i< KNumRegisterableFilters; i++) |
|
227 |
{ |
|
228 |
TFsNotificationTypeArray filterArray; |
|
229 |
driveArray->Append(filterArray); |
|
230 |
} |
|
231 |
} |
|
232 |
TFsNotificationTypeArray& filterArray= (*driveArray)[index]; |
|
233 |
filterArray.Append(typeFilter); |
|
234 |
||
235 |
//Remove this type from our mask |
|
236 |
//and continue |
|
237 |
aMask ^= notifyType; |
|
238 |
} |
|
239 |
notifyType <<= 1; |
|
240 |
} |
|
241 |
return r; |
|
242 |
} |
|
243 |
||
244 |
TInt CFsNotifyRequest::SetClientMessage(const RMessage2& aClientMsg) |
|
245 |
{ |
|
246 |
__PRINT(_L("CFsNotifyRequest::SetClientMessage")); |
|
247 |
iClientMsg = aClientMsg; |
|
248 |
return KErrNone; |
|
249 |
} |
|
250 |
||
251 |
TInt CFsNotifyRequest::ClientMsgHandle() |
|
252 |
{ |
|
253 |
return iClientMsg.Handle(); |
|
254 |
} |
|
255 |
||
300 | 256 |
const RMessage2& CFsNotifyRequest::BufferMessage() |
257 |
{ |
|
258 |
return iBufferMsg; |
|
259 |
} |
|
260 |
||
0 | 261 |
void CFsNotifyRequest::CloseNotification() |
262 |
{ |
|
263 |
__PRINT(_L("CFsNotifyRequest::CloseNotification()")); |
|
264 |
iBufferMsg.Complete(KErrNone); |
|
265 |
if(ClientMsgHandle()!=0) |
|
266 |
CompleteClientRequest(KErrCancel,EFalse); |
|
267 |
} |
|
268 |
||
269 |
//New notification request from client |
|
270 |
void FsNotificationManager::AddNotificationRequestL(CFsNotifyRequest* aNotificationRequest) |
|
271 |
{ |
|
272 |
__PRINT(_L("FsNotificationManager::AddNotificationRequestL")); |
|
273 |
Lock(); |
|
274 |
iNotifyRequests->AddL(aNotificationRequest,ETrue); |
|
275 |
Unlock(); |
|
276 |
} |
|
277 |
||
278 |
//Notification request cancelled |
|
279 |
//Must be called with iChainLock held |
|
280 |
void FsNotificationManager::RemoveNotificationRequest(CFsNotifyRequest* aNotificationRequest) |
|
281 |
{ |
|
282 |
__PRINT(_L("FsNotificationManager::RemoveNotificationRequest")); |
|
283 |
iNotifyRequests->Remove(aNotificationRequest,ETrue); |
|
284 |
} |
|
285 |
||
286 |
void FsNotificationManager::RemoveNotificationRequest(CSessionFs* aSession) |
|
287 |
{ |
|
288 |
__PRINT(_L("FsNotificationManager::RemoveNotificationRequest(CSessionFs*)")); |
|
289 |
||
290 |
TInt count = Count(); |
|
291 |
if(count) |
|
292 |
{ |
|
293 |
Lock(); |
|
294 |
count = Count(); //check again just incase it's changed before we got the lock |
|
295 |
if(count) |
|
296 |
{ |
|
297 |
for(TInt i=0; i < count; i++) |
|
298 |
{ |
|
299 |
//Remove all notification requests associated with this session. |
|
300 |
CFsNotifyRequest* notify = (CFsNotifyRequest*)(*iNotifyRequests)[i]; |
|
301 |
if(notify->iSession == aSession) |
|
302 |
{ |
|
303 |
RemoveNotificationRequest(notify); |
|
304 |
delete notify; |
|
305 |
} |
|
306 |
} |
|
307 |
if(!Count()) |
|
308 |
{ |
|
309 |
__PRINT(_L("FsNotificationManager::RemoveNotificationRequest(CSessionFs*) - Closing Manager")); |
|
310 |
Close(); |
|
311 |
} |
|
312 |
} |
|
313 |
Unlock(); |
|
314 |
} |
|
315 |
} |
|
316 |
||
317 |
TBool FsNotificationManager::IsInitialised() |
|
318 |
{ |
|
319 |
__PRINT(_L("FsNotificationManager::IsInitialised()")); |
|
320 |
return (TBool)iNotifyRequests; |
|
321 |
} |
|
322 |
||
323 |
void FsNotificationManager::OpenL() |
|
324 |
{ |
|
325 |
__PRINT(_L("FsNotificationManager::InitialiseL()")); |
|
326 |
if(!iNotifyRequests) |
|
327 |
{ |
|
328 |
if(iChainLock.Handle() == 0) |
|
329 |
{ |
|
330 |
User::LeaveIfError(iChainLock.CreateLocal()); |
|
331 |
} |
|
332 |
iNotifyRequests = TheContainer->CreateL(); |
|
300 | 333 |
iPool = CFsPool<CFsNotificationBlock>::New(KNotificationPoolSize,CFsNotificationBlock::New); |
0 | 334 |
User::LeaveIfNull(iPool); |
335 |
} |
|
336 |
} |
|
337 |
||
338 |
void FsNotificationManager::SetFilterRegister(TUint aFilter, TBool aAdd, TInt aCount) |
|
339 |
{ |
|
340 |
__PRINT2(_L("FsNotificationManager::SetFilterRegister(aFilter=%u,aAdd=%d)"),aFilter,aAdd); |
|
300 | 341 |
TInt index = CFsNotificationInfo::TypeToIndex((TFsNotification::TFsNotificationType)aFilter); |
0 | 342 |
TInt& fr = FsNotificationManager::FilterRegister(index); |
343 |
__ASSERT_DEBUG((aAdd) ? fr >= 0 : fr > 0,Fault(ENotificationFault)); |
|
344 |
fr+= aAdd ? aCount : -aCount; |
|
345 |
} |
|
346 |
||
347 |
void FsNotificationManager::SetFilterRegisterMask(TUint aMask,TBool aAdd) |
|
348 |
{ |
|
349 |
__PRINT(_L("FsNotificationManager::RegisterFilterMask()")); |
|
350 |
TInt notifyType = 1; |
|
351 |
||
352 |
while(notifyType & KNotificationValidFiltersMask && aMask & KNotificationValidFiltersMask) |
|
353 |
{ |
|
354 |
if(aMask & notifyType) |
|
355 |
{ |
|
356 |
SetFilterRegister(notifyType,aAdd); |
|
357 |
aMask ^= notifyType; |
|
358 |
} |
|
359 |
notifyType <<= 1; |
|
360 |
} |
|
361 |
} |
|
362 |
||
363 |
TInt& FsNotificationManager::FilterRegister(TInt aIndex) |
|
364 |
{ |
|
365 |
__PRINT(_L("FsNotificationManager::FilterRegister()")); |
|
366 |
__ASSERT_DEBUG(aIndex < KNumRegisterableFilters,Fault(ENotificationFault)); |
|
367 |
return iFilterRegister[aIndex]; |
|
368 |
} |
|
369 |
||
370 |
//Must be called with the iChainLock |
|
371 |
void FsNotificationManager::Close() |
|
372 |
{ |
|
373 |
__PRINT(_L("FsNotificationManager::Stop()")); |
|
374 |
CFsObjectCon*& request = iNotifyRequests; |
|
375 |
if(request) |
|
376 |
{ |
|
377 |
TheContainer->Delete(request); |
|
378 |
delete iPool; |
|
379 |
iPool = NULL; |
|
380 |
} |
|
381 |
request = NULL; |
|
382 |
} |
|
383 |
||
384 |
TInt FsNotificationManager::Count() |
|
385 |
{ |
|
386 |
__PRINT(_L("FsNotificationManager::Count()")); |
|
387 |
if(IsInitialised()) |
|
388 |
return iNotifyRequests->Count(); |
|
389 |
return 0; |
|
390 |
} |
|
391 |
||
392 |
void FsNotificationManager::Lock() |
|
393 |
{ |
|
394 |
__PRINT(_L("--->FsNotificationManager::Lock()")); |
|
395 |
iChainLock.Wait(); |
|
396 |
} |
|
397 |
||
398 |
void FsNotificationManager::Unlock() |
|
399 |
{ |
|
400 |
__PRINT(_L("<---FsNotificationManager::Unlock()")); |
|
401 |
iChainLock.Signal(); |
|
402 |
} |
|
403 |
||
404 |
//Get the notification type based on the TFsMessage function |
|
300 | 405 |
void CFsNotificationInfo::NotificationType(TInt aFunction,TNotificationType& aNotificationType) |
0 | 406 |
{ |
300 | 407 |
__PRINT(_L("CFsNotificationInfo::NotificationType")); |
0 | 408 |
switch(aFunction) |
409 |
{ |
|
410 |
case EFsFileWrite: |
|
411 |
case EFsFileWriteDirty: |
|
412 |
case EFsFileSetSize: |
|
413 |
{ |
|
414 |
aNotificationType = TFsNotification::EFileChange; |
|
415 |
break; |
|
416 |
} |
|
417 |
case EFsRename: |
|
418 |
case EFsFileRename: |
|
419 |
case EFsReplace: |
|
420 |
{ |
|
421 |
aNotificationType = TFsNotification::ERename; |
|
422 |
break; |
|
423 |
} |
|
424 |
case EFsMkDir: |
|
425 |
case EFsFileCreate: |
|
426 |
case EFsFileReplace: |
|
427 |
{ |
|
428 |
aNotificationType = TFsNotification::ECreate; |
|
429 |
break; |
|
430 |
} |
|
431 |
case EFsFileSetAtt: |
|
432 |
case EFsFileSet: |
|
433 |
case EFsSetEntry: |
|
434 |
{ |
|
435 |
aNotificationType = TFsNotification::EAttribute; |
|
436 |
break; |
|
437 |
} |
|
438 |
case EFsDelete: |
|
439 |
case EFsRmDir: |
|
440 |
{ |
|
441 |
aNotificationType = TFsNotification::EDelete; |
|
442 |
break; |
|
443 |
} |
|
444 |
case EFsSetVolume: |
|
445 |
{ |
|
446 |
aNotificationType = TFsNotification::EVolumeName; |
|
447 |
break; |
|
448 |
} |
|
449 |
case EFsSetDriveName: |
|
450 |
{ |
|
451 |
aNotificationType = TFsNotification::EDriveName; |
|
452 |
break; |
|
453 |
} |
|
454 |
case EFsDismountFileSystem: |
|
455 |
case EFsMountFileSystem: |
|
456 |
case EFsFormatNext: |
|
457 |
case EFsRawDiskWrite: |
|
458 |
case EFsMountFileSystemScan: |
|
459 |
{ |
|
460 |
aNotificationType = TFsNotification::EMediaChange; |
|
461 |
break; |
|
462 |
} |
|
463 |
default: |
|
464 |
{ |
|
465 |
aNotificationType = (TFsNotification::TFsNotificationType)0; |
|
466 |
break; |
|
467 |
} |
|
468 |
} |
|
469 |
} |
|
470 |
||
471 |
//=====CFsNotificationBlock============================ |
|
472 |
// Uses CFsPool |
|
473 |
||
474 |
CFsNotificationBlock* CFsNotificationBlock::New() |
|
475 |
{ |
|
476 |
return new CFsNotificationBlock(); |
|
477 |
} |
|
478 |
CFsNotificationBlock::CFsNotificationBlock() |
|
479 |
{ |
|
480 |
} |
|
481 |
CFsNotificationBlock::~CFsNotificationBlock() |
|
482 |
{ |
|
483 |
//Nothing to do here |
|
484 |
} |
|
485 |
TAny* CFsNotificationBlock::Data() |
|
486 |
{ |
|
487 |
return (TAny*)&iData; |
|
488 |
} |
|
489 |
||
490 |
||
491 |
||
492 |
||
493 |
||
494 |
TBool CFsNotifyRequest::ValidateNotification(TInt aNotificationSize, TInt& aServerTail) |
|
495 |
{ |
|
496 |
__PRINT(_L("CFsNotifyRequest::ValidateNotification")); |
|
497 |
//RDebug::Print(_L("CFsNotifyRequest::ValidateNotification - iServerTail=%d, aServerTail=%d, iClientTail=%d,iClientHead=%d, aNotificationSize=%d"),iServerTail,aServerTail,iClientTail,iClientHead,aNotificationSize); |
|
498 |
// |
|
499 |
//Start Validation |
|
500 |
// |
|
501 |
TBool overflow = EFalse; |
|
502 |
||
503 |
//Check that we have not filled the buffer |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
504 |
if (aServerTail == iClientHead) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
505 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
506 |
// Buffer is empty when Client Tail = Client Head |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
507 |
if (iClientHead != iClientTail) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
508 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
509 |
overflow = ETrue; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
510 |
return overflow; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
511 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
512 |
} |
0 | 513 |
|
514 |
//Work out remaining size taking account of whether the end position is |
|
515 |
//before or after the overflow position. |
|
516 |
TInt remainingSize = (iClientHead > aServerTail) |
|
517 |
? iClientHead - aServerTail |
|
518 |
: iClientBufferSize - (aServerTail - iClientHead); |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
519 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
520 |
TInt reservedSize = aNotificationSize; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
521 |
// + Save additional space for OVERFLOW |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
522 |
reservedSize += KNotificationHeaderSize; |
0 | 523 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
524 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
525 |
// Have we wrapped around already? |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
526 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
527 |
if (iClientHead > aServerTail) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
528 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
529 |
// Yes, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
530 |
// Buffer looks something like this: |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
531 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
532 |
// |CH |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
533 |
// [5678------1234] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
534 |
// |ST |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
535 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
536 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
537 |
// Check if we can insert in the middle section: |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
538 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
539 |
if (remainingSize < reservedSize) |
0 | 540 |
{ |
541 |
overflow = ETrue; |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
542 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
543 |
//else: |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
544 |
// { |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
545 |
// We add new notification to middle |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
546 |
// [5678***---1234] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
547 |
// } |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
548 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
549 |
return overflow; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
550 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
551 |
|
0 | 552 |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
553 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
554 |
// We have not wrapped around yet.. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
555 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
556 |
// Buffer looks something like this: |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
557 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
558 |
// |CH |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
559 |
// [--123456789--] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
560 |
// |ST |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
561 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
562 |
|
0 | 563 |
|
564 |
// |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
565 |
// Check up-front whether its possible for overflow to go at the beginning. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
566 |
// If there is not enough space at the start for overflow then we need to |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
567 |
// check that's there's space for overflow at the end and must not rollover. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
568 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
569 |
TBool canRollOver = ETrue; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
570 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
571 |
if (iClientHead < KNotificationHeaderSize) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
572 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
573 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
574 |
// |CH |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
575 |
// [123456789----] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
576 |
// |ST |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
578 |
// No space for overflow at the beginning of buffer. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
579 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
580 |
canRollOver = EFalse; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
581 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
582 |
|
0 | 583 |
// |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
584 |
// IF: Cannot rollover |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
585 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
586 |
if (!canRollOver) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
587 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
//IF (notification + overflow) does not fit at the end overflow now. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
if ((iClientBufferSize - aServerTail) < reservedSize) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
590 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
591 |
overflow = ETrue; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
592 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
593 |
//Else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
594 |
// { |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
595 |
// Add notification (**) to end [---12345678**---] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
596 |
// } |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
597 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
598 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
599 |
else |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
600 |
// Can rollover |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
601 |
// - need to check that notification fits at the end |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
602 |
// or that notification+overflow fits at the beginning. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
603 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
604 |
// If not enough space at end, rollover |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
605 |
if ((iClientBufferSize - aServerTail) < aNotificationSize) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
606 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
607 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
608 |
// Add notification to start and fill end with Filler char |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
609 |
// [----0123456789#] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
610 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
611 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
612 |
// IF we are not at the very end of the buffer, |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
613 |
// insert a KNotificationBufferFiller at iServerTail. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
614 |
// When the client reads this, it sets iHead to 0 and reads from there. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
615 |
if(iServerTail != iClientBufferSize) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
616 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
617 |
//If there is space it will always be at least 1 word big |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
618 |
TPtrC8 fillerDes((TText8*) &KNotificationBufferFiller, sizeof(TUint)); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
619 |
iBufferMsg.Write(KMsgPtr0, fillerDes, aServerTail); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
620 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
621 |
|
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
622 |
// Now that we have rolled over we need to check whether there is |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
623 |
// space at the beginning for notification + overflow |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
624 |
// We already know that overflow fits. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
625 |
if (reservedSize > iClientHead) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
626 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
627 |
// [ov--0123456789-] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
628 |
overflow = ETrue; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
629 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
631 |
// Add notification/overflow to the beginning |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
632 |
// [**--0123456789(#)] |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
633 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
634 |
aServerTail = 0; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
635 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
636 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
// else - notification fits at the end so there is nothing to do here. |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
638 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
639 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
640 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
641 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
642 |
//End Validation |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
643 |
// |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
644 |
return overflow; |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
645 |
} |
0 | 646 |
|
647 |
// Called from FsNotificationManager::HandleChange(). |
|
648 |
// Sends notifications into the client's buffer. |
|
649 |
// If there is a iClientMsg then this is the first time this |
|
650 |
// has been called since the client called RequestNotifications. |
|
651 |
// In this situation we complete the client request. |
|
300 | 652 |
TInt CFsNotifyRequest::NotifyChange(CFsNotificationInfo* aRequest, CFsNotificationBlock& aBlock) |
0 | 653 |
{ |
654 |
/* |
|
655 |
* Different notification types have different data associated with them. |
|
656 |
* |
|
657 |
* All types EXCEPT for ERename, EVolumeName and EDriveName have the following data |
|
658 |
* and are aligned in the buffer like so: |
|
659 |
* Word1 : NotificationSize (2 bytes) , PathSize (2 bytes) |
|
660 |
* Word2 : NotificationType (Lower 2 bytes) |
|
661 |
* Word(s) : Path (TText8) , [Any sub-class members] |
|
662 |
* |
|
663 |
* Else for notification types ERename, EVolumeName and EDriveName the order is: |
|
664 |
* Word1 : NotificationSize (2 bytes) , PathSize (2 bytes) |
|
665 |
* Word2 : NewNameSize (2 bytes) , NotificationType (2 bytes) |
|
666 |
* Word(s) : Path (TText8) , NewName (TText8) |
|
667 |
* |
|
668 |
* Overflow notification type doesn't have a name, so its namesize is 0 |
|
669 |
* and there will be no Word3. |
|
670 |
*/ |
|
671 |
||
672 |
__PRINT(_L("CFsNotifyRequest::NotifyChange()")); |
|
673 |
||
300 | 674 |
TInt notificationSize = CFsNotificationInfo::NotificationSize(*aRequest); |
675 |
||
0 | 676 |
iClientSyncLock.Wait(); |
677 |
iTailSemaphore.Wait(); |
|
678 |
||
679 |
TInt tail = iServerTail; |
|
680 |
||
681 |
//Validation |
|
682 |
TBool overflow = ValidateNotification(notificationSize, tail); |
|
683 |
||
684 |
//Now that we know there is enough space in the buffer we can write |
|
685 |
//the standard attributes that all notifications have. |
|
686 |
||
687 |
//We can store the size of the notification |
|
688 |
//and the size of the name in the same word. |
|
689 |
||
300 | 690 |
TBuf<2> driveBuf; |
691 |
driveBuf.SetLength(2); |
|
692 |
TChar driveLetter = 'A'; |
|
693 |
RFs::DriveToChar(aRequest->DriveNumber(),driveLetter); |
|
694 |
driveBuf[0] = (TText)driveLetter; |
|
695 |
driveBuf[1] = (TText)':'; |
|
696 |
||
0 | 697 |
TUint16 nameLen = 0; //Overflow has no name |
698 |
TInt notifSize = KNotificationHeaderSize; |
|
699 |
if(!overflow) |
|
700 |
{ |
|
300 | 701 |
nameLen = (TUint16)aRequest->SourceSize(); |
0 | 702 |
notifSize = notificationSize; |
703 |
} |
|
704 |
else |
|
705 |
{ |
|
300 | 706 |
aRequest->NotificationType() = TFsNotification::EOverflow; |
0 | 707 |
} |
708 |
||
709 |
iServerTail = tail + notifSize; |
|
710 |
iTailSemaphore.Signal(); |
|
711 |
||
712 |
TInt writeOffset = 0; //Where to write in the block |
|
713 |
||
714 |
//Store notification Size and NameSize (Word1) |
|
715 |
TUint sizeNameLen = (notifSize << 16) | nameLen; |
|
716 |
memcpy((TText8*)aBlock.Data()+writeOffset,&sizeNameLen,sizeof(TUint)); |
|
717 |
writeOffset+=sizeof(TUint); |
|
718 |
||
300 | 719 |
if (aRequest->NotificationType() == TFsNotification::ERename || |
720 |
aRequest->NotificationType() == TFsNotification::EVolumeName || |
|
721 |
aRequest->NotificationType() == TFsNotification::EDriveName) |
|
722 |
{ |
|
723 |
//Store NewNameSize and notification Type (Word2) |
|
724 |
TUint typeNewNameLen = ((TUint16)aRequest->NewNameSize() << 16) | (TUint16)aRequest->NotificationType(); |
|
0 | 725 |
memcpy((TText8*)aBlock.Data()+writeOffset,&typeNewNameLen,sizeof(TUint)); |
726 |
} |
|
727 |
else |
|
728 |
{ |
|
729 |
//Store notification Type (Word2) |
|
300 | 730 |
memcpy((TText8*)aBlock.Data()+writeOffset,&aRequest->NotificationType(),sizeof(TUint)); |
0 | 731 |
} |
732 |
writeOffset+=sizeof(TUint); |
|
733 |
||
734 |
// |
|
735 |
//Store UID |
|
300 | 736 |
memcpy((TText8*)aBlock.Data()+writeOffset,&aRequest->Uid().iUid,sizeof(TUint32)); |
0 | 737 |
writeOffset+=sizeof(TUint32); |
300 | 738 |
|
0 | 739 |
|
740 |
if(!overflow) |
|
741 |
{ |
|
742 |
//Store Name (Word3) |
|
300 | 743 |
{ |
744 |
//Store driveColon |
|
745 |
if(aRequest->NotificationType()!=TFsNotification::EMediaChange) |
|
746 |
{ |
|
747 |
memcpy((TText8*)aBlock.Data()+writeOffset,driveBuf.Ptr(),driveBuf.Size()); |
|
748 |
writeOffset += driveBuf.Size(); //NB: Not Align4'd deliberately. |
|
749 |
} |
|
750 |
memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->Source().FullName().Ptr(),aRequest->Source().FullName().Size()); |
|
751 |
writeOffset += Align4(aRequest->Source().FullName().Size()); |
|
752 |
} |
|
0 | 753 |
|
300 | 754 |
switch (aRequest->NotificationType()) |
0 | 755 |
{ |
756 |
case TFsNotification::EFileChange: |
|
300 | 757 |
case TFsNotification::EAttribute: |
0 | 758 |
{ |
300 | 759 |
memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->Data(),sizeof(TInt64)); |
0 | 760 |
writeOffset += sizeof(TInt64); |
761 |
break; |
|
762 |
} |
|
763 |
case TFsNotification::ERename: |
|
764 |
case TFsNotification::EVolumeName: |
|
765 |
case TFsNotification::EDriveName: |
|
766 |
{ |
|
767 |
//Store NewName |
|
300 | 768 |
|
769 |
if(!aRequest->DestDriveIsSet()) |
|
770 |
{ |
|
771 |
//This means that the notification has come from a Mount rather than from FileServer |
|
772 |
//It also means that the new name will have the same drive letter as the source. |
|
773 |
memcpy((TText8*)aBlock.Data()+writeOffset,driveBuf.Ptr(),driveBuf.Size()); |
|
774 |
writeOffset += driveBuf.Size(); //NB: Not Align4'd deliberately. |
|
775 |
} |
|
776 |
memcpy((TText8*)aBlock.Data()+writeOffset,aRequest->NewName().FullName().Ptr(),aRequest->NewName().FullName().Size()); |
|
777 |
writeOffset += Align4(aRequest->NewName().FullName().Size()); |
|
0 | 778 |
break; |
779 |
} |
|
300 | 780 |
|
0 | 781 |
default: |
782 |
{ |
|
783 |
break; |
|
784 |
} |
|
785 |
} |
|
786 |
} |
|
787 |
||
788 |
//Write to client buffer |
|
789 |
TInt r = SynchroniseBuffer(aBlock,tail,notifSize); |
|
790 |
||
791 |
//Signal the iClientSyncLock. |
|
792 |
//When all locks on this are signaled then CompleteClientRequest can be called. |
|
793 |
//This signal moves when we have a cache system |
|
794 |
iClientSyncLock.Signal(); |
|
795 |
||
796 |
//We need to complete if this was the first |
|
797 |
//write to the client's buffer |
|
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
798 |
if (r == KErrNone) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
799 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
800 |
//We need to complete if this was the first |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
801 |
//write to the client's buffer |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
802 |
if(ClientMsgHandle()!=0) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
803 |
{ |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
804 |
//RDebug::Print(_L("CFsNotifyRequest::NotifyChange iClientHead(%d) iClientTail(%d) iServerTail(%d) iClientBufferSize(%d)"),iClientHead,iClientTail,iServerTail,iClientBufferSize); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
805 |
__PRINT4(_L("CFsNotifyRequest::NotifyChange iClientHead(%d) iClientTail(%d) iServerTail(%d) iClientBufferSize(%d)"),iClientHead,iClientTail,iServerTail,iClientBufferSize); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
806 |
CompleteClientRequest(KErrNone); |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
807 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
808 |
else if(!overflow) |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
809 |
{ |
0 | 810 |
SetActive(CFsNotifyRequest::EOutstanding); |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
811 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
812 |
else //Overflow |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
813 |
{ |
0 | 814 |
SetActive(CFsNotifyRequest::EOutstandingOverflow); |
31
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
815 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
816 |
} |
56f325a607ea
Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
817 |
else // r!=KErrNone |
0 | 818 |
{ |
819 |
//RDebug::Print(_L("sf_notifier.cpp line %d function = %d, r = %d"),__LINE__, aRequest->FsFunction(),r); |
|
820 |
//RDebug::Print(_L("iServerTail=%d, tail=%d, iClientBufferSize=%d, overflow=%d"),iServerTail,tail,iClientBufferSize,overflow); |
|
821 |
} |
|
822 |
return r; |
|
823 |
} |
|
824 |
||
825 |
#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
826 |
||
827 |
//A change has occurred in f32 represented by this |
|
828 |
//request object. Work out which CfsNotify’s are interested |
|
829 |
// (if any) and call CfsNotifyRequest::NotifyChange. |
|
300 | 830 |
void FsNotificationManager::HandleChange(CFsNotificationInfo& aRequest) |
831 |
{ |
|
832 |
__PRINT2(_L("FsNotificationManager::HandleChange() aNotificationInfo=0x%x,NotificationType=%d"),&aRequest,aRequest.NotificationType()); |
|
833 |
if(Count()) |
|
834 |
{ |
|
835 |
Lock(); //ToDo: Read Lock (Read/Write Lock) |
|
836 |
if(Count()) |
|
837 |
{ |
|
838 |
//Only search while there are filters of this type set up. |
|
839 |
TInt index = CFsNotificationInfo::TypeToIndex(aRequest.NotificationType()); |
|
840 |
TInt& filterCount = FsNotificationManager::FilterRegister(index); |
|
841 |
TInt seenFilter = filterCount; //Number of requests set up for this type |
|
842 |
||
843 |
//Iterate CFsNotifyRequests |
|
844 |
TInt count = iNotifyRequests->Count(); |
|
845 |
||
846 |
if(aRequest.NotificationType() == TFsNotification::EMediaChange) |
|
847 |
seenFilter = count; |
|
848 |
||
849 |
//If there aren't any requests then breakout |
|
850 |
if(count == 0) |
|
851 |
{ |
|
852 |
Unlock(); |
|
853 |
return; |
|
854 |
} |
|
855 |
||
856 |
//For every notification request(i.e. every CFsNotify client-side). |
|
857 |
for(TInt i=0; i<count && seenFilter; ++i) |
|
858 |
{ |
|
859 |
CFsNotifyRequest* notifyRequest = (CFsNotifyRequest*)(*iNotifyRequests)[i]; |
|
860 |
CFsNotifyRequest::TNotifyRequestStatus status = notifyRequest->ActiveStatus(); |
|
861 |
if(! (status==CFsNotifyRequest::EActive || |
|
862 |
status==CFsNotifyRequest::EOutstanding)) |
|
863 |
{ |
|
864 |
//Not active; check next notification request |
|
865 |
continue; |
|
866 |
} |
|
867 |
||
868 |
//Check whether we are interested in this change. |
|
869 |
//Get the filters associated with this operation on this drive |
|
870 |
TFsNotificationTypeArray* filterList = notifyRequest->FilterTypeList(aRequest.DriveNumber(),index); |
|
871 |
DoHandleChange(filterList,seenFilter,aRequest,notifyRequest); |
|
0 | 872 |
|
300 | 873 |
if(aRequest.NotificationType()==TFsNotification::EMediaChange) |
874 |
continue; //next request |
|
875 |
||
876 |
//If there are still filters to check |
|
877 |
if(seenFilter) |
|
878 |
{ |
|
879 |
//Check changes that are not tied to a particular drive |
|
880 |
filterList = notifyRequest->FilterTypeList(KErrNotFound,index); |
|
881 |
DoHandleChange(filterList,seenFilter,aRequest,notifyRequest); |
|
882 |
} |
|
883 |
} |
|
884 |
} |
|
885 |
Unlock(); |
|
886 |
} |
|
887 |
} |
|
0 | 888 |
|
889 |
||
890 |
//// |
|
891 |
#else |
|
892 |
//// |
|
893 |
||
300 | 894 |
void FsNotificationManager::HandleChange(CFsNotificationInfo&) |
0 | 895 |
{ |
896 |
return; |
|
897 |
} |
|
898 |
||
899 |
#endif //SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION |
|
900 |
||
901 |
//Called from FsNotificationManager::DoHandleChange |
|
300 | 902 |
FsNotificationManager::TFsNotificationFilterMatch FsNotificationManager::DoMatchFilter(const RMessage2& aMessage, const TDesC& aOperationName,CFsNotificationPathFilter& aFilter) |
0 | 903 |
{ |
904 |
TFsNotificationFilterMatch filterMatch = EDifferent; |
|
905 |
TParsePtrC parseOp(aOperationName); |
|
300 | 906 |
|
0 | 907 |
TPtrC pathOpDes = parseOp.DriveAndPath(); |
908 |
TPtrC nameOpDes = parseOp.NameAndExt(); |
|
909 |
TInt pathLength = aFilter.iPath->Des().Length(); |
|
910 |
TInt nameLength = aFilter.iFilename->Des().Length(); |
|
911 |
TInt paths = -1; |
|
912 |
TInt names = -1; |
|
913 |
if(pathLength != 0) |
|
914 |
{ |
|
915 |
paths = pathOpDes.MatchF(aFilter.iPath->Des()); |
|
916 |
} |
|
917 |
else //if no path filter was set up |
|
918 |
// then we need to ensure we don't notify on data-caged areas which we shouldn't |
|
919 |
{ |
|
300 | 920 |
TInt r = PathCheck(aMessage,aOperationName.Mid(2),&KCapFsSysFileTemp,&KCapFsPriFileTemp,&KCapFsROFileTemp, __PLATSEC_DIAGNOSTIC_STRING("FsNotificationManager::DoHandleChange")); |
0 | 921 |
if(r != KErrNone) |
922 |
return EContinue; //next filter |
|
923 |
} |
|
924 |
||
925 |
if(nameLength != 0) |
|
926 |
{ |
|
927 |
names = nameOpDes.MatchF(aFilter.iFilename->Des()); |
|
928 |
} |
|
929 |
//Check: Path & Names Match |
|
930 |
if((paths == 0 || pathLength==0) && // paths match && |
|
931 |
(names >= 0 || (nameLength==0 && nameOpDes.Length()==0))) // names match OR there are no names (i.e. operation is a dir and no filename filter) |
|
932 |
{ |
|
933 |
filterMatch = EMatch; |
|
934 |
} |
|
935 |
return filterMatch; |
|
936 |
} |
|
937 |
||
300 | 938 |
// The aFilterTypeArray is an array for the filters that target the current drive (only). |
939 |
// This is called on a per client (CFsNotify) basis. |
|
940 |
void FsNotificationManager::DoHandleChange(TFsNotificationTypeArray* aFilterTypeArray,TInt& aSeenFilter, CFsNotificationInfo& aNotificationInfo, CFsNotifyRequest* aNotifyRequest) |
|
0 | 941 |
{ |
942 |
__PRINT(_L("FsNotificationManager::DoHandleChange()")); |
|
943 |
||
944 |
if(!aFilterTypeArray) |
|
945 |
return; |
|
946 |
||
947 |
TInt numFilters = aFilterTypeArray->Count(); |
|
948 |
||
300 | 949 |
if(aNotificationInfo.NotificationType() == TFsNotification::EMediaChange) |
950 |
numFilters = 1; //Only need to notify once per client for EMediaChange. |
|
951 |
||
952 |
//For every filter in this request (CFsNotify) |
|
0 | 953 |
for(TInt j = 0; j < numFilters;++j) |
954 |
{ |
|
955 |
//Is the correct notification type |
|
956 |
aSeenFilter--; |
|
957 |
||
958 |
TBool filterMatch = EDifferent; |
|
300 | 959 |
if(aNotificationInfo.NotificationType() != TFsNotification::EMediaChange) |
0 | 960 |
{ |
961 |
CFsNotificationPathFilter& filter = *(((*aFilterTypeArray)[j]).iPathFilter); |
|
300 | 962 |
__PRINT2(_L("FsNotificationManager::DoHandleChange() operationName=%S, filterName=%S"),&aNotificationInfo.Source().FullName(),filter.iPath); |
963 |
||
964 |
//buferMsg here is the message of the client *recieving* the notification |
|
965 |
const RMessage2& bufferMsg = aNotifyRequest->BufferMessage(); |
|
966 |
filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.Source().FullName(),filter); |
|
0 | 967 |
if(filterMatch == FsNotificationManager::EContinue) |
968 |
continue; //triggers for data cages |
|
969 |
||
970 |
//We need to check for changes coming in to a directory when its rename |
|
300 | 971 |
if(aNotificationInfo.NotificationType() == TFsNotification::ERename && filterMatch==FsNotificationManager::EDifferent) |
0 | 972 |
{ |
300 | 973 |
__PRINT2(_L("FsNotificationManager::DoHandleChange() destinationName=%S, filterName=%S"),&aNotificationInfo.NewName().FullName(),filter.iPath); |
974 |
if(aNotificationInfo.DestDriveIsSet()) |
|
975 |
filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.NewName().FullName().Mid(2),filter); |
|
976 |
else |
|
977 |
filterMatch = DoMatchFilter(bufferMsg,aNotificationInfo.NewName().FullName(),filter); |
|
0 | 978 |
} |
979 |
} |
|
980 |
||
300 | 981 |
if(filterMatch || (aNotificationInfo.NotificationType() == TFsNotification::EMediaChange))//Match or MediaChange (report regardless of filters) |
0 | 982 |
{ |
983 |
//Matching - Handle change |
|
984 |
||
985 |
//Get a CFsNotificationBlock to use |
|
986 |
//So that we can do IPC from a single place. |
|
987 |
CFsNotificationBlock* block = iPool->Allocate(); |
|
988 |
||
300 | 989 |
TInt r = aNotifyRequest->NotifyChange(&aNotificationInfo,*block); |
0 | 990 |
|
991 |
//Free block |
|
992 |
iPool->Free(block); |
|
993 |
||
994 |
if(r != KErrNone) |
|
995 |
{ |
|
996 |
//Something went wrong writing to the client's buffer |
|
997 |
aNotifyRequest->SetActive(CFsNotifyRequest::EInactive); |
|
998 |
if(aNotifyRequest->ClientMsgHandle()!=0) |
|
999 |
aNotifyRequest->CompleteClientRequest(r,EFalse); |
|
1000 |
break; //Go to outer for (i.e. next request in HandleChange) |
|
1001 |
} |
|
1002 |
} |
|
1003 |
continue; //next filter |
|
1004 |
} |
|
1005 |
} |