]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add a new HGFS error code (HGFS_STATUS_TOO_MANY_SESSIONS)
authorVMware, Inc <>
Thu, 22 Dec 2011 00:14:51 +0000 (16:14 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 22 Dec 2011 00:14:51 +0000 (16:14 -0800)
- 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 <mvanzin@vmware.com>
open-vm-tools/lib/hgfs/hgfsUtil.c
open-vm-tools/lib/include/hgfs.h
open-vm-tools/lib/include/hgfsUtil.h

index 78a9f1fd347903ba34b8204b727f4dcce8adc563..c39af34f21d1ff8c7bf5f10b6ed9ebc3138fafc5 100644 (file)
@@ -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:
index ffa5e36de088714e63dbe2f4040e833f52b4574e..f3efec40b91ad7bd5a45f532470f7add83e0e9ef 100644 (file)
@@ -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;
 
 /*
index 219cd7eecd555acbf3a408ab6bd43deb5acd1b0b..ce59ef356b2dbe58a0130d8b3e88874bd575675c 100644 (file)
@@ -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