php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64671
Patch stomp-patch-whitespace-at-eol revision 2013-04-18 18:49 UTC by mi+php at aldan dot algebra dot com
Patch stomp-patch-nack revision 2013-04-18 18:47 UTC by mi+php at aldan dot algebra dot com

Patch stomp-patch-whitespace-at-eol for stomp Bug #64671

Patch version 2013-04-18 18:49 UTC

Return to Bug #64671 | Download this patch
Patch Revisions:

Developer: mi+php@aldan.algebra.com

--- php_stomp.c	2012-11-18 17:35:40.000000000 -0500
+++ php_stomp.c	2013-04-18 12:48:19.000000000 -0400
@@ -37,5 +37,5 @@
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, PHP_STOMP_ERR_NO_CTR); \
 		RETURN_FALSE; \
-	} 
+	}
 
 #define INIT_FRAME_L(frame, cmd, l) \
@@ -66,5 +66,5 @@
 			efree(string_key); \
 		} \
-	} 
+	}
 
 #define CLEAR_FRAME(frame) \
@@ -80,5 +80,5 @@
 	if (stomp_object) { \
 		zend_throw_exception_ex(stomp_ce_exception, errno TSRMLS_CC, msg); \
-	} 
+	}
 
 #define STOMP_ERROR_DETAILS(errno, msg, details) \
@@ -146,5 +146,5 @@
 
 ZEND_BEGIN_ARG_INFO_EX(stomp_readframe_args, 0, 0, 1)
-ZEND_ARG_INFO(0, link)	
+ZEND_ARG_INFO(0, link)
 ZEND_ARG_INFO(0, class_name)
 ZEND_END_ARG_INFO()
@@ -191,5 +191,5 @@
 ZEND_ARG_ARRAY_INFO(0, headers, 1)
 ZEND_ARG_INFO(0, body)
-ZEND_END_ARG_INFO()    
+ZEND_END_ARG_INFO()
 /* }}} */
 
@@ -243,5 +245,5 @@
 	{NULL, NULL, NULL}
 };
-/* }}} */ 
+/* }}} */
 
 /* {{{ stomp_exception_methods[] */
@@ -261,5 +263,5 @@
 	PHP_MINIT(stomp),
 	PHP_MSHUTDOWN(stomp),
-	PHP_RINIT(stomp),    
+	PHP_RINIT(stomp),
 	PHP_RSHUTDOWN(stomp),
 	PHP_MINFO(stomp),
@@ -306,7 +308,7 @@
 static void stomp_send_disconnect(stomp_t *stomp TSRMLS_DC)
 {
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	INIT_FRAME(frame, "DISCONNECT");
-	
+
 	stomp_send(stomp, &frame TSRMLS_CC);
 	CLEAR_FRAME(frame);
@@ -318,5 +320,5 @@
 	stomp_send_disconnect(stomp TSRMLS_CC);
 	stomp_close(stomp);
-} 
+}
 
 static void stomp_object_free_storage(stomp_object_t *intern TSRMLS_DC)
@@ -330,19 +332,19 @@
 }
 
-	 
+
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
-#define PHP_STOMP_RUNTIME_CACHE 
-#endif 
+#define PHP_STOMP_RUNTIME_CACHE
+#endif
 static zend_object_value php_stomp_new(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value retval;
 	stomp_object_t *intern;
-#ifndef PHP_STOMP_RUNTIME_CACHE	
+#ifndef PHP_STOMP_RUNTIME_CACHE
 	zval *tmp;
-#endif	
+#endif
 
 	intern = (stomp_object_t *) ecalloc(1, sizeof(stomp_object_t));
 	intern->stomp = NULL;
-	
+
 	zend_object_std_init(&intern->std, ce TSRMLS_CC);
 #ifdef PHP_STOMP_RUNTIME_CACHE
@@ -379,5 +381,5 @@
 	zend_declare_property_null(stomp_ce_frame, "command", sizeof("command")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
 	zend_declare_property_null(stomp_ce_frame, "headers", sizeof("headers")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
-	zend_declare_property_null(stomp_ce_frame, "body", sizeof("body")-1, ZEND_ACC_PUBLIC TSRMLS_CC); 
+	zend_declare_property_null(stomp_ce_frame, "body", sizeof("body")-1, ZEND_ACC_PUBLIC TSRMLS_CC);
 
 	/* Register StompException class */
@@ -397,5 +399,5 @@
 /* {{{ PHP_MSHUTDOWN_FUNCTION */
 PHP_MSHUTDOWN_FUNCTION(stomp)
-{ 
+{
 	/* Unregister INI entries */
 	UNREGISTER_INI_ENTRIES();
@@ -441,7 +443,7 @@
 /* }}} */
 
-/* {{{ proto string stomp_version() 
+/* {{{ proto string stomp_version()
    Get stomp extension version */
-PHP_FUNCTION(stomp_version) 
+PHP_FUNCTION(stomp_version)
 {
 	RETURN_STRINGL(PHP_STOMP_VERSION, sizeof(PHP_STOMP_VERSION)-1, 1);
@@ -460,7 +462,7 @@
 	php_url *url_parts;
 
-#ifdef HAVE_STOMP_SSL    
+#ifdef HAVE_STOMP_SSL
 	int use_ssl = 0;
-#endif    
+#endif
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssa!", &broker, &broker_len, &username, &username_len, &password, &password_len, &headers) == FAILURE) {
@@ -474,5 +476,5 @@
 
 	url_parts = php_url_parse_ex(broker, strlen(broker));
-	
+
 	if (!url_parts || !url_parts->host) {
 		STOMP_ERROR(0, PHP_STOMP_ERR_INVALID_BROKER_URI);
@@ -489,5 +491,5 @@
 			php_url_free(url_parts);
 			return;
-#endif        
+#endif
 		} else if (strcmp(url_parts->scheme, "tcp") != 0) {
 			STOMP_ERROR(0, PHP_STOMP_ERR_INVALID_BROKER_URI_SCHEME);
@@ -501,5 +503,5 @@
 #if HAVE_STOMP_SSL
 	stomp->options.use_ssl = use_ssl;
-#endif 
+#endif
 
 	stomp->options.read_timeout_sec     = STOMP_G(read_timeout_sec);
@@ -514,5 +516,5 @@
 		stomp_frame_t *res;
 		stomp_frame_t frame = {0};
- 
+
 		INIT_FRAME(frame, "CONNECT");
 		if (username_len == 0) {
@@ -524,5 +526,5 @@
 		zend_hash_add(frame.headers, "login", sizeof("login"), username, username_len + 1, NULL);
 		zend_hash_add(frame.headers, "passcode", sizeof("passcode"), password, password_len + 1, NULL);
- 
+
 		if (NULL != headers) {
 			FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(headers));
@@ -531,5 +533,5 @@
 		stomp_send(stomp, &frame TSRMLS_CC);
 		CLEAR_FRAME(frame);
- 
+
 		/* Retreive Response */
 		res = stomp_read_frame(stomp);
@@ -556,5 +558,5 @@
 			if (!stomp_object) {
 				ZEND_REGISTER_RESOURCE(return_value, stomp, le_stomp);
-				return; 
+				return;
 			} else {
 				stomp_object_t *i_obj = (stomp_object_t *) zend_object_store_get_object(stomp_object TSRMLS_CC);
@@ -565,5 +567,5 @@
 				RETURN_TRUE;
 			}
-		} 
+		}
 	} else {
 		STOMP_ERROR_DETAILS(0, stomp->error, stomp->error_details);
@@ -575,7 +577,7 @@
 /* }}} */
 
-/* {{{ proto string stomp_connect_error() 
+/* {{{ proto string stomp_connect_error()
    Get the last connection error */
-PHP_FUNCTION(stomp_connect_error) 
+PHP_FUNCTION(stomp_connect_error)
 {
 	if (STOMP_G(error_msg)) {
@@ -587,5 +589,5 @@
 /* }}} */
 
-/* {{{ proto string Stomp::getSessionId() 
+/* {{{ proto string Stomp::getSessionId()
    Get the current stomp session ID */
 PHP_FUNCTION(stomp_get_session_id)
@@ -601,5 +603,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -635,5 +637,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 		zend_list_delete(Z_RESVAL_P(arg));
 	}
@@ -652,5 +654,5 @@
 	int destination_length = 0;
 	zval *msg = NULL, *headers = NULL;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
@@ -659,5 +661,5 @@
 		if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|a!", &destination, &destination_length, &msg, &headers) == FAILURE) {
 			return;
-		} 
+		}
 		FETCH_STOMP_OBJECT;
 	} else {
@@ -666,5 +668,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -676,5 +678,5 @@
 
 	INIT_FRAME(frame, "SEND");
-	
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
@@ -684,5 +686,5 @@
 	/* Add the destination */
 	zend_hash_add(frame.headers, "destination", sizeof("destination"), destination, destination_length + 1, NULL);
-	 
+
 	if (Z_TYPE_P(msg) == IS_STRING) {
 		frame.body = Z_STRVAL_P(msg);
@@ -728,5 +730,5 @@
 	int destination_length = 0;
 	zval *headers = NULL;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
@@ -742,5 +744,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -752,5 +754,5 @@
 
 	INIT_FRAME(frame, "SUBSCRIBE");
-	 
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
@@ -761,5 +763,5 @@
 	zend_hash_add(frame.headers, "ack", sizeof("ack"), "client", sizeof("client"), NULL);
 	zend_hash_add(frame.headers, "destination", sizeof("destination"), destination, destination_length + 1, NULL);
-	zend_hash_add(frame.headers, "activemq.prefetchSize", sizeof("activemq.prefetchSize"), "1", sizeof("1"), NULL); 
+	zend_hash_add(frame.headers, "activemq.prefetchSize", sizeof("activemq.prefetchSize"), "1", sizeof("1"), NULL);
 
 	if (stomp_send(stomp, &frame TSRMLS_CC) > 0) {
@@ -781,5 +783,5 @@
 	int destination_length = 0;
 	zval *headers = NULL;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
@@ -795,5 +797,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -805,5 +807,5 @@
 
 	INIT_FRAME(frame, "UNSUBSCRIBE");
-	 
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
@@ -823,7 +825,7 @@
 /* }}} */
 
-/* {{{ proto boolean Stomp::hasFrame() 
+/* {{{ proto boolean Stomp::hasFrame()
    Indicate whether or not there is a frame ready to read */
-PHP_FUNCTION(stomp_has_frame) 
+PHP_FUNCTION(stomp_has_frame)
 {
 	zval *stomp_object = getThis();
@@ -844,5 +846,5 @@
 /* }}} */
 
-/* {{{ proto StompFrame Stomp::readFrame() 
+/* {{{ proto StompFrame Stomp::readFrame()
    Read the next frame */
 PHP_FUNCTION(stomp_read_frame)
@@ -869,5 +871,5 @@
 	}
 
-	if (class_name_len > 0) { 
+	if (class_name_len > 0) {
 		ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
 		if (!ce) {
@@ -895,5 +897,5 @@
 			}
 		}
-	
+
 		MAKE_STD_ZVAL(headers);
 		array_init(headers);
@@ -911,5 +913,5 @@
 			}
 		}
-		
+
 		if (ce) {
 			zend_fcall_info fci;
@@ -922,8 +924,8 @@
 				zval *cmd = NULL, *body = NULL;
 				ALLOC_ZVAL(cmd);
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)								
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)
 				Z_SET_REFCOUNT_P(cmd, 1);
 				Z_UNSET_ISREF_P(cmd);
-#else 
+#else
 				cmd->refcount = 1;
 				cmd->is_ref = 0;
@@ -932,6 +934,6 @@
 
 				ALLOC_ZVAL(body);
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)				
-				Z_SET_REFCOUNT_P(body, 1); 
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)
+				Z_SET_REFCOUNT_P(body, 1);
 				Z_UNSET_ISREF_P(body);
 #else
@@ -951,7 +953,7 @@
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)
 				fci.object_ptr = return_value;
-#else 
+#else
 				fci.object_pp = &return_value;
-#endif				
+#endif
 				fci.retval_ptr_ptr = &retval_ptr;
 
@@ -968,10 +970,10 @@
 				fcc.function_handler = ce->constructor;
 				fcc.calling_scope = EG(scope);
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)				
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION > 5)
 				fcc.called_scope = Z_OBJCE_P(return_value);
 				fcc.object_ptr = return_value;
 #else
 				fcc.object_pp = &return_value;
-#endif				
+#endif
 				if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
 					zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
@@ -984,5 +986,5 @@
 					efree(fci.params);
 				}
-			
+
 				zval_ptr_dtor(&cmd);
 				zval_ptr_dtor(&body);
@@ -1012,5 +1014,5 @@
 	char *transaction_id = NULL;
 	int transaction_id_length = 0;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 	zval *headers = NULL;
@@ -1020,5 +1022,5 @@
 		if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &transaction_id, &transaction_id_length, &headers) == FAILURE) {
 			return;
-		} 
+		}
 		FETCH_STOMP_OBJECT;
 	} else {
@@ -1027,10 +1029,10 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
 	INIT_FRAME_L(frame, cmd, strlen(cmd));
 
-	if (transaction_id_length > 0) { 
+	if (transaction_id_length > 0) {
 		zend_hash_add(frame.headers, "transaction", sizeof("transaction"), transaction_id, transaction_id_length + 1, NULL);
 	}
@@ -1116,5 +1133,5 @@
 		RETURN_FALSE;
 	}
-	
+
 	if (stomp_send(stomp, &frame TSRMLS_CC) > 0) {
 		success = stomp_valid_receipt(stomp, &frame);
@@ -1126,5 +1143,5 @@
 /* }}} */
 
-/* {{{ proto string Stomp::error() 
+/* {{{ proto string Stomp::error()
    Get the last error message */
 PHP_FUNCTION(stomp_error)
@@ -1171,5 +1188,5 @@
 			return;
 		}
-		FETCH_STOMP_OBJECT; 
+		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg = NULL;
@@ -1177,5 +1194,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -1185,5 +1202,5 @@
 /* }}} */
 
-/* {{{ proto array Stomp::getTimeout() 
+/* {{{ proto array Stomp::getTimeout()
    Get the timeout */
 PHP_FUNCTION(stomp_get_read_timeout)
@@ -1193,5 +1210,5 @@
 	if (stomp_object) {
 		stomp_object_t *i_obj = NULL;
-		FETCH_STOMP_OBJECT; 
+		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg = NULL;
@@ -1199,5 +1216,5 @@
 			return;
 		}
-		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp); 
+		ZEND_FETCH_RESOURCE(stomp, stomp_t *, &arg, -1, PHP_STOMP_RES_NAME, le_stomp);
 	}
 
@@ -1237,5 +1254,5 @@
 PHP_METHOD(stompexception, getDetails)
 {
-	zval *object = getThis();	
+	zval *object = getThis();
 	zval *details = NULL;
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 16:01:31 2024 UTC