Try again later for EINTR errors (see issue #99)
This commit is contained in:
parent
3c46b13a62
commit
bf161d996f
@ -1077,7 +1077,7 @@ int redisBufferRead(redisContext *c) {
|
|||||||
|
|
||||||
nread = read(c->fd,buf,sizeof(buf));
|
nread = read(c->fd,buf,sizeof(buf));
|
||||||
if (nread == -1) {
|
if (nread == -1) {
|
||||||
if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) {
|
if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) {
|
||||||
/* Try again later */
|
/* Try again later */
|
||||||
} else {
|
} else {
|
||||||
__redisSetError(c,REDIS_ERR_IO,NULL);
|
__redisSetError(c,REDIS_ERR_IO,NULL);
|
||||||
@ -1114,7 +1114,7 @@ int redisBufferWrite(redisContext *c, int *done) {
|
|||||||
if (sdslen(c->obuf) > 0) {
|
if (sdslen(c->obuf) > 0) {
|
||||||
nwritten = write(c->fd,c->obuf,sdslen(c->obuf));
|
nwritten = write(c->fd,c->obuf,sdslen(c->obuf));
|
||||||
if (nwritten == -1) {
|
if (nwritten == -1) {
|
||||||
if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) {
|
if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) {
|
||||||
/* Try again later */
|
/* Try again later */
|
||||||
} else {
|
} else {
|
||||||
__redisSetError(c,REDIS_ERR_IO,NULL);
|
__redisSetError(c,REDIS_ERR_IO,NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user