php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67623
Patch gearman-ssl.patch revision 2014-07-17 07:24 UTC by chjgcn at gmail dot com
revision 2014-07-15 12:59 UTC by chjgcn at gmail dot com

Patch gearman-ssl.patch for gearman Bug #67623

Patch version 2014-07-17 07:24 UTC

Return to Bug #67623 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2014-07-17 07:24 UTC | 2014-07-15 12:59 UTC

Developer: chjgcn@gmail.com



  --- php_gearman.c	2013-08-29 13:03:54.000000000 +0800
 +++ php_gearman.c	2014-07-15 19:18:35.275197932 +0800
 +++ php_gearman.c	2014-07-17 14:57:14.578545921 +0800
  @@ -378,6 +378,21 @@
   	ZEND_ARG_INFO(0, timeout)
   ZEND_END_ARG_INFO()
   


  +
   /* {{{ proto bool gearman_client_add_server(object client [, string host [, int port]])
      Add a job server to a client. This goes into a list of servers than can be used to run tasks. No socket I/O happens here, it is just added to a list. */
   PHP_FUNCTION(gearman_client_add_server) {
 @@ -3348,6 +3413,41 @@
 @@ -1908,10 +1973,6 @@
  		RETURN_FALSE;
  	}
  
 -	if (!gearman_client_set_server_option(&(obj->client), "exceptions", (sizeof("exceptions") - 1))) {
 -	    GEARMAN_EXCEPTION("Failed to set exception option", 0);
 -	}
 -
  	RETURN_TRUE;
  }
  /* }}} */
 @@ -1934,10 +1995,6 @@
  		RETURN_FALSE;
  	}
  
 -	if (!gearman_client_set_server_option(&(obj->client), "exceptions", (sizeof("exceptions") - 1))) {
 -	    GEARMAN_EXCEPTION("Failed to set exception option", 0);
 -	}
 -
  	RETURN_TRUE;
  }
  /* }}} */
 @@ -3055,6 +3112,12 @@
  	obj->zexception_fn= zexception_fn;
  	Z_ADDREF_P(zexception_fn);
  
 +	if (!gearman_client_has_option(&(obj->client), GEARMAN_CLIENT_EXCEPTION)) {
 +		if (!gearman_client_set_server_option(&(obj->client), "exceptions", (sizeof("exceptions") - 1))) {
 +			GEARMAN_EXCEPTION("Failed to set exception option", 0);
 +		}
 +	}
 +
  	/* set the callback for php */
  	gearman_client_set_exception_fn(&(obj->client), _php_task_exception_fn);
  
 @@ -3348,6 +3411,41 @@
   }
   /* }}} */
   
  +/* {{{ proto void gearman_worker_set_ssl(object worker, constant timeout, constant ca_file,


  +				 &key_file, &key_file_len)
  +
  +	if (ca_file == NULL) {
  +		cfg_get_string("gearman.ssl_ca_file", &ca_file);
 +	}
 +	}
  +	if (certificate == NULL) {
  +		cfg_get_string("gearman.ssl_certificate", &certificate);
  +	}
  +	if (key_file == NULL) {


  +
   /* {{{ proto void gearman_worker_set_id(object worker, string id)
      Set id for a worker structure. */
   PHP_FUNCTION(gearman_worker_set_id) {
 @@ -4107,6 +4207,7 @@
 @@ -3385,10 +3483,6 @@
  		RETURN_FALSE;
  	}
  
 -	if (! gearman_worker_set_server_option(&(obj->worker), "exceptions", (sizeof("exceptions") - 1))) {
 -		GEARMAN_EXCEPTION("Failed to set exception option", 0);
 -	}
 -
  	RETURN_TRUE;
  }
  /* }}} */
 @@ -3411,10 +3505,6 @@
  		RETURN_FALSE;
  	}
  
 -	if (! gearman_worker_set_server_option(&(obj->worker), "exceptions", (sizeof("exceptions") - 1))) {
 -		GEARMAN_EXCEPTION("Failed to set exception option", 0);
 -	}
 -
  	RETURN_TRUE;
  }
  /* }}} */
 @@ -4107,6 +4197,7 @@
   	PHP_FE(gearman_client_remove_options, arginfo_gearman_client_remove_options)
   	PHP_FE(gearman_client_timeout, arginfo_gearman_client_timeout)
   	PHP_FE(gearman_client_set_timeout, arginfo_gearman_client_set_timeout)
  +	PHP_FE(gearman_client_set_ssl, arginfo_gearman_client_set_ssl)
   	PHP_FE(gearman_client_context, arginfo_gearman_client_context)
   	PHP_FE(gearman_client_set_context, arginfo_gearman_client_set_context)
   #if jluedke_0
 @@ -4184,6 +4285,7 @@
 @@ -4184,6 +4275,7 @@
   	PHP_FE(gearman_worker_remove_options, arginfo_gearman_worker_remove_options)
   	PHP_FE(gearman_worker_timeout, arginfo_gearman_worker_timeout)
   	PHP_FE(gearman_worker_set_timeout, arginfo_gearman_worker_set_timeout)
  +	PHP_FE(gearman_worker_set_ssl, arginfo_gearman_worker_set_ssl)
   	PHP_FE(gearman_worker_set_id, arginfo_gearman_worker_set_id)
   #if jluedke_0
   	PHP_FE(gearman_worker_context, arginfo_gearman_worker_context)
 @@ -4274,6 +4376,7 @@
 @@ -4274,6 +4366,7 @@
   	__PHP_ME_MAPPING(removeOptions, gearman_client_remove_options, arginfo_oo_gearman_client_remove_options, 0)
   	__PHP_ME_MAPPING(timeout, gearman_client_timeout, arginfo_oo_gearman_client_timeout, 0)
   	__PHP_ME_MAPPING(setTimeout, gearman_client_set_timeout, arginfo_oo_gearman_client_set_timeout, 0)
  +	__PHP_ME_MAPPING(setSSL, gearman_client_set_ssl, arginfo_oo_gearman_client_set_ssl, 0)
   	__PHP_ME_MAPPING(context, gearman_client_context, arginfo_oo_gearman_client_context, 0)
   	__PHP_ME_MAPPING(setContext, gearman_client_set_context, arginfo_oo_gearman_client_set_context, 0)
   #if jluedke_0
 @@ -4357,6 +4460,7 @@
 @@ -4357,6 +4450,7 @@
   	__PHP_ME_MAPPING(removeOptions, gearman_worker_remove_options, arginfo_oo_gearman_worker_remove_options, 0)
   	__PHP_ME_MAPPING(timeout, gearman_worker_timeout, arginfo_oo_gearman_worker_timeout, 0)
   	__PHP_ME_MAPPING(setTimeout, gearman_worker_set_timeout, arginfo_oo_gearman_worker_set_timeout, 0)
  +	__PHP_ME_MAPPING(setSSL, gearman_worker_set_ssl, arginfo_oo_gearman_worker_set_ssl, 0)
   	__PHP_ME_MAPPING(setId, gearman_worker_set_id, arginfo_oo_gearman_worker_set_id, 0)
   #if jluedke_0
   	__PHP_ME_MAPPING(context, gearman_worker_context, arginfo_oo_gearman_worker_context, 0)
 @@ -4894,6 +4988,15 @@
  	REGISTER_LONG_CONSTANT("GEARMAN_CLIENT_FREE_TASKS",
  		GEARMAN_CLIENT_FREE_TASKS,
  		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_CLIENT_GENERATE_UNIQUE",
 +		GEARMAN_CLIENT_GENERATE_UNIQUE,
 +		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_CLIENT_EXCEPTION",
 +		GEARMAN_CLIENT_EXCEPTION,
 +		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_CLIENT_SSL",
 +		GEARMAN_CLIENT_SSL,
 +		CONST_CS | CONST_PERSISTENT);
  	REGISTER_LONG_CONSTANT("GEARMAN_CLIENT_STATE_IDLE",
  		GEARMAN_CLIENT_STATE_IDLE,
  		CONST_CS | CONST_PERSISTENT);
 @@ -4933,6 +5036,15 @@
  	REGISTER_LONG_CONSTANT("GEARMAN_WORKER_TIMEOUT_RETURN",
  		GEARMAN_WORKER_TIMEOUT_RETURN,
  		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_WORKER_GRAB_ALL",
 +		GEARMAN_WORKER_GRAB_ALL,
 +		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_WORKER_SSL",
 +		GEARMAN_WORKER_SSL,
 +		CONST_CS | CONST_PERSISTENT);
 +	REGISTER_LONG_CONSTANT("GEARMAN_WORKER_IDENTIFIER",
 +		GEARMAN_WORKER_IDENTIFIER,
 +		CONST_CS | CONST_PERSISTENT);
  	REGISTER_LONG_CONSTANT("GEARMAN_WORKER_STATE_START",
  		GEARMAN_WORKER_STATE_START,
  		CONST_CS | CONST_PERSISTENT);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 23:01:30 2024 UTC