-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix timeout code in windows #670
Conversation
net.c
Outdated
} | ||
#ifdef _WIN32 | ||
else if(errno == ETIMEDOUT && (c->flags & REDIS_BLOCK)) | ||
{ /* especially in windows */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the formatting here? (spaces, no tabs; opening brace on same line, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't see how this block is specific to Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't see how this block is specific to Windows.
In fact, I think so. I added the block in order to clarify a timeout error code when giving the timeout value on blocking mode. But, originally the block wasn't there and I was uncertain that I coded correct, so I specified the block to only Windows.
If this block doesn't have any problem, I can remove #preprocessor or else I will remove the block.
net.c
Outdated
@@ -63,7 +63,15 @@ int redisNetRead(redisContext *c, char *buf, size_t bufcap) { | |||
if ((errno == EWOULDBLOCK && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) { | |||
/* Try again later */ | |||
return 0; | |||
} else { | |||
} | |||
#ifdef _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need an #ifdef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, fix brace on same line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, fix brace on same line
i fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need an
#ifdef
i removed #ifdef ~ #endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're still using 8 space indentation.. are you using a proper editor? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My default indent setting(VS2017) is a tab. :]
I (really) have fixed all formatting mistakes.
Oh, and when you're done, please squash into two commits |
I am done :] |
I aslo got timeout problem on windows, and I commit issues |
Timeout was not working in Windows.