Merge lp:~dshrews/gearmand/gearman_cli_ssl into lp:gearmand

Proposed by David Shrewsbury on 2013-07-09
Status: Merged
Merged at revision: 819
Proposed branch: lp:~dshrews/gearmand/gearman_cli_ssl
Merge into: lp:gearmand
Diff against target: 91 lines (+23/-1)
3 files modified
bin/arguments.cc (+6/-1)
bin/arguments.h (+6/-0)
bin/gearman.cc (+11/-0)
To merge this branch: bzr merge lp:~dshrews/gearmand/gearman_cli_ssl
Reviewer Review Type Date Requested Status
Brian Aker (community) 2013-07-09 Approve on 2013-07-09
Review via email: mp+173797@code.launchpad.net

Description of the change

Adds a -S option for the 'gearman' CLI client.

Currently, it just uses the compiled in location for the keys (or the ENV overrides). I want to add command line options to specify the locations in a future branch rather than this one.

To post a comment you must log in.
Brian Aker (brianaker) wrote :
Download full text (3.1 KiB)

Merge it :)

On Jul 9, 2013, at 12:26 PM, David Shrewsbury <email address hidden> wrote:

> David Shrewsbury has proposed merging lp:~dshrews/gearmand/gearman_cli_ssl into lp:gearmand.
>
> Requested reviews:
> Brian Aker (brianaker)
>
> For more details, see:
> https://code.launchpad.net/~dshrews/gearmand/gearman_cli_ssl/+merge/173797
>
> Adds a -S option for the 'gearman' CLI client.
>
> Currently, it just uses the compiled in location for the keys (or the ENV overrides). I want to add command line options to specify the locations in a future branch rather than this one.
> --
> https://code.launchpad.net/~dshrews/gearmand/gearman_cli_ssl/+merge/173797
> You are requested to review the proposed merge of lp:~dshrews/gearmand/gearman_cli_ssl into lp:gearmand.
> === modified file 'bin/arguments.cc'
> --- bin/arguments.cc 2013-04-29 14:05:49 +0000
> +++ bin/arguments.cc 2013-07-09 19:25:31 +0000
> @@ -71,6 +71,7 @@
> _daemon(false),
> _usage(false),
> _is_error(false),
> + _use_ssl(false),
> _arg_error(NULL),
> _priority(GEARMAN_JOB_PRIORITY_NORMAL),
> _timeout(-1),
> @@ -91,7 +92,7 @@
>
> opterr= 0;
>
> - while ((c = getopt(argc, argv, "bc:f:h:HILnNp:Pst:u:vwi:d")) != -1)
> + while ((c = getopt(argc, argv, "bc:f:h:HILnNp:Pst:u:vwi:dS")) != -1)
> {
> switch(c)
> {
> @@ -168,6 +169,10 @@
> _verbose= true;
> break;
>
> + case 'S':
> + _use_ssl= true;
> + break;
> +
> default:
> _is_error= true;
>
>
> === modified file 'bin/arguments.h'
> --- bin/arguments.h 2013-04-29 14:05:49 +0000
> +++ bin/arguments.h 2013-07-09 19:25:31 +0000
> @@ -161,6 +161,11 @@
> return _suppress_input;
> }
>
> + bool use_ssl() const
> + {
> + return _use_ssl;
> + }
> +
> const char *argument(size_t arg)
> {
> return argv[arg];
> @@ -220,6 +225,7 @@
> bool _daemon;
> bool _usage;
> bool _is_error;
> + bool _use_ssl;
> char *_arg_error;
> gearman_job_priority_t _priority;
> int _timeout;
>
> === modified file 'bin/gearman.cc'
> --- bin/gearman.cc 2013-03-15 21:54:07 +0000
> +++ bin/gearman.cc 2013-07-09 19:25:31 +0000
> @@ -263,6 +263,11 @@
> return;
> }
>
> + if (args.use_ssl())
> + {
> + gearman_client_add_options(&client, GEARMAN_CLIENT_SSL);
> + }
> +
> gearman_client_set_created_fn(&client, _client_created);
> gearman_client_set_data_fn(&client, _client_data);
> gearman_client_set_warning_fn(&client, _client_warning);
> @@ -520,6 +525,11 @@
> _exit(EXIT_FAILURE);
> }
>
> + if (args.use_ssl())
> + {
> + gearman_worker_add_options(&worker, GEARMAN_WORKER_SSL);
> + }
> +
> gearman_worker_set_workload_free_fn(&worker, _worker_free, NULL);
>
> for (Function::vector::iterator iter= args.begin();
> @@ -784,6 +794,7 @@
> fprintf(stream, "\t-p <port> - Job server port\n");
> fprintf(stream, "\t-t <timeout> - Timeout in milliseconds\n");
> fprintf(stream, "\t-i <pidfile> - Create a pidfile for the process\n");
> + fprintf(stream, "\t-S - Enable SSL connections\n");
>
> fprintf(stream, "\nClient options:\n");
> fprintf(stream, "\t-b - Run jobs in the background(%s)\n", args.background() ? "tru...

Read more...

Brian Aker (brianaker) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/arguments.cc'
2--- bin/arguments.cc 2013-04-29 14:05:49 +0000
3+++ bin/arguments.cc 2013-07-09 19:25:31 +0000
4@@ -71,6 +71,7 @@
5 _daemon(false),
6 _usage(false),
7 _is_error(false),
8+ _use_ssl(false),
9 _arg_error(NULL),
10 _priority(GEARMAN_JOB_PRIORITY_NORMAL),
11 _timeout(-1),
12@@ -91,7 +92,7 @@
13
14 opterr= 0;
15
16- while ((c = getopt(argc, argv, "bc:f:h:HILnNp:Pst:u:vwi:d")) != -1)
17+ while ((c = getopt(argc, argv, "bc:f:h:HILnNp:Pst:u:vwi:dS")) != -1)
18 {
19 switch(c)
20 {
21@@ -168,6 +169,10 @@
22 _verbose= true;
23 break;
24
25+ case 'S':
26+ _use_ssl= true;
27+ break;
28+
29 default:
30 _is_error= true;
31
32
33=== modified file 'bin/arguments.h'
34--- bin/arguments.h 2013-04-29 14:05:49 +0000
35+++ bin/arguments.h 2013-07-09 19:25:31 +0000
36@@ -161,6 +161,11 @@
37 return _suppress_input;
38 }
39
40+ bool use_ssl() const
41+ {
42+ return _use_ssl;
43+ }
44+
45 const char *argument(size_t arg)
46 {
47 return argv[arg];
48@@ -220,6 +225,7 @@
49 bool _daemon;
50 bool _usage;
51 bool _is_error;
52+ bool _use_ssl;
53 char *_arg_error;
54 gearman_job_priority_t _priority;
55 int _timeout;
56
57=== modified file 'bin/gearman.cc'
58--- bin/gearman.cc 2013-03-15 21:54:07 +0000
59+++ bin/gearman.cc 2013-07-09 19:25:31 +0000
60@@ -263,6 +263,11 @@
61 return;
62 }
63
64+ if (args.use_ssl())
65+ {
66+ gearman_client_add_options(&client, GEARMAN_CLIENT_SSL);
67+ }
68+
69 gearman_client_set_created_fn(&client, _client_created);
70 gearman_client_set_data_fn(&client, _client_data);
71 gearman_client_set_warning_fn(&client, _client_warning);
72@@ -520,6 +525,11 @@
73 _exit(EXIT_FAILURE);
74 }
75
76+ if (args.use_ssl())
77+ {
78+ gearman_worker_add_options(&worker, GEARMAN_WORKER_SSL);
79+ }
80+
81 gearman_worker_set_workload_free_fn(&worker, _worker_free, NULL);
82
83 for (Function::vector::iterator iter= args.begin();
84@@ -784,6 +794,7 @@
85 fprintf(stream, "\t-p <port> - Job server port\n");
86 fprintf(stream, "\t-t <timeout> - Timeout in milliseconds\n");
87 fprintf(stream, "\t-i <pidfile> - Create a pidfile for the process\n");
88+ fprintf(stream, "\t-S - Enable SSL connections\n");
89
90 fprintf(stream, "\nClient options:\n");
91 fprintf(stream, "\t-b - Run jobs in the background(%s)\n", args.background() ? "true" : "false");

Subscribers

People subscribed via source and target branches

to all changes: