Skip to content

Instantly share code, notes, and snippets.

View tony2001's full-sized avatar

Antony Dovgal tony2001

  • Limassol, Cyprus
View GitHub Profile
diff --git a/application/classes/Auth/GPlus.php b/application/classes/Auth/GPlus.php
index 0040d06..69d94e2 100644
--- a/application/classes/Auth/GPlus.php
+++ b/application/classes/Auth/GPlus.php
@@ -128,7 +128,10 @@ class Auth_GPlus extends Auth {
try {
$plus = GPlus::instance();
$userInfo = $plus->getUserinfo();
- } catch (Google_AuthException $e) {
+ } catch (Google_Exception $e) {
diff --git a/application/classes/Auth/GPlus.php b/application/classes/Auth/GPlus.php
index 0040d06..c0dbc6f 100644
--- a/application/classes/Auth/GPlus.php
+++ b/application/classes/Auth/GPlus.php
@@ -128,7 +128,7 @@ class Auth_GPlus extends Auth {
try {
$plus = GPlus::instance();
$userInfo = $plus->getUserinfo();
- } catch (Google_AuthException $e) {
+ } catch (Google_Exception $e) {
diff --git a/php7/memcache_pool.c b/php7/memcache_pool.c
index 3aea80c..1ea9a98 100644
--- a/php7/memcache_pool.c
+++ b/php7/memcache_pool.c
@@ -771,6 +771,14 @@ static int mmc_server_connect(mmc_pool_t *pool, mmc_t *mmc, mmc_stream_t *io, in
mmc->error = NULL;
}
+ dtor_func_t origin_dtor;
+ origin_dtor = EG(regular_list).pDestructor;
diff --git a/excel.c b/excel.c
index bb4274c..476f9e7 100644
--- a/excel.c
+++ b/excel.c
@@ -1123,7 +1123,7 @@ EXCEL_METHOD(Book, __construct)
BookHandle book;
zval *object = getThis();
char *name = NULL, *key;
- int name_len = 0, key_len = 0;
+ zend_long name_len = 0, key_len = 0;
diff --git a/excel.c b/excel.c
index bb4274c..a059884 100644
--- a/excel.c
+++ b/excel.c
@@ -1123,7 +1123,7 @@ EXCEL_METHOD(Book, __construct)
BookHandle book;
zval *object = getThis();
char *name = NULL, *key;
- int name_len = 0, key_len = 0;
+ size_t name_len = 0, key_len = 0;
@tony2001
tony2001 / gist:d1003872ede98b7889f9
Created February 3, 2016 11:23
zend_extensions.c
} else if (zend_get_extension(new_extension->name)) {
fprintf(stderr, "Cannot load %s - it was already loaded\n", new_extension->name);
/* See http://support.microsoft.com/kb/190351 */
#ifdef ZEND_WIN32
fflush(stderr);
#endif
DL_UNLOAD(handle);
return FAILURE;
} else if (zend_get_extension(new_extension->name)) {
fprintf(stderr, "Cannot load %s - extension already loaded\n", new_extension->name);
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 5d9064a..1fdc5a8 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -3014,7 +3014,11 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP
xmlFreeNode(dummy);
} ZEND_HASH_FOREACH_END();
smart_str_0(&list);
- xmlNodeSetContentLen(ret, BAD_CAST(ZSTR_VAL(list.s)), ZSTR_LEN(list.s));
+ if (list.s) {
diff --git a/storage.go b/storage.go
index 63c7c7c..eebf02d 100644
--- a/storage.go
+++ b/storage.go
@@ -270,8 +270,14 @@ func (s *Storage) LoadLinks(bucket uint32, link_id uint64, load_limit uint32) ([
for row := res.MakeRow(); ; {
err = res.ScanRow(row)
if err == nil {
+ contact_link_id := row.ForceUint64(0)
+ if contact_link_id == link_id {
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define THREAD_NUM 10
#define ARRAY_SIZE 100
pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define THREAD_NUM 10
#define ARRAY_SIZE 100
pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;