4219. [bug] Set event->result to ISC_R_WOULDBLOCK on EWOULDBLOCK,

EGAIN when these soft error are not retried for
                        isc_socket_send*().

(cherry picked from commit a21c415687)
This commit is contained in:
Mark Andrews 2015-09-21 17:22:53 +10:00
parent 0548dbd69b
commit 1460b2afe3
4 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,7 @@
4219. [bug] Set event->result to ISC_R_WOULDBLOCK on EWOULDBLOCK,
EGAIN when these soft error are not retried for
isc_socket_send*().
4217. [protocol] Add support for CSYNC. [RT #40532]
4216. [cleanup] Silence static analysis warnings. [RT #40649]

View file

@ -89,9 +89,10 @@
#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */
#define ISC_R_UNSET 61 /*%< unset */
#define ISC_R_MULTIPLE 62 /*%< multiple */
#define ISC_R_WOULDBLOCK 63 /*%< would block */
/*% Not a result code: the number of results. */
#define ISC_R_NRESULTS 63
#define ISC_R_NRESULTS 64
ISC_LANG_BEGINDECLS

View file

@ -104,6 +104,7 @@ static const char *description[ISC_R_NRESULTS] = {
"bad base32 encoding", /*%< 60 */
"unset", /*%< 61 */
"multiple", /*%< 62 */
"would block", /*%< 63 */
};
#define ISC_RESULT_RESULTSET 2

View file

@ -1876,8 +1876,11 @@ doio_send(isc__socket_t *sock, isc_socketevent_t *dev) {
if (send_errno == EINTR && ++attempts < NRETRIES)
goto resend;
if (SOFT_ERROR(send_errno))
if (SOFT_ERROR(send_errno)) {
if (errno == EWOULDBLOCK || errno == EAGAIN)
dev->result = ISC_R_WOULDBLOCK;
return (DOIO_SOFT);
}
#define SOFT_OR_HARD(_system, _isc) \
if (send_errno == _system) { \