Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

remove unnessary codes #802

Closed
wants to merge 1 commit into from

2 participants

@charsyam

remove unnecessary codes
1. nwritten = 0; is not necessary.

  • not anti warning.
  1. variabless l, j is not used after that position.
@charsyam charsyam closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 1, 2012
  1. @openbaas

    remove unnessary codes

    openbaas authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 10 deletions.
  1. +6 −8 src/networking.c
  2. +0 −2  src/util.c
View
14 src/networking.c
@@ -757,16 +757,14 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) {
(server.maxmemory == 0 ||
zmalloc_used_memory() < server.maxmemory)) break;
}
- if (nwritten == -1) {
- if (errno == EAGAIN) {
- nwritten = 0;
- } else {
- redisLog(REDIS_VERBOSE,
+
+ if (nwritten == -1 && errno != EAGAIN) {
+ redisLog(REDIS_VERBOSE,
"Error writing to client: %s", strerror(errno));
- freeClient(c);
- return;
- }
+ freeClient(c);
+ return;
}
+
if (totwritten > 0) c->lastinteraction = server.unixtime;
if (c->bufpos == 0 && listLength(c->reply) == 0) {
c->sentlen = 0;
View
2  src/util.c
@@ -391,8 +391,6 @@ void getRandomHexChars(char *p, unsigned int len) {
}
if (l >= sizeof(pid)) {
memcpy(x,&pid,sizeof(pid));
- l -= sizeof(pid);
- x += sizeof(pid);
}
/* Finally xor it with rand() output, that was already seeded with
* time() at startup. */
Something went wrong with that request. Please try again.