From: VMware, Inc <> Date: Thu, 22 Dec 2011 00:14:51 +0000 (-0800) Subject: Add a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS) X-Git-Tag: 2011.12.20-562307~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18d23a316ec113cdfc1f8353ce0900487bbc20be;p=thirdparty%2Fopen-vm-tools.git Add a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS) - Added a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS). This error code is returned to the client when the maximum number of sessions were already created and a new session couldn't be created in the HGFS server. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/hgfs/hgfsUtil.c b/open-vm-tools/lib/hgfs/hgfsUtil.c index 78a9f1fd3..c39af34f2 100644 --- a/open-vm-tools/lib/hgfs/hgfsUtil.c +++ b/open-vm-tools/lib/hgfs/hgfsUtil.c @@ -237,6 +237,8 @@ HgfsConvertFromInternalStatus(HgfsInternalStatus status) // IN return HGFS_STATUS_NAME_TOO_LONG; case ERROR_CONNECTION_INVALID: // HGFS_ERROR_STALE_SESSION return HGFS_STATUS_STALE_SESSION; + case ERROR_MAX_SESSIONS_REACHED: + return HGFS_STATUS_TOO_MANY_SESSIONS; case ERROR_INTERNAL_ERROR: case HGFS_INTERNAL_STATUS_ERROR: default: @@ -283,6 +285,8 @@ HgfsConvertFromInternalStatus(HgfsInternalStatus status) // IN return HGFS_STATUS_NOT_SAME_DEVICE; case ENETRESET: // HGFS_ERROR_STALE_SESSION return HGFS_STATUS_STALE_SESSION; + case ECONNREFUSED: + return HGFS_STATUS_TOO_MANY_SESSIONS; case EINTERNAL: case HGFS_INTERNAL_STATUS_ERROR: default: diff --git a/open-vm-tools/lib/include/hgfs.h b/open-vm-tools/lib/include/hgfs.h index ffa5e36de..f3efec40b 100644 --- a/open-vm-tools/lib/include/hgfs.h +++ b/open-vm-tools/lib/include/hgfs.h @@ -175,6 +175,7 @@ typedef enum { * Server must never retun these codes for legacy clients. */ HGFS_STATUS_STALE_SESSION, + HGFS_STATUS_TOO_MANY_SESSIONS, } HgfsStatus; /* diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h index 219cd7eec..ce59ef356 100644 --- a/open-vm-tools/lib/include/hgfsUtil.h +++ b/open-vm-tools/lib/include/hgfsUtil.h @@ -104,7 +104,7 @@ struct timespec { #define HGFS_ERROR_FILE_EXIST ERROR_ALREADY_EXISTS #define HGFS_ERROR_NOT_SUPPORTED ERROR_NOT_SUPPORTED #define HGFS_ERROR_NOT_ENOUGH_MEMORY ERROR_NOT_ENOUGH_MEMORY -#define HGFS_ERROR_TOO_MANY_SESSIONS ERROR_INTERNAL_ERROR +#define HGFS_ERROR_TOO_MANY_SESSIONS ERROR_MAX_SESSIONS_REACHED #define HGFS_ERROR_INTERNAL ERROR_INTERNAL_ERROR #else #define HGFS_ERROR_SUCCESS 0 @@ -120,7 +120,7 @@ struct timespec { #define HGFS_ERROR_FILE_EXIST EEXIST #define HGFS_ERROR_NOT_SUPPORTED EOPNOTSUPP #define HGFS_ERROR_NOT_ENOUGH_MEMORY ENOMEM -#define HGFS_ERROR_TOO_MANY_SESSIONS EINTERNAL +#define HGFS_ERROR_TOO_MANY_SESSIONS ECONNREFUSED #define HGFS_ERROR_INTERNAL EINTERNAL #endif // _WIN32