@@ -12,6 +12,7 @@ namespace acl {
1212
1313class token_tree ;
1414class socket_stream ;
15+ class sslbase_conf ;
1516class redis_client ;
1617
1718typedef enum {
@@ -192,6 +193,7 @@ class redis_pipeline_channel : public thread {
192193 void stop_thread ();
193194
194195public:
196+ redis_pipeline_channel& set_ssl_conf (sslbase_conf* ssl_conf);
195197 redis_pipeline_channel& set_passwd (const char * passwd);
196198 const char * get_addr () const {
197199 return addr_.c_str ();
@@ -229,13 +231,13 @@ class redis_pipeline_channel : public thread {
229231class ACL_CPP_API redis_client_pipeline : public thread {
230232public:
231233 redis_client_pipeline (const char * addr, box_type_t type = BOX_TYPE_MBOX);
232- virtual ~redis_client_pipeline (void );
234+ virtual ~redis_client_pipeline ();
233235
234236 // Start the pipeline thread
235- void start_thread (void );
237+ void start_thread ();
236238
237239 // Stop the pipeline thread
238- void stop_thread (void );
240+ void stop_thread ();
239241
240242public:
241243 // Called by redis_command in pipeline mode
@@ -246,9 +248,12 @@ class ACL_CPP_API redis_client_pipeline : public thread {
246248
247249 // Called by redis_command::get_pipeline_message, and can be overrided
248250 // by child class. The box can be tbox, tbox_array, mbox, or fiber_tbox.
249- virtual box<redis_pipeline_message>* create_box (void );
251+ virtual box<redis_pipeline_message>* create_box ();
250252
251253public:
254+ // Set the ssl conf for the connection with redis internal.
255+ redis_client_pipeline& set_ssl_conf (sslbase_conf* ssl_conf);
256+
252257 // Set the password for connecting the redis server
253258 redis_client_pipeline& set_password (const char * passwd);
254259
@@ -265,17 +270,18 @@ class ACL_CPP_API redis_client_pipeline : public thread {
265270 redis_client_pipeline& set_preconnect (bool yes);
266271
267272 // Get the max hash slot of redis
268- int get_max_slot (void ) const {
273+ int get_max_slot () const {
269274 return max_slot_;
270275 }
271276
272277protected:
273278 // @override from acl::thread
274- void * run (void );
279+ void * run ();
275280
276281private:
277282 string addr_; // The default redis address
278283 string passwd_; // Password for connecting redis
284+ sslbase_conf* ssl_conf_;// SSL will be used if not null
279285 box_type_t box_type_; // The type of box
280286 int max_slot_; // The max hash slot for redis cluster
281287 int conn_timeout_; // Timeout to connect redis
@@ -295,13 +301,13 @@ class ACL_CPP_API redis_client_pipeline : public thread {
295301 void set_slot (int slot, const char * addr);
296302
297303 // Set all hash slots' addresses of all redises
298- void set_all_slot (void );
304+ void set_all_slot ();
299305
300306 // Start all pipeline channels threads
301- void start_channels (void );
307+ void start_channels ();
302308
303309 // Stop all pipeline channels threads
304- void stop_channels (void );
310+ void stop_channels ();
305311
306312 // Start one pipeline channel thread with the specified redis address
307313 redis_pipeline_channel* start_channel (const char * addr);
@@ -326,7 +332,7 @@ class ACL_CPP_API redis_client_pipeline : public thread {
326332
327333/* *
328334 * Sample:
329- * void main_thread(void ) {
335+ * void main_thread() {
330336 * acl::redis_client_pipeline pipeline("127.0.0.1:6379");
331337 * pipeline.start_thread();
332338 * // Start some threads
0 commit comments