Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smb_tree_connect return #57

Merged
merged 1 commit into from
Jan 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions TOSMBClient.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = 'TOSMBClient'
s.version = '1.0.8'
s.version = '1.0.9'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
s.summary = 'An Objective-C framework that wraps libdsm, an SMB client library.'
s.homepage = 'https://github.com/TimOliver/TOSMBClient'
s.author = 'Tim Oliver'
s.source = { :git => 'https://github.com/TimOliver/TOSMBClient.git', :tag => '1.0.8' }
s.source = { :git => 'https://github.com/TimOliver/TOSMBClient.git', :tag => '1.0.9' }
s.platform = :ios, '7.0'
s.source_files = 'TOSMBClient/**/*.{h,m}'
s.vendored_libraries = 'TOSMBClient/libdsm/libdsm.a', 'TOSMBClient/libdsm/libtasn1.a'
Expand Down
3 changes: 1 addition & 2 deletions TOSMBClient/TOSMBSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ - (NSArray *)requestContentsOfDirectoryAtFilePath:(NSString *)path error:(NSErro
//If not, make a new connection
const char *cStringName = [shareName cStringUsingEncoding:NSUTF8StringEncoding];
smb_tid shareID = -1;
smb_tree_connect(self.session, cStringName, &shareID);
if (shareID < 0) {
if (smb_tree_connect(self.session, cStringName, &shareID) != 0) {
if (error) {
resultError = errorForErrorCode(TOSMBSessionErrorCodeShareConnectionFailed);
*error = resultError;
Expand Down
4 changes: 2 additions & 2 deletions TOSMBClient/TOSMBSessionDownloadTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ - (void)performTaskWithOperation:(__weak NSBlockOperation *)weakOperation
//Next attach to the share we'll be using
NSString *shareName = [self.session shareNameFromPath:self.sourceFilePath];
const char *shareCString = [shareName cStringUsingEncoding:NSUTF8StringEncoding];
smb_tree_connect(self.smbSession, shareCString, &treeID);
if (!treeID) {

if (smb_tree_connect(self.smbSession, shareCString, &treeID) != 0) {
[self didFailWithError:errorForErrorCode(TOSMBSessionErrorCodeShareConnectionFailed)];
self.cleanupBlock(treeID, fileID);
return;
Expand Down
4 changes: 2 additions & 2 deletions TOSMBClient/TOSMBSessionUploadTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ - (void)performTaskWithOperation:(NSBlockOperation * _Nonnull __weak)weakOperati
//Next attach to the share we'll be using
NSString *shareName = [self.session shareNameFromPath:self.path];
const char *shareCString = [shareName cStringUsingEncoding:NSUTF8StringEncoding];
smb_tree_connect(self.smbSession, shareCString, &treeID);
if (!treeID) {

if (smb_tree_connect(self.smbSession, shareCString, &treeID) != 0) {
[self didFailWithError:errorForErrorCode(TOSMBSessionErrorCodeShareConnectionFailed)];
self.cleanupBlock(treeID, fileID);
return;
Expand Down