Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Incorrect -t command-line options check #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run ./memcached -p 44444 -t 0
2. echo "stats" | netcat localhost 44444

Attached patch fix this bug.

Original issue reported on code.google.com by dmitry.i...@gmail.com on 17 Sep 2009 at 12:32

Attachments:

GoogleCodeExporter commented 9 years ago
This patch is slightly confusing:

             if (settings.num_threads == 1) {
                 fprintf(stderr, "Number of threads must be greater than 0\n");

Perhaps we should do the check, *then* add the dispatch thread.

Original comment by dsalli...@gmail.com on 17 Sep 2009 at 6:08

GoogleCodeExporter commented 9 years ago
May be change -t and settings.num_threads meaning (== number of worker threads).

It would be a more clean code.

Original comment by dmitry.i...@gmail.com on 17 Sep 2009 at 9:34

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, I wrote a test for this and pushed it with a more detailed message.

Original comment by dsalli...@gmail.com on 18 Sep 2009 at 11:19