Commits

Anatol Belski committed 3b6850d

further windows fixes

- uninitialized memory usage
- invalid socket check
- deactivated openssl as the current libevent distribution doesn't provide it for windows

Comments (0)

Files changed (8)

classes/buffer_event.c

 	zval  *arg_data;
 	zval  *arg_self;
 	zval **args[2];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(bev);
 	zval  *arg_events;
 	zval  *arg_self;
 	zval **args[3];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(pfci && pfcc);
 	zend_fcall_info     *pfci;
 	zval                *arg_data;
 	zval               **args[1];
-	zval                *retval_ptr;
+	zval                *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(e);
 	zval                *arg_fd;
 	zval                *arg_what;
 	zval               **args[3];
-	zval                *retval_ptr;
+	zval                *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(e);
 	zval                *arg_data;
 	zval                *arg_signum;
 	zval               **args[2];
-	zval                *retval_ptr;
+	zval                *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(e);
 	zval                   *zevent  = getThis();
 	php_event_t            *e;
 	zval                  **ppzfd   = NULL;
-	evutil_socket_t         fd;
+	evutil_socket_t         fd = -1;
 	long                    what    = -1;
 	zend_fcall_info         fci     = empty_fcall_info;
 	zend_fcall_info_cache   fcc     = empty_fcall_info_cache;
 	zval  *arg_data;
 	zval  *arg_req;
 	zval **args[2];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(cb);
 	zval  *arg_data;
 	zval  *arg_req;
 	zval **args[2];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(http);

classes/http_connection.c

 	zval  *arg_data;
 	zval  *arg_conn;
 	zval **args[2];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(evcon && conn);

classes/http_request.c

 	zval  *arg_data;
 	zval  *arg_req;
 	zval **args[2];
-	zval  *retval_ptr;
+	zval  *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(http_req && http_req->ptr);

classes/listener.c

 	zval   *arg_fd;
 	zval   *arg_address;
 	zval   *arg_data;
-	zval   *retval_ptr;
+	zval   *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(l);
 	zend_fcall_info_cache *pfcc;
 	zval  **args[2];
 	zval   *arg_data;
-	zval   *retval_ptr;
+	zval   *retval_ptr = NULL;
 	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(l);
 
 ARG_WITH("event", "for event support", "no");
 
+/* XXX fix libevent makefile.nmake to support openssl */
+
 if (PHP_EVENT != "no") {
 
 	/* XXX separate for options */
 		CHECK_HEADER_ADD_INCLUDE("pthread.h", "CFLAGS_EVENT", PHP_EVENT + ";" + configure_module_dirname) &&
 		CHECK_HEADER_ADD_INCLUDE("sched.h", "CFLAGS_EVENT", PHP_EVENT + ";" + configure_module_dirname) &&
 		CHECK_LIB("pthreadVC2.lib", "event", PHP_EVENT) &&
-		/*CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_EVENT") &&
+		/* CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_EVENT") &&
 		CHECK_LIB("ssleay32.lib", "event", PHP_EVENT) &&
-		CHECK_LIB("libeay32.lib", "event", PHP_EVENT) &&*/
+		CHECK_LIB("libeay32.lib", "event", PHP_EVENT) && */
 		CHECK_HEADER_ADD_INCLUDE("common.h", "CFLAGS_EVENT", configure_module_dirname + "\\src") &&
 		CHECK_HEADER_ADD_INCLUDE("http.h", "CFLAGS_EVENT", configure_module_dirname + "\\classes.h") &&
 		CHECK_HEADER_ADD_INCLUDE("php_event.h", "CFLAGS_EVENT", configure_module_dirname)) {
 		ADD_FLAG("CFLAGS_EVENT", "/D PHP_EVENT_SOCKETS=1");
 
 		ADD_FLAG("CFLAGS_EVENT", "/D HAVE_EVENT_PTHREADS_LIB=1");
-		/*ADD_FLAG("CFLAGS_EVENT", "/D HAVE_EVENT_OPENSSL_LIB=1");*/
+		/* ADD_FLAG("CFLAGS_EVENT", "/D HAVE_EVENT_OPENSSL_LIB=1");
+		ADD_FLAG("CFLAGS_EVENT", "/D _EVENT_HAVE_OPENSSL=1"); */
 		ADD_FLAG("CFLAGS_EVENT", "/D HAVE_EVENT_EXTRA_LIB=1");
 
 		EXTENSION("event", "php_event.c", "true");
 #ifndef PHP_WIN32
 	if (file_desc >= 0 && fcntl(file_desc, F_GETFD) == -1) {
 #else
-	if (file_desc == INVALID_HANDLE_VALUE) {
+	if (file_desc == INVALID_SOCKET) {
 #endif
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl: invalid file descriptor passed");
 		return -1;