From c8a56916efb7ddf383717c08d63356d63f23ff23 Mon Sep 17 00:00:00 2001 From: Mohammad Zare Moghadam Date: Fri, 22 Jan 2021 13:58:47 +0330 Subject: [PATCH 1/2] Update tdlib.c --- tdlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdlib.c b/tdlib.c index 06685b4..64030cb 100644 --- a/tdlib.c +++ b/tdlib.c @@ -159,7 +159,7 @@ PHP_METHOD (TdLib, receive) { void *tdClient = tdlib_client_get_instance(getThis()); double timeout; - ZEND_PARSE_PARAMETERS_START(0, 1) + ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_DOUBLE(timeout); ZEND_PARSE_PARAMETERS_END(); From 99ebaf7cdecb9c7637ce421d8af5911436d8f3c1 Mon Sep 17 00:00:00 2001 From: Mohammad Zare Moghadam Date: Fri, 22 Jan 2021 15:05:23 +0330 Subject: [PATCH 2/2] Update tdlib.c --- tdlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tdlib.c b/tdlib.c index 64030cb..6fa2e40 100644 --- a/tdlib.c +++ b/tdlib.c @@ -3,6 +3,7 @@ #endif #include "php.h" +#include "zend_smart_str.h" #include "php_tdlib.h" #include "ext/json/php_json.h" #include "zend_exceptions.h" @@ -190,6 +191,7 @@ PHP_METHOD (TdLib, send) { if (tdClient) { php_json_encode(&buf, parameter, 0); + smart_str_0(&buf); td_json_client_send(tdClient, ZSTR_VAL(buf.s)); } @@ -205,6 +207,7 @@ PHP_METHOD (TdLib, execute) { php_json_encode(&buf, parameter, 0); + smart_str_0(&buf); const char *response = td_json_client_execute(NULL, ZSTR_VAL(buf.s));