Browse Source

Only send packets compressed if they're smaller

master
Con Kolivas 9 years ago
parent
commit
4a52065a55
  1. 6
      src/ckpool.c

6
src/ckpool.c

@ -744,6 +744,12 @@ int write_cs(connsock_t *cs, const char *buf, int len)
ret = write_socket(cs->fd, buf, len); ret = write_socket(cs->fd, buf, len);
goto out; goto out;
} }
if (compsize + 12 >= len) {
/* Selectively send compressed packets only when they're
* smaller. */
ret = write_socket(cs->fd, buf, len);
goto out;
}
LOGDEBUG("Writing connsock message compressed %d from %d", compsize, decompsize); LOGDEBUG("Writing connsock message compressed %d from %d", compsize, decompsize);
/* Copy lz4 magic header */ /* Copy lz4 magic header */
sprintf(dest, "lz4\n"); sprintf(dest, "lz4\n");

Loading…
Cancel
Save