mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.3 to HEAD (3021:3026)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3021 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3026 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3338 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -174,6 +174,10 @@ public class DiskDeviceContext extends DeviceContext
|
|||||||
*/
|
*/
|
||||||
public void CloseContext()
|
public void CloseContext()
|
||||||
{
|
{
|
||||||
|
// Close the notify handler
|
||||||
|
|
||||||
|
if ( hasChangeHandler())
|
||||||
|
getChangeHandler().shutdownRequest();
|
||||||
|
|
||||||
// Call the base class
|
// Call the base class
|
||||||
|
|
||||||
|
@@ -36,6 +36,7 @@ public final class FileSystem
|
|||||||
public static final int SparseFiles = 0x00000040;
|
public static final int SparseFiles = 0x00000040;
|
||||||
public static final int ReparsePoints = 0x00000080;
|
public static final int ReparsePoints = 0x00000080;
|
||||||
public static final int RemoteStorage = 0x00000100;
|
public static final int RemoteStorage = 0x00000100;
|
||||||
|
public static final int LFNAPISupport = 0x00004000;
|
||||||
public static final int VolumeIsCompressed = 0x00008000;
|
public static final int VolumeIsCompressed = 0x00008000;
|
||||||
public static final int ObjectIds = 0x00010000;
|
public static final int ObjectIds = 0x00010000;
|
||||||
public static final int Encryption = 0x00020000;
|
public static final int Encryption = 0x00020000;
|
||||||
|
@@ -75,6 +75,10 @@ public abstract class HostAnnouncer extends Thread
|
|||||||
|
|
||||||
private byte m_updateCount;
|
private byte m_updateCount;
|
||||||
|
|
||||||
|
// Error count
|
||||||
|
|
||||||
|
private int m_errorCount;
|
||||||
|
|
||||||
// Shutdown flag, host announcer should remove the announced name as it shuts down
|
// Shutdown flag, host announcer should remove the announced name as it shuts down
|
||||||
|
|
||||||
private boolean m_shutdown = false;
|
private boolean m_shutdown = false;
|
||||||
@@ -156,6 +160,16 @@ public abstract class HostAnnouncer extends Thread
|
|||||||
return m_names.numberOfStrings();
|
return m_names.numberOfStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the error count
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
protected final int getErrorCount()
|
||||||
|
{
|
||||||
|
return m_errorCount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the specified host name being announced.
|
* Return the specified host name being announced.
|
||||||
*
|
*
|
||||||
@@ -493,6 +507,24 @@ public abstract class HostAnnouncer extends Thread
|
|||||||
m_srvtype = typ;
|
m_srvtype = typ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increment the error count
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
protected final int incrementErrorCount()
|
||||||
|
{
|
||||||
|
return ++m_errorCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the error count
|
||||||
|
*/
|
||||||
|
protected final void clearErrorCount()
|
||||||
|
{
|
||||||
|
m_errorCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shutdown the host announcer and remove the announced name from Network Neighborhood.
|
* Shutdown the host announcer and remove the announced name from Network Neighborhood.
|
||||||
*/
|
*/
|
||||||
|
@@ -32,6 +32,10 @@ import org.alfresco.filesys.smb.server.win32.Win32NetBIOSSessionSocketHandler;
|
|||||||
public class Win32NetBIOSHostAnnouncer extends HostAnnouncer
|
public class Win32NetBIOSHostAnnouncer extends HostAnnouncer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Number of send errors before marking the LANA as offline
|
||||||
|
|
||||||
|
private static final int SendErrorCount = 3;
|
||||||
|
|
||||||
// Associated session handler
|
// Associated session handler
|
||||||
|
|
||||||
Win32NetBIOSSessionSocketHandler m_handler;
|
Win32NetBIOSSessionSocketHandler m_handler;
|
||||||
@@ -120,6 +124,36 @@ public class Win32NetBIOSHostAnnouncer extends HostAnnouncer
|
|||||||
|
|
||||||
int sts = Win32NetBIOS.SendDatagram(getLana(), getNameNumber(), destName, buf, 0, len);
|
int sts = Win32NetBIOS.SendDatagram(getLana(), getNameNumber(), destName, buf, 0, len);
|
||||||
if ( sts != NetBIOS.NRC_GoodRet)
|
if ( sts != NetBIOS.NRC_GoodRet)
|
||||||
logger.debug("Win32NetBIOS host announce error " + NetBIOS.getErrorString( -sts) + " (LANA " + getLana() + ")");
|
{
|
||||||
|
// Log the error
|
||||||
|
|
||||||
|
if ( logger.isErrorEnabled())
|
||||||
|
logger.error("Host announce error " + NetBIOS.getErrorString( -sts) +
|
||||||
|
" (LANA " + getLana() + ")");
|
||||||
|
|
||||||
|
// Update the error count
|
||||||
|
|
||||||
|
if ( incrementErrorCount() == SendErrorCount)
|
||||||
|
{
|
||||||
|
// Mark the LANA as offline
|
||||||
|
|
||||||
|
m_handler.lanaStatusChange( getLana(), false);
|
||||||
|
|
||||||
|
// Clear the error count
|
||||||
|
|
||||||
|
clearErrorCount();
|
||||||
|
|
||||||
|
// Log the error
|
||||||
|
|
||||||
|
if ( logger.isErrorEnabled())
|
||||||
|
logger.error("Marked LANA as unavailable due to send errors");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Clear the error count
|
||||||
|
|
||||||
|
clearErrorCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -16,6 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.filesys.smb.mailslot;
|
package org.alfresco.filesys.smb.mailslot;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.alfresco.filesys.netbios.NetBIOSName;
|
import org.alfresco.filesys.netbios.NetBIOSName;
|
||||||
import org.alfresco.filesys.netbios.win32.NetBIOS;
|
import org.alfresco.filesys.netbios.win32.NetBIOS;
|
||||||
import org.alfresco.filesys.netbios.win32.NetBIOSSocket;
|
import org.alfresco.filesys.netbios.win32.NetBIOSSocket;
|
||||||
@@ -34,6 +36,10 @@ import org.alfresco.filesys.smb.server.win32.Win32NetBIOSSessionSocketHandler;
|
|||||||
*/
|
*/
|
||||||
public class WinsockNetBIOSHostAnnouncer extends HostAnnouncer
|
public class WinsockNetBIOSHostAnnouncer extends HostAnnouncer
|
||||||
{
|
{
|
||||||
|
// Number of send errors before marking the LANA as offline
|
||||||
|
|
||||||
|
private static final int SendErrorCount = 3;
|
||||||
|
|
||||||
// Associated session handler
|
// Associated session handler
|
||||||
|
|
||||||
private Win32NetBIOSSessionSocketHandler m_handler;
|
private Win32NetBIOSSessionSocketHandler m_handler;
|
||||||
@@ -116,8 +122,49 @@ public class WinsockNetBIOSHostAnnouncer extends HostAnnouncer
|
|||||||
|
|
||||||
// Send the host announce datagram via the Win32 Netbios() API call
|
// Send the host announce datagram via the Win32 Netbios() API call
|
||||||
|
|
||||||
|
boolean txOK = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
int sts = m_dgramSocket.sendDatagram(destNbName, buf, 0, len);
|
int sts = m_dgramSocket.sendDatagram(destNbName, buf, 0, len);
|
||||||
if ( sts != len)
|
if ( sts == len)
|
||||||
logger.debug("WinsockNetBIOS host announce error");
|
txOK = true;
|
||||||
|
}
|
||||||
|
catch ( IOException ex)
|
||||||
|
{
|
||||||
|
// Log the error
|
||||||
|
|
||||||
|
if ( logger.isErrorEnabled())
|
||||||
|
logger.error("Host announce error, " + ex.getMessage() + ", (LANA " + getLana() + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the send was successful
|
||||||
|
|
||||||
|
if ( txOK == false)
|
||||||
|
{
|
||||||
|
// Update the error count
|
||||||
|
|
||||||
|
if ( incrementErrorCount() == SendErrorCount)
|
||||||
|
{
|
||||||
|
// Mark the LANA as offline
|
||||||
|
|
||||||
|
m_handler.lanaStatusChange( getLana(), false);
|
||||||
|
|
||||||
|
// Clear the error count
|
||||||
|
|
||||||
|
clearErrorCount();
|
||||||
|
|
||||||
|
// Log the error
|
||||||
|
|
||||||
|
if ( logger.isErrorEnabled())
|
||||||
|
logger.error("Marked LANA as unavailable due to send errors, (LANA " + getLana() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Clear the error count
|
||||||
|
|
||||||
|
clearErrorCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -426,7 +426,7 @@ class FindInfoPacker
|
|||||||
|
|
||||||
// Align the buffer pointer and set the offset to the next file information entry
|
// Align the buffer pointer and set the offset to the next file information entry
|
||||||
|
|
||||||
buf.longwordAlign();
|
buf.wordAlign();
|
||||||
|
|
||||||
int curPos = buf.getPosition();
|
int curPos = buf.getPosition();
|
||||||
buf.setPosition(startPos);
|
buf.setPosition(startPos);
|
||||||
@@ -518,7 +518,7 @@ class FindInfoPacker
|
|||||||
|
|
||||||
// Align the buffer pointer and set the offset to the next file information entry
|
// Align the buffer pointer and set the offset to the next file information entry
|
||||||
|
|
||||||
buf.longwordAlign();
|
buf.wordAlign();
|
||||||
|
|
||||||
int curPos = buf.getPosition();
|
int curPos = buf.getPosition();
|
||||||
buf.setPosition(startPos);
|
buf.setPosition(startPos);
|
||||||
@@ -615,7 +615,7 @@ class FindInfoPacker
|
|||||||
|
|
||||||
// Align the buffer pointer and set the offset to the next file information entry
|
// Align the buffer pointer and set the offset to the next file information entry
|
||||||
|
|
||||||
buf.longwordAlign();
|
buf.wordAlign();
|
||||||
|
|
||||||
int curPos = buf.getPosition();
|
int curPos = buf.getPosition();
|
||||||
buf.setPosition(startPos);
|
buf.setPosition(startPos);
|
||||||
@@ -718,7 +718,7 @@ class FindInfoPacker
|
|||||||
|
|
||||||
// Align the buffer pointer and set the offset to the next file information entry
|
// Align the buffer pointer and set the offset to the next file information entry
|
||||||
|
|
||||||
buf.longwordAlign();
|
buf.wordAlign();
|
||||||
|
|
||||||
int curPos = buf.getPosition();
|
int curPos = buf.getPosition();
|
||||||
buf.setPosition(startPos);
|
buf.setPosition(startPos);
|
||||||
@@ -839,7 +839,7 @@ class FindInfoPacker
|
|||||||
|
|
||||||
// Align the buffer pointer and set the offset to the next file information entry
|
// Align the buffer pointer and set the offset to the next file information entry
|
||||||
|
|
||||||
buf.longwordAlign();
|
buf.wordAlign();
|
||||||
|
|
||||||
int curPos = buf.getPosition();
|
int curPos = buf.getPosition();
|
||||||
buf.setPosition(startPos);
|
buf.setPosition(startPos);
|
||||||
|
@@ -78,7 +78,7 @@ public class SMBServer extends NetworkFileServer implements Runnable
|
|||||||
|
|
||||||
// Server type flags, used when announcing the host
|
// Server type flags, used when announcing the host
|
||||||
|
|
||||||
private int m_srvType = ServerType.WorkStation + ServerType.Server;
|
private int m_srvType = ServerType.WorkStation + ServerType.Server + ServerType.NTServer;
|
||||||
|
|
||||||
// Next available session id
|
// Next available session id
|
||||||
|
|
||||||
|
@@ -1344,7 +1344,7 @@ public class SMBSrvSession extends SrvSession implements Runnable
|
|||||||
|
|
||||||
// We are using case sensitive pathnames and long file names
|
// We are using case sensitive pathnames and long file names
|
||||||
|
|
||||||
setDefaultFlags(SMBSrvPacket.FLG_CASELESS);
|
setDefaultFlags(0);
|
||||||
setDefaultFlags2(SMBSrvPacket.FLG2_LONGFILENAMES + SMBSrvPacket.FLG2_UNICODE);
|
setDefaultFlags2(SMBSrvPacket.FLG2_LONGFILENAMES + SMBSrvPacket.FLG2_UNICODE);
|
||||||
|
|
||||||
// Access the authenticator for this server and determine if the server is in share or
|
// Access the authenticator for this server and determine if the server is in share or
|
||||||
|
@@ -311,7 +311,8 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
|
|||||||
|
|
||||||
// Set parameters
|
// Set parameters
|
||||||
|
|
||||||
context.setFilesystemAttributes(FileSystem.CasePreservedNames);
|
context.setFilesystemAttributes(FileSystem.CasePreservedNames + FileSystem.UnicodeOnDisk +
|
||||||
|
FileSystem.CaseSensitiveSearch);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1468,15 +1469,6 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
|
|||||||
" node: " + nodeRef);
|
" node: " + nodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
|
||||||
{
|
|
||||||
// already gone
|
|
||||||
if (logger.isDebugEnabled())
|
|
||||||
{
|
|
||||||
logger.debug("Deleted file <alfready gone>: \n" +
|
|
||||||
" file: " + name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (NodeLockedException ex)
|
catch (NodeLockedException ex)
|
||||||
{
|
{
|
||||||
// Debug
|
// Debug
|
||||||
|
Reference in New Issue
Block a user