7bf5fab1fa2fa07cc012c0570781aea23343ae05 | bcca862eaaeeb4e5a739a9107f8ae073ef6a37b3 | ||
---|---|---|---|
525 | try: | 525 | try: |
526 | for key in server_keys[server]: # These are mangled keys | 526 | for key in server_keys[server]: # These are mangled keys |
527 | store_info = self._val_to_store_info(mapping[prefixed_to_orig_key[key]], min_compress_len) | 527 | store_info = self._val_to_store_info(mapping[prefixed_to_orig_key[key]], min_compress_len) |
528 | if not store_info: | ||
529 | continue | ||
528 | write("set %s %d %d %d\r\n%s\r\n" % (key, store_info[0], time, store_info[1], store_info[2])) | 530 | write("set %s %d %d %d\r\n%s\r\n" % (key, store_info[0], time, store_info[1], store_info[2])) |
529 | server.send_cmds(''.join(bigcmd)) | 531 | server.send_cmds(''.join(bigcmd)) |
530 | except socket.error, msg: | 532 | except socket.error, msg: |
... | ... | ||
568 | min_compress_len = 0 | 570 | min_compress_len = 0 |
569 | else: | 571 | else: |
570 | flags |= Client._FLAG_PICKLE | 572 | flags |= Client._FLAG_PICKLE |
571 | val = pickle.dumps(val, 0) # Ack! JLR hacks it so that LinkedDict unpicling works w/o figuring out __reduce__. | 573 | val = pickle.dumps(val, -1) # Ack! JLR hacks it so that LinkedDict unpicling works w/o figuring out __reduce__. |
572 | 574 | ||
573 | # silently do not store if value length exceeds maximum | 575 | # silently do not store if value length exceeds maximum |
574 | if len(val) >= SERVER_MAX_VALUE_LENGTH: return(0) | 576 | if len(val) >= SERVER_MAX_VALUE_LENGTH: |
577 | return (0) | ||
575 | 578 | ||
576 | lv = len(val) | 579 | lv = len(val) |
577 | # We should try to compress if min_compress_len > 0 and we could import zlib and this string is longer than our min threshold. | 580 | # We should try to compress if min_compress_len > 0 and we could import zlib and this string is longer than our min threshold. |
... | ... | ||
593 | self._statlog(cmd) | 596 | self._statlog(cmd) |
594 | 597 | ||
595 | store_info = self._val_to_store_info(val, min_compress_len) | 598 | store_info = self._val_to_store_info(val, min_compress_len) |
599 | if not store_info: | ||
600 | return 0 | ||
596 | 601 | ||
597 | fullcmd = "%s %s %d %d %d\r\n%s" % (cmd, key, store_info[0], time, store_info[1], store_info[2]) | 602 | fullcmd = "%s %s %d %d %d\r\n%s" % (cmd, key, store_info[0], time, store_info[1], store_info[2]) |
598 | try: | 603 | try: |