Skip to content
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

Merged
merged 2 commits into from
Aug 13, 2019
Merged

fix timeout code in windows #670

merged 2 commits into from
Aug 13, 2019

Conversation

jman-krafton
Copy link
Contributor

Timeout was not working in Windows.

net.c Outdated
}
#ifdef _WIN32
else if(errno == ETIMEDOUT && (c->flags & REDIS_BLOCK))
{ /* especially in windows */
Copy link
Contributor

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.)

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor

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? :)

Copy link
Contributor Author

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.

@mnunberg
Copy link
Contributor

mnunberg commented Aug 9, 2019

Oh, and when you're done, please squash into two commits

@jman-krafton
Copy link
Contributor Author

jman-krafton commented Aug 12, 2019

I am done :]

@mnunberg mnunberg merged commit 9c7c694 into redis:master Aug 13, 2019
@HelloAWorld
Copy link

I aslo got timeout problem on windows, and I commit issues
redis timeout issues #677
Please review it if it's the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants