Skip to content
This repository

Fixed #681 - redis-cli --pipe no longer hangs when malformed protocol data is sent. #951

Closed
wants to merge 2 commits into from

2 participants

Daniel Levin Salvatore Sanfilippo
Daniel Levin

redis-cli (with the --pipe option) now exits with an error message instead of hanging forever. This fixes #681.

Salvatore Sanfilippo
Owner

Fixed in some other way, but thanks a lot for your contrib.

Salvatore Sanfilippo antirez closed this July 03, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Feb 16, 2013
Daniel Levin Stops redis-cli --pipe from blocking with malformed protocol data (#681)
This fixes the issue #681. Now, redis-cli exits when the piped data
contains syntax errors.
49d7388
Daniel Levin Removed a stray line from the debugging process deffcf6
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  src/redis-cli.c
5  src/redis-cli.c
@@ -1111,6 +1111,11 @@ static void pipeMode(void) {
1111 1111
                 }
1112 1112
             } while(reply);
1113 1113
         }
  1114
+        
  1115
+        if (errors > 0) {
  1116
+            fprintf(stderr, "Error processing protocol data. It is probably malformed.\n");
  1117
+            exit(1);
  1118
+        }
1114 1119
 
1115 1120
         /* Handle the writable state: we can send protocol to the server. */
1116 1121
         if (mask & AE_WRITABLE) {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.