Merge branch 'master' of https://github.com/funkey/SparkleShare
This commit is contained in:
commit
4021ef40c5
|
@ -65,10 +65,19 @@ namespace SparkleLib {
|
||||||
string [] files = Directory .GetFiles(path);
|
string [] files = Directory .GetFiles(path);
|
||||||
|
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
File.SetAttributes (file, FileAttributes.Normal);
|
if (!IsSymlink (file))
|
||||||
|
File.SetAttributes (file, FileAttributes.Normal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if a file is a symbolic link
|
||||||
|
public static bool IsSymlink (string file)
|
||||||
|
{
|
||||||
|
FileAttributes attr = File.GetAttributes (file);
|
||||||
|
|
||||||
|
return ((attr & FileAttributes.ReparsePoint) ==
|
||||||
|
FileAttributes.ReparsePoint);
|
||||||
|
}
|
||||||
|
|
||||||
// Converts a UNIX timestamp to a more usable time object
|
// Converts a UNIX timestamp to a more usable time object
|
||||||
public static DateTime UnixTimestampToDateTime (int timestamp)
|
public static DateTime UnixTimestampToDateTime (int timestamp)
|
||||||
|
|
|
@ -113,6 +113,8 @@ namespace SparkleLib {
|
||||||
|
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
SparkleHelpers.DebugInfo ("ListenerTcp", "Could not connect to " + Server + ": " + e.Message);
|
SparkleHelpers.DebugInfo ("ListenerTcp", "Could not connect to " + Server + ": " + e.Message);
|
||||||
|
|
||||||
|
OnDisconnected ();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -132,8 +134,14 @@ namespace SparkleLib {
|
||||||
|
|
||||||
string to_send = "subscribe " + folder_identifier + "\n";
|
string to_send = "subscribe " + folder_identifier + "\n";
|
||||||
|
|
||||||
lock (this.mutex) {
|
try {
|
||||||
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
|
||||||
|
lock (this.mutex) {
|
||||||
|
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
||||||
|
}
|
||||||
|
} catch (SocketException e) {
|
||||||
|
SparkleHelpers.DebugInfo ("ListenerTcp", "Could not connect to " + Server + ": " + e.Message);
|
||||||
|
OnDisconnected ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,8 +153,15 @@ namespace SparkleLib {
|
||||||
string to_send = "announce " + announcement.FolderIdentifier
|
string to_send = "announce " + announcement.FolderIdentifier
|
||||||
+ " " + announcement.Message + "\n";
|
+ " " + announcement.Message + "\n";
|
||||||
|
|
||||||
lock (this.mutex) {
|
try {
|
||||||
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
|
||||||
|
lock (this.mutex) {
|
||||||
|
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
||||||
|
}
|
||||||
|
} catch (SocketException e) {
|
||||||
|
SparkleHelpers.DebugInfo ("ListenerTcp", "Could not connect to " + Server + ": " + e.Message);
|
||||||
|
|
||||||
|
OnDisconnected ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue