Skip to content

Commit

Permalink
Fixes delays associated with discovery when adding a new discovery po…
Browse files Browse the repository at this point in the history
…rtal or enabling discovery after having added a new portal
  • Loading branch information
nsinenian committed Dec 20, 2016
1 parent d1ad33f commit c8df7c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Distribution/package.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Package parameters
NAME="iSCSI Initiator for macOS"
BUNDLE_ID="com.github.iscsi-osx.iSCSIInitiator"
VERSION="1.0.0-beta4"
VERSION="1.0.0-beta5"

# Output of final DMG
RELEASE="../Release"
Expand Down
4 changes: 4 additions & 0 deletions Source/User/iscsictl/iSCSICtl.m
Original file line number Diff line number Diff line change
Expand Up @@ -1966,6 +1966,10 @@ errno_t iSCSICtlAddDiscoveryPortal(AuthorizationRef authorization,CFDictionaryRe

if(portal)
iSCSIPortalRelease(portal);

if(!error)
iSCSIDaemonUpdateDiscovery(handle);

if(preferences)
iSCSIPreferencesRelease(preferences);
iSCSICtlDisconnectFromDaemon(handle);
Expand Down
8 changes: 2 additions & 6 deletions Source/User/iscsid/iSCSIDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,8 +1387,9 @@ errno_t iSCSIDUpdateDiscovery(int fd,
// Add new timer with updated interval, if discovery is enabled
if(discoveryEnabled)
{
CFTimeInterval delay = 2;
discoveryTimer = CFRunLoopTimerCreate(kCFAllocatorDefault,
CFAbsoluteTimeGetCurrent(),
CFAbsoluteTimeGetCurrent()+delay,
interval,0,0,callout,NULL);

CFRunLoopAddTimer(CFRunLoopGetCurrent(),discoveryTimer,kCFRunLoopDefaultMode);
Expand All @@ -1400,10 +1401,6 @@ errno_t iSCSIDUpdateDiscovery(int fd,

if(send(fd,&rsp,sizeof(rsp),0) != sizeof(rsp))
error = EAGAIN;

// If discovery was enabled do it now...
// if(discoveryEnabled)
// iSCSIDisco

return error;
}
Expand Down Expand Up @@ -1843,7 +1840,6 @@ void iSCSIDPrepareForSystemSleep()

DASessionScheduleWithRunLoop(diskSession,CFRunLoopGetMain(),kCFRunLoopDefaultMode);
iSCSIDAUnmountForTarget(diskSession,kDADiskUnmountOptionWhole,target,&iSCSIDPrepareForSystemSleepComplete,(void*)sessionId);
// iSCSITargetRelease(target);
}

CFRetain(diskSession);
Expand Down

0 comments on commit c8df7c6

Please sign in to comment.