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);
|
||||
|
||||
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
|
||||
public static DateTime UnixTimestampToDateTime (int timestamp)
|
||||
|
|
|
@ -113,6 +113,8 @@ namespace SparkleLib {
|
|||
|
||||
} catch (SocketException e) {
|
||||
SparkleHelpers.DebugInfo ("ListenerTcp", "Could not connect to " + Server + ": " + e.Message);
|
||||
|
||||
OnDisconnected ();
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -132,8 +134,14 @@ namespace SparkleLib {
|
|||
|
||||
string to_send = "subscribe " + folder_identifier + "\n";
|
||||
|
||||
lock (this.mutex) {
|
||||
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
||||
try {
|
||||
|
||||
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
|
||||
+ " " + announcement.Message + "\n";
|
||||
|
||||
lock (this.mutex) {
|
||||
this.socket.Send (Encoding.UTF8.GetBytes (to_send));
|
||||
try {
|
||||
|
||||
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