⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 warerrorcodes.c

📁 ftpserver very good sample
💻 C
字号:
#include "StdAfx.h"#include <errno.h>#include "WarErrorCodes.h"#ifndef NULL#  define NULL 0#endifconst war_error_text_t WarErrorText[] ={    {WAR_ERR_OK, "No error"},    {WAR_ERR_SYSTEM_ERROR, "System error"},    {WAR_ERR_NOT_IMPLEMENTED, "Not implemented"},    {WAR_ERR_UNEXCPECTED_REPLY_CODE, "Unexcpected reply code"},    {WAR_ERR_INVALID_ARGUMENT, "Invalid argument"},    {WAR_ERR_MISSING_REQ_FILE, "Missing a requiered file"},    {WAR_ERR_PARSER_ERROR, "Parser error"},    {WAR_ERR_LEXICAL_ERRROR, "Lexical error"},    {WAR_ERR_DNS_LOOKUP_FAILED, "DNS lookup failed"},    {WAR_ERR_INTERNAL_DATA_NOT_INITIALIZED, "Internal data not initialized"},    {WAR_ERR_ALREADY_INITIALIZED, "Already initialized"},    {WAR_ERR_INVALID_CASE_VALUE, "Invalid case/switch value"},    {WAR_ERR_SYSTEM_CALL_FAILED, "System call failed"},    {WAR_ERR_COMMAND_FAILED, "Command failed"},    {WAR_ERR_OUT_OF_MEMORY, "Out of memory"},    {WAR_ERR_BUFFER_OVERFLOW, "Buffer overflow"},    {WAR_ERR_NAME_EXIST, "The name exist/is in use"},    {WAR_ERR_NAME_DONT_EXIST, "The name don't exist"},    {WAR_ERR_NO_OBJECT, "No such object"},    {WAR_ERR_OBJECT_EXIST, "The object already exist"},    {WAR_ERR_OBJECT_NOT_FOUND, "The object was not found"},    {WAR_ERR_TIMED_OUT, "The command timed out"},    {WAR_ERR_BAD_SYSTEM_STATUS, "Bad system status"},    {WAR_ERR_FEATURE_NOT_SUPPORTED, "The feature is not supported"},    {WAR_ERR_OBJECT_TOO_LONG, "Object is too long"},    {WAR_ERR_INVALID_HEADER, "Invalid header"},    {WAR_ERR_COULD_NOT_OPEN_FILE, "Could not open file"},    {WAR_ERR_USAGE, "User requested usage information"},    {WAR_ERR_VERSION, "User requested version information"},    {WAR_ERR_ABORT_THREAD, "The therad is notified to abort the current task"},    {WAR_ERR_INVALID_PATH, "Invalid path"},    {WAR_ERR_INVALID_URL, "Invalid URL"},    {WAR_ERR_NOT_AN_URL, "Not an URL"},    {WAR_ERR_NOT_OPEN, "The object is not open"},    {WAR_ERR_ALREADY_OPEN, "The object is already open"},    {WAR_ERR_NOT_OPEN_FOR_READ, "The object is not open for read"},    {WAR_ERR_NOT_OPEN_FOR_WRITE, "The object is not open for write"},    {WAR_ERR_ACCESS_DENIED, "Access denied"},    {WAR_ERR_OUT_OF_RANGE, "A value was out of range"},    {WAR_ERR_SECURITY_VIOLATION, "A potential security violation was detected."},    {WAR_ERR_SHUTDOWN, "The system is shutting down."},    {WAR_ERR_DISABLED, "The feature is disabled."},    {WAR_ERR_IP_IS_DENIED, "Your host address (IP) is currently denied access."},    {WAR_ERR_FAILED_TO_LOCK_OBJECT, "Failed to lock object."},    {WAR_INVALID_PROTOCOL, "Invalid or unsupported protocol"},	{WAR_BYPASS_DEFAULT_PRC, "No error, but we need to bypass the default processing."},    {WAR_NETERR_INVALID_HOSTADDRESS, "Invalid hostaddress"},    {WAR_NETERR_INVALID_PORT_OR_SERVICE, "Invalid port or service"},    {WAR_NETERR_UNSUPPORTED_FAMILY, "Unsupported network family"},    {WAR_NETERR_NO_AVAIL_PORTS_IN_RANGE, "No available ports in the specified range"},	{WAR_NETERR_HARD_CLOSE, "The connection was not gracefully reset"},        {WAR_THREADERR_FAILED_TO_CREATE, "Failed to create thread"},    {WAR_THREADERR_FAILED_TO_INITIALIZE, "Failed to initialize therad"},    {WAR_THREADERR_FAILED_TO_INITIALIZE_TLS, "Failed to initialize TLS"},    {WAR_THREADERR_FAIED_TO_INITIALIZE_MUTEX, "Failed to initialize Mutex"},    {WAR_THREADERR_MUTEX_LOCK_FAILED, "Mutex lock failed"},    {WAR_THREADERR_MUTEX_UNLOCK_FAILED, "Mutex unlock failed"},    {WAR_THREADERR_FAIED_TO_INITIALIZE_EVENT, "Failed to initialize event"},    {WAR_THREADERR_EVENT_WAIT_FAILED, "Failed to wait on event"},    {WAR_THREADERR_EVENT_SIGNAL_FAILED, "Failed to signal an event"},    {WAR_THREADERR_NO_TSD, "No Thread Spesific Data object found"},    {WAR_CHRCNV_NO_CONVERSION, "No character conversion is possible"},    {WAR_CHRCNV_NOT_UTF8, "The string was not UTF8 encoded"},    {WAR_FERR_PATH_IS_A_DIR, "The path is a directory"},    {WAR_FERR_END_OF_FILE, "End of file"},    {WAR_FERR_WRITE_FAILED, "Disk write operation failed"},    {WAR_FERR_READ_FAILED, "Disk read operation failed"},    {WAR_FERR_NOT_A_DRIVE, "Not a disk drive"},    {WAR_FERR_CALLBACK_FAILED, "Callback operation failed or returned an error"},    {WAR_FERR_NOT_OPENED_WPTH_CALLBACK, "The file was not opened with the F_CALLBACK flag"},    {WAR_FERR_NO_SUCH_PATH, "No such path"},    {WAR_FERR_NOT_OPEN_FOR_READ, "The file is not open for read"},    {WAR_FERR_NOT_A_DIRECTORY, "Not a directory"},    {WAR_FERR_NOT_A_FILE, "Not a file"},    {WAR_FERR_RECURSIVE_LISTINGS_FORBIDDEN, "Recursive directory listings are forbidden"},    {WAR_FERR_NOT_SAME_PATH, "The source and destination is not in the same path"},    {WAR_FTPDERR_MISSING_ARGUMENT, "Missing command argument"},    {WAR_FTPDERR_ARGUMENT_NOT_ALLOWED, "Argument is not allowed"},    {WAR_FTPDERR_NO_DATA_CONNECTION, "No data connection is open or allocated"},    {WAR_FTPDERR_ABORTED, "The transfer was aborted"},    {WAR_FTPDERR_NOASCIIREST, "Restart disabled in ASCII mode"},    {WAR_FTPDERR_REST_OUT_OF_RANGE, "Restart value is out of range"},    {WAR_FTPERR_BAD_SEQUENCE_OF_CMDS, "Bad squence of commands"},    {WAR_HTERR_INVALID_REQ_METHOD, "Invalid or unknown HTTP request method"},    {WAR_HTERR_INVALID_REQUEST_SYNTAX, "Syntax error in HTTP request header"},    {WAR_HTERR_INVALID_HTTP_VERSION, "Invalid or unknown HTTP version"},    {WAR_HTERR_HEADER_TOO_LONG, "HTTP header too long."},    /* {, ""}, */    {0, NULL}};const war_error_text_t WarSysErrorText[] ={    {EMFILE, "EMFILE Too many open files. Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread."},    {EWOULDBLOCK, "EWOULDBLOCK Resource temporarily unavailable. This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a non-fatal error, and the operation should be retried later. It is normal for EWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established."},    {EINPROGRESS, "EINPROGRESS Operation now in progress. A blocking operation is currently executing. Windows Sockets only allows a single blocking operation to be outstanding per task (or thread), and if any other function call is made (whether or not it references that or any other socket) the function fails with the EINPROGRESS error."},    {EALREADY, "EALREADY Operation already in progress. An operation was attempted on a nonblocking socket with an operation already in progress - that is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed."},    {ENOTSOCK, "ENOTSOCK Socket operation on non-socket. An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid."},    {EDESTADDRREQ, "EDESTADDRREQ Destination address required. A required address was omitted from an operation on a socket. For example, this error is returned if sendto is called with the remote address of ADDR_ANY."},    {EMSGSIZE, "EMSGSIZE Message too long. A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself."},    {EPROTOTYPE, "EPROTOTYPE Bad protocol option. An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call."},    {ENOPROTOOPT, "ENOPROTOOPT Bad protocol option. An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call."},    {EPROTONOSUPPORT, "EPROTONOSUPPORT Protocol not supported. The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol."},    {ESOCKTNOSUPPORT, "ESOCKTNOSUPPORT Socket type not supported. The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a socket call, and the implementation does not support SOCK_RAW sockets at all."},    {EOPNOTSUPP, "EOPNOTSUPP Operation not supported. The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation, for example, trying to accept a connection on a datagram socket."},    {EPFNOSUPPORT, "EPFNOSUPPORT Protocol family not supported. The protocol family has not been configured into the system or no implementation for it exists. Has a slightly different meaning to EAFNOSUPPORT, but is interchangeable in most cases, and all Sockets functions that return one of these specify EAFNOSUPPORT."},    {EADDRINUSE, "EADDRINUSE Address already in use."},    {EADDRNOTAVAIL, "EADDRNOTAVAIL Cannot assign requested address. The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local machine. This can also result from connect, sendto, when the remote address or port is not valid for a remote machine (for example, address or port 0)."},    {ENETDOWN, "ENETDOWN This error may be reported at any time if the Sockets implementation detects an underlying failure."},    {ENETUNREACH, "ENETUNREACH Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host."},    {ENETRESET, "ENETRESET Network dropped connection on reset. The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that has already failed."},    {ECONNABORTED, "ECONNABORTED Software caused connection abort. An established connection was aborted by the software in your host machine, possibly due to a data transmission time-out or protocol error."},    {ECONNRESET, "ECONNRESET Connection reset by peer. A existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, or the remote host used a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket.) This error may also result if a connection was broken due to keepalive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with ENETRESET. Subsequent operations fail with ECONNRESET."},    {ENOBUFS, "ENOBUFS No buffer space available. An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."},    {EISCONN, "EISCONN Socket is already connected. A connect request was made on an already connected socket. Some implementations also return this error if sendto is called on a connected SOCK_DGRAM socket (For SOCK_STREAM sockets, the to parameter in sendto is ignored), although other implementations treat this as a legal occurrence."},    {ENOTCONN, "ENOTCONN Socket is not connected. A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied. Any other type of operation might also return this error 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -