mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-23 10:21:14 +00:00
fixed bug #31748 (Calling non-blocking connect more than once can render a socket useless) since it mainly involves changing "FATAL" classification of error codes: ERR_USE and ERR_ISCONN just aren't fatal.
This commit is contained in:
parent
d793ed3b9b
commit
7203680146
@ -233,6 +233,11 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2011-03-14: Simon Goldschmidt
|
||||||
|
* err.h/.c, sockets.c, api_msg.c: fixed bug #31748 (Calling non-blocking connect
|
||||||
|
more than once can render a socket useless) since it mainly involves changing
|
||||||
|
"FATAL" classification of error codes: ERR_USE and ERR_ISCONN just aren't fatal.
|
||||||
|
|
||||||
2011-03-13: Simon Goldschmidt
|
2011-03-13: Simon Goldschmidt
|
||||||
* sockets.c: fixed bug #32769 (ESHUTDOWN is linux-specific) by fixing
|
* sockets.c: fixed bug #32769 (ESHUTDOWN is linux-specific) by fixing
|
||||||
err_to_errno_table (ERR_CLSD: ENOTCONN instead of ESHUTDOWN), ERR_ISCONN:
|
err_to_errno_table (ERR_CLSD: ENOTCONN instead of ESHUTDOWN), ERR_ISCONN:
|
||||||
|
@ -950,12 +950,7 @@ do_connected(void *arg, struct tcp_pcb *pcb, err_t err)
|
|||||||
conn->current_msg = NULL;
|
conn->current_msg = NULL;
|
||||||
conn->state = NETCONN_NONE;
|
conn->state = NETCONN_NONE;
|
||||||
if (!was_blocking) {
|
if (!was_blocking) {
|
||||||
SYS_ARCH_DECL_PROTECT(lev);
|
NETCONN_SET_SAFE_ERR(conn, ERR_OK);
|
||||||
SYS_ARCH_PROTECT(lev);
|
|
||||||
if (conn->last_err == ERR_INPROGRESS) {
|
|
||||||
conn->last_err = ERR_OK;
|
|
||||||
}
|
|
||||||
SYS_ARCH_UNPROTECT(lev);
|
|
||||||
}
|
}
|
||||||
API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0);
|
API_EVENT(conn, NETCONN_EVT_SENDPLUS, 0);
|
||||||
|
|
||||||
|
@ -49,14 +49,14 @@ static const char *err_strerr[] = {
|
|||||||
"Operation in progress.", /* ERR_INPROGRESS -5 */
|
"Operation in progress.", /* ERR_INPROGRESS -5 */
|
||||||
"Illegal value.", /* ERR_VAL -6 */
|
"Illegal value.", /* ERR_VAL -6 */
|
||||||
"Operation would block.", /* ERR_WOULDBLOCK -7 */
|
"Operation would block.", /* ERR_WOULDBLOCK -7 */
|
||||||
"Connection aborted.", /* ERR_ABRT -8 */
|
"Address in use.", /* ERR_USE -8 */
|
||||||
"Connection reset.", /* ERR_RST -9 */
|
"Already connected.", /* ERR_ISCONN -9 */
|
||||||
"Connection closed.", /* ERR_CLSD -10 */
|
"Connection aborted.", /* ERR_ABRT -10 */
|
||||||
"Not connected.", /* ERR_CONN -11 */
|
"Connection reset.", /* ERR_RST -11 */
|
||||||
"Illegal argument.", /* ERR_ARG -12 */
|
"Connection closed.", /* ERR_CLSD -12 */
|
||||||
"Address in use.", /* ERR_USE -13 */
|
"Not connected.", /* ERR_CONN -13 */
|
||||||
"Low-level netif error.", /* ERR_IF -14 */
|
"Illegal argument.", /* ERR_ARG -14 */
|
||||||
"Already connected.", /* ERR_ISCONN -15 */
|
"Low-level netif error.", /* ERR_IF -15 */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,14 +141,14 @@ static const int err_to_errno_table[] = {
|
|||||||
EINPROGRESS, /* ERR_INPROGRESS -5 Operation in progress */
|
EINPROGRESS, /* ERR_INPROGRESS -5 Operation in progress */
|
||||||
EINVAL, /* ERR_VAL -6 Illegal value. */
|
EINVAL, /* ERR_VAL -6 Illegal value. */
|
||||||
EWOULDBLOCK, /* ERR_WOULDBLOCK -7 Operation would block. */
|
EWOULDBLOCK, /* ERR_WOULDBLOCK -7 Operation would block. */
|
||||||
ECONNABORTED, /* ERR_ABRT -8 Connection aborted. */
|
EADDRINUSE, /* ERR_USE -8 Address in use. */
|
||||||
ECONNRESET, /* ERR_RST -9 Connection reset. */
|
EALREADY, /* ERR_ISCONN -9 Already connected. */
|
||||||
ENOTCONN, /* ERR_CLSD -10 Connection closed. */
|
ECONNABORTED, /* ERR_ABRT -10 Connection aborted. */
|
||||||
ENOTCONN, /* ERR_CONN -11 Not connected. */
|
ECONNRESET, /* ERR_RST -11 Connection reset. */
|
||||||
EIO, /* ERR_ARG -12 Illegal argument. */
|
ENOTCONN, /* ERR_CLSD -12 Connection closed. */
|
||||||
EADDRINUSE, /* ERR_USE -13 Address in use. */
|
ENOTCONN, /* ERR_CONN -13 Not connected. */
|
||||||
-1, /* ERR_IF -14 Low-level netif error */
|
EIO, /* ERR_ARG -14 Illegal argument. */
|
||||||
EALREADY, /* ERR_ISCONN -15 Already connected. */
|
-1, /* ERR_IF -15 Low-level netif error */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ERR_TO_ERRNO_TABLE_SIZE \
|
#define ERR_TO_ERRNO_TABLE_SIZE \
|
||||||
|
@ -57,20 +57,19 @@ typedef s8_t err_t;
|
|||||||
#define ERR_INPROGRESS -5 /* Operation in progress */
|
#define ERR_INPROGRESS -5 /* Operation in progress */
|
||||||
#define ERR_VAL -6 /* Illegal value. */
|
#define ERR_VAL -6 /* Illegal value. */
|
||||||
#define ERR_WOULDBLOCK -7 /* Operation would block. */
|
#define ERR_WOULDBLOCK -7 /* Operation would block. */
|
||||||
|
#define ERR_USE -8 /* Address in use. */
|
||||||
|
#define ERR_ISCONN -9 /* Already connected. */
|
||||||
|
|
||||||
#define ERR_IS_FATAL(e) ((e) < ERR_WOULDBLOCK)
|
#define ERR_IS_FATAL(e) ((e) < ERR_ISCONN)
|
||||||
|
|
||||||
#define ERR_ABRT -8 /* Connection aborted. */
|
#define ERR_ABRT -10 /* Connection aborted. */
|
||||||
#define ERR_RST -9 /* Connection reset. */
|
#define ERR_RST -11 /* Connection reset. */
|
||||||
#define ERR_CLSD -10 /* Connection closed. */
|
#define ERR_CLSD -12 /* Connection closed. */
|
||||||
#define ERR_CONN -11 /* Not connected. */
|
#define ERR_CONN -13 /* Not connected. */
|
||||||
|
|
||||||
#define ERR_ARG -12 /* Illegal argument. */
|
#define ERR_ARG -14 /* Illegal argument. */
|
||||||
|
|
||||||
#define ERR_USE -13 /* Address in use. */
|
#define ERR_IF -15 /* Low-level netif error */
|
||||||
|
|
||||||
#define ERR_IF -14 /* Low-level netif error */
|
|
||||||
#define ERR_ISCONN -15 /* Already connected. */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
#ifdef LWIP_DEBUG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user