Use RETURN_THROWS() after zend_fetch_resource*()

This commit is contained in:
Máté Kocsis 2020-01-03 19:16:51 +01:00
parent e08ce4c13d
commit bbcfa66e06
No known key found for this signature in database
GPG Key ID: FD055E41728BF310
25 changed files with 338 additions and 338 deletions

View File

@ -1959,7 +1959,7 @@ PHP_FUNCTION(curl_copy_handle)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
cp = curl_easy_duphandle(ch->cp);
@ -2927,7 +2927,7 @@ PHP_FUNCTION(curl_setopt)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (options <= 0 && options != CURLOPT_SAFE_UPLOAD) {
@ -2958,7 +2958,7 @@ PHP_FUNCTION(curl_setopt_array)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(arr), option, string_key, entry) {
@ -3005,7 +3005,7 @@ PHP_FUNCTION(curl_exec)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
_php_curl_verify_handlers(ch, 1);
@ -3064,7 +3064,7 @@ PHP_FUNCTION(curl_getinfo)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ZEND_NUM_ARGS() < 2) {
@ -3328,7 +3328,7 @@ PHP_FUNCTION(curl_error)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ch->err.no) {
@ -3352,7 +3352,7 @@ PHP_FUNCTION(curl_errno)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(ch->err.no);
@ -3371,7 +3371,7 @@ PHP_FUNCTION(curl_close)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ch->in_callback) {
@ -3545,7 +3545,7 @@ PHP_FUNCTION(curl_reset)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ch->in_callback) {
@ -3574,7 +3574,7 @@ PHP_FUNCTION(curl_escape)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ZEND_SIZE_T_INT_OVFL(ZSTR_LEN(str))) {
@ -3606,7 +3606,7 @@ PHP_FUNCTION(curl_unescape)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ZEND_SIZE_T_INT_OVFL(ZSTR_LEN(str))) {
@ -3637,7 +3637,7 @@ PHP_FUNCTION(curl_pause)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(curl_easy_pause(ch->cp, bitmask));

View File

@ -81,11 +81,11 @@ PHP_FUNCTION(curl_multi_add_handle)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
if ((ch = (php_curl *)zend_fetch_resource(Z_RES_P(z_ch), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
_php_curl_cleanup_handle(ch);
@ -167,11 +167,11 @@ PHP_FUNCTION(curl_multi_remove_handle)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
if ((ch = (php_curl *)zend_fetch_resource(Z_RES_P(z_ch), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
error = curl_multi_remove_handle(mh->multi, ch->cp);
@ -220,7 +220,7 @@ PHP_FUNCTION(curl_multi_select)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
#if LIBCURL_VERSION_NUM >= 0x071c00 /* Available since 7.28.0 */
@ -265,7 +265,7 @@ PHP_FUNCTION(curl_multi_exec)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
{
@ -277,7 +277,7 @@ PHP_FUNCTION(curl_multi_exec)
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
if ((ch = (php_curl *)zend_fetch_resource(Z_RES_P(pz_ch), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
_php_curl_verify_handlers(ch, 1);
@ -305,7 +305,7 @@ PHP_FUNCTION(curl_multi_getcontent)
ZEND_PARSE_PARAMETERS_END();
if ((ch = (php_curl *)zend_fetch_resource(Z_RES_P(z_ch), le_curl_name, le_curl)) == NULL) {
return;
RETURN_THROWS();
}
if (ch->handlers->write->method == PHP_CURL_RETURN) {
@ -338,7 +338,7 @@ PHP_FUNCTION(curl_multi_info_read)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
tmp_msg = curl_multi_info_read(mh->multi, &queued_msgs);
@ -392,7 +392,7 @@ PHP_FUNCTION(curl_multi_close)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(z_mh));
@ -444,7 +444,7 @@ PHP_FUNCTION(curl_multi_errno)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(mh->err.no);
@ -623,7 +623,7 @@ PHP_FUNCTION(curl_multi_setopt)
ZEND_PARSE_PARAMETERS_END();
if ((mh = (php_curlm *)zend_fetch_resource(Z_RES_P(z_mh), le_curl_multi_handle_name, le_curl_multi_handle)) == NULL) {
return;
RETURN_THROWS();
}
if (!_php_curl_multi_setopt(mh, options, zvalue, return_value)) {

View File

@ -58,7 +58,7 @@ PHP_FUNCTION(curl_share_close)
ZEND_PARSE_PARAMETERS_END();
if ((sh = (php_curlsh *)zend_fetch_resource(Z_RES_P(z_sh), le_curl_share_handle_name, le_curl_share_handle)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(z_sh));
@ -102,7 +102,7 @@ PHP_FUNCTION(curl_share_setopt)
ZEND_PARSE_PARAMETERS_END();
if ((sh = (php_curlsh *)zend_fetch_resource(Z_RES_P(zid), le_curl_share_handle_name, le_curl_share_handle)) == NULL) {
return;
RETURN_THROWS();
}
if (!_php_curl_share_setopt(sh, options, zvalue, return_value)) {
@ -136,7 +136,7 @@ PHP_FUNCTION(curl_share_errno)
ZEND_PARSE_PARAMETERS_END();
if ((sh = (php_curlsh *)zend_fetch_resource(Z_RES_P(z_sh), le_curl_share_handle_name, le_curl_share_handle)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(sh->err.no);

View File

@ -200,13 +200,13 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
#define DBA_FETCH_RESOURCE(info, id) \
if ((info = (dba_info *)zend_fetch_resource2(Z_RES_P(id), "DBA identifier", le_db, le_pdb)) == NULL) { \
return; \
RETURN_THROWS(); \
}
#define DBA_FETCH_RESOURCE_WITH_ID(info, id) \
if ((info = (dba_info *)zend_fetch_resource2(Z_RES_P(id), "DBA identifier", le_db, le_pdb)) == NULL) { \
DBA_ID_DONE; \
return; \
RETURN_THROWS(); \
}
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE_WITH_ID(info, id)

View File

@ -334,7 +334,7 @@ PHP_FUNCTION(finfo_close)
}
if ((finfo = (php_fileinfo *)zend_fetch_resource(Z_RES_P(zfinfo), "file_info", le_fileinfo)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(zfinfo));
@ -362,7 +362,7 @@ PHP_FUNCTION(finfo_set_flags)
RETURN_THROWS();
}
if ((finfo = (php_fileinfo *)zend_fetch_resource(Z_RES_P(zfinfo), "file_info", le_fileinfo)) == NULL) {
return;
RETURN_THROWS();
}
}
@ -429,7 +429,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
RETURN_THROWS();
}
if ((finfo = (php_fileinfo *)zend_fetch_resource(Z_RES_P(zfinfo), "file_info", le_fileinfo)) == NULL) {
return;
RETURN_THROWS();
}
magic = finfo->magic;
}

View File

@ -240,7 +240,7 @@ PHP_FUNCTION(ftp_login)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* log in */
@ -266,7 +266,7 @@ PHP_FUNCTION(ftp_pwd)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (!(pwd = ftp_pwd(ftp))) {
@ -290,7 +290,7 @@ PHP_FUNCTION(ftp_cdup)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (!ftp_cdup(ftp)) {
@ -316,7 +316,7 @@ PHP_FUNCTION(ftp_chdir)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* change directories */
@ -343,7 +343,7 @@ PHP_FUNCTION(ftp_exec)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* execute serverside command */
@ -370,7 +370,7 @@ PHP_FUNCTION(ftp_raw)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* execute arbitrary ftp command */
@ -393,7 +393,7 @@ PHP_FUNCTION(ftp_mkdir)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* create directory */
@ -420,7 +420,7 @@ PHP_FUNCTION(ftp_rmdir)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* remove directorie */
@ -448,7 +448,7 @@ PHP_FUNCTION(ftp_chmod)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (!ftp_chmod(ftp, mode, filename, filename_len)) {
@ -474,7 +474,7 @@ PHP_FUNCTION(ftp_alloc)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
ret = ftp_alloc(ftp, size, zresponse ? &response : NULL);
@ -505,7 +505,7 @@ PHP_FUNCTION(ftp_nlist)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* get list of files */
@ -536,7 +536,7 @@ PHP_FUNCTION(ftp_rawlist)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* get raw directory listing */
@ -567,7 +567,7 @@ PHP_FUNCTION(ftp_mlsd)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* get raw directory listing */
@ -602,7 +602,7 @@ PHP_FUNCTION(ftp_systype)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (NULL == (syst = ftp_syst(ftp))) {
@ -631,7 +631,7 @@ PHP_FUNCTION(ftp_fget)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
php_stream_from_res(stream, Z_RES_P(z_file));
XTYPE(xtype, mode);
@ -677,7 +677,7 @@ PHP_FUNCTION(ftp_nb_fget)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
php_stream_from_res(stream, Z_RES_P(z_file));
XTYPE(xtype, mode);
@ -723,7 +723,7 @@ PHP_FUNCTION(ftp_pasv)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (!ftp_pasv(ftp, pasv ? 1 : 0)) {
@ -751,7 +751,7 @@ PHP_FUNCTION(ftp_get)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
XTYPE(xtype, mode);
@ -817,7 +817,7 @@ PHP_FUNCTION(ftp_nb_get)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
XTYPE(xtype, mode);
@ -885,7 +885,7 @@ PHP_FUNCTION(ftp_nb_continue)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
if (!ftp->nb) {
@ -929,7 +929,7 @@ PHP_FUNCTION(ftp_fput)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
php_stream_from_zval(stream, z_file);
XTYPE(xtype, mode);
@ -979,7 +979,7 @@ PHP_FUNCTION(ftp_nb_fput)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
php_stream_from_res(stream, Z_RES_P(z_file));
XTYPE(xtype, mode);
@ -1033,7 +1033,7 @@ PHP_FUNCTION(ftp_put)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
XTYPE(xtype, mode);
@ -1087,7 +1087,7 @@ PHP_FUNCTION(ftp_append)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
XTYPE(xtype, mode);
@ -1123,7 +1123,7 @@ PHP_FUNCTION(ftp_nb_put)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
XTYPE(xtype, mode);
@ -1204,7 +1204,7 @@ PHP_FUNCTION(ftp_mdtm)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* get file mod time */
@ -1226,7 +1226,7 @@ PHP_FUNCTION(ftp_rename)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* rename the file */
@ -1253,7 +1253,7 @@ PHP_FUNCTION(ftp_delete)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* delete the file */
@ -1280,7 +1280,7 @@ PHP_FUNCTION(ftp_site)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
/* send the site command */
@ -1305,7 +1305,7 @@ PHP_FUNCTION(ftp_close)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
ftp_quit(ftp);
@ -1327,7 +1327,7 @@ PHP_FUNCTION(ftp_set_option)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
switch (option) {
@ -1383,7 +1383,7 @@ PHP_FUNCTION(ftp_get_option)
}
if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) {
return;
RETURN_THROWS();
}
switch (option) {

View File

@ -930,7 +930,7 @@ PHP_FUNCTION(imap_reopen)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (options) {
@ -998,7 +998,7 @@ PHP_FUNCTION(imap_append)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
INIT (&st, mail_string, (void *) ZSTR_VAL(message), ZSTR_LEN(message));
@ -1023,7 +1023,7 @@ PHP_FUNCTION(imap_num_msg)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(imap_le_struct->imap_stream->nmsgs);
@ -1042,7 +1042,7 @@ PHP_FUNCTION(imap_ping)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_BOOL(mail_ping(imap_le_struct->imap_stream));
@ -1061,7 +1061,7 @@ PHP_FUNCTION(imap_num_recent)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(imap_le_struct->imap_stream->recent);
@ -1082,7 +1082,7 @@ PHP_FUNCTION(imap_get_quota)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
array_init(return_value);
@ -1111,7 +1111,7 @@ PHP_FUNCTION(imap_get_quotaroot)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
array_init(return_value);
@ -1142,7 +1142,7 @@ PHP_FUNCTION(imap_set_quota)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
limits.text.data = (unsigned char*)"STORAGE";
@ -1166,7 +1166,7 @@ PHP_FUNCTION(imap_setacl)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_BOOL(imap_setacl(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), ZSTR_VAL(id), ZSTR_VAL(rights)));
@ -1186,7 +1186,7 @@ PHP_FUNCTION(imap_getacl)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* initializing the special array for the return values */
@ -1219,7 +1219,7 @@ PHP_FUNCTION(imap_expunge)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
mail_expunge (imap_le_struct->imap_stream);
@ -1246,7 +1246,7 @@ PHP_FUNCTION(imap_gc)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
mail_gc(imap_le_struct->imap_stream, flags);
@ -1269,7 +1269,7 @@ PHP_FUNCTION(imap_close)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (argc == 2) {
@ -1311,7 +1311,7 @@ PHP_FUNCTION(imap_headers)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* Initialize return array */
@ -1368,7 +1368,7 @@ PHP_FUNCTION(imap_body)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if ((argc == 3) && (flags & FT_UID)) {
@ -1408,7 +1408,7 @@ PHP_FUNCTION(imap_mail_copy)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? options : NIL)) == T) {
@ -1434,7 +1434,7 @@ PHP_FUNCTION(imap_mail_move)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_copy_full(imap_le_struct->imap_stream, ZSTR_VAL(seq), ZSTR_VAL(folder), (argc == 4 ? (options | CP_MOVE) : CP_MOVE)) == T) {
@ -1458,7 +1458,7 @@ PHP_FUNCTION(imap_createmailbox)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_create(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
@ -1482,7 +1482,7 @@ PHP_FUNCTION(imap_renamemailbox)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_rename(imap_le_struct->imap_stream, ZSTR_VAL(old_mailbox), ZSTR_VAL(new_mailbox)) == T) {
@ -1506,7 +1506,7 @@ PHP_FUNCTION(imap_deletemailbox)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_delete(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
@ -1531,7 +1531,7 @@ PHP_FUNCTION(imap_list)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* set flag for normal, old mailbox list */
@ -1571,7 +1571,7 @@ PHP_FUNCTION(imap_getmailboxes)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* set flag for new, improved array of objects mailbox list */
@ -1620,7 +1620,7 @@ PHP_FUNCTION(imap_listscan)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
IMAPG(imap_folders) = NIL;
@ -1654,7 +1654,7 @@ PHP_FUNCTION(imap_check)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_ping (imap_le_struct->imap_stream) == NIL) {
@ -1689,7 +1689,7 @@ PHP_FUNCTION(imap_delete)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!try_convert_to_string(sequence)) {
@ -1715,7 +1715,7 @@ PHP_FUNCTION(imap_undelete)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!try_convert_to_string(sequence)) {
@ -1745,7 +1745,7 @@ PHP_FUNCTION(imap_headerinfo)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (argc >= 3) {
@ -1852,7 +1852,7 @@ PHP_FUNCTION(imap_lsub)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* set flag for normal, old mailbox list */
@ -1891,7 +1891,7 @@ PHP_FUNCTION(imap_getsubscribed)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* set flag for new, improved array of objects list */
@ -1939,7 +1939,7 @@ PHP_FUNCTION(imap_subscribe)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_subscribe(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
@ -1963,7 +1963,7 @@ PHP_FUNCTION(imap_unsubscribe)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (mail_unsubscribe(imap_le_struct->imap_stream, ZSTR_VAL(folder)) == T) {
@ -1994,7 +1994,7 @@ PHP_FUNCTION(imap_fetchstructure)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (msgno < 1) {
@ -2046,7 +2046,7 @@ PHP_FUNCTION(imap_fetchbody)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (argc < 4 || !(flags & FT_UID)) {
@ -2088,7 +2088,7 @@ PHP_FUNCTION(imap_fetchmime)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (argc < 4 || !(flags & FT_UID)) {
@ -2123,7 +2123,7 @@ PHP_FUNCTION(imap_savebody)
}
if ((imap_ptr = (pils *)zend_fetch_resource(Z_RES_P(stream), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!imap_ptr) {
@ -2271,7 +2271,7 @@ PHP_FUNCTION(imap_mailboxmsginfo)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* Initialize return object */
@ -2754,7 +2754,7 @@ PHP_FUNCTION(imap_setflag_full)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
mail_setflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (flags ? flags : NIL));
@ -2777,7 +2777,7 @@ PHP_FUNCTION(imap_clearflag_full)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
mail_clearflag_full(imap_le_struct->imap_stream, ZSTR_VAL(sequence), ZSTR_VAL(flag), (argc == 4 ? flags : NIL));
@ -2804,7 +2804,7 @@ PHP_FUNCTION(imap_sort)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (pgm > SORTSIZE) {
@ -2865,7 +2865,7 @@ PHP_FUNCTION(imap_fetchheader)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if ((argc == 3) && (flags & FT_UID)) {
@ -2897,7 +2897,7 @@ PHP_FUNCTION(imap_uid)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
msgindex = msgno;
@ -2923,7 +2923,7 @@ PHP_FUNCTION(imap_msgno)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(mail_msgno(imap_le_struct->imap_stream, msgno));
@ -2944,7 +2944,7 @@ PHP_FUNCTION(imap_status)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
object_init(return_value);
@ -2989,7 +2989,7 @@ PHP_FUNCTION(imap_bodystruct)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!msg || msg < 1 || (unsigned) msg > imap_le_struct->imap_stream->nmsgs) {
@ -3107,7 +3107,7 @@ PHP_FUNCTION(imap_fetch_overview)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
array_init(return_value);
@ -3786,7 +3786,7 @@ PHP_FUNCTION(imap_search)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
search_criteria = estrndup(ZSTR_VAL(criteria), ZSTR_LEN(criteria));
@ -4389,7 +4389,7 @@ PHP_FUNCTION(imap_thread)
}
if ((imap_le_struct = (pils *)zend_fetch_resource(Z_RES_P(streamind), "imap", le_imap)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgm = mail_criteria(criteria);

View File

@ -1128,7 +1128,7 @@ PHP_FUNCTION(ldap_bind)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
@ -1185,7 +1185,7 @@ PHP_FUNCTION(ldap_bind_ext)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
@ -1350,7 +1350,7 @@ PHP_FUNCTION(ldap_sasl_bind)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
ctx = _php_sasl_setdefs(ld->link, sasl_mech, sasl_realm, sasl_authc_id, passwd, sasl_authz_id);
@ -1383,7 +1383,7 @@ PHP_FUNCTION(ldap_unbind)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(link));
@ -1714,7 +1714,7 @@ PHP_FUNCTION(ldap_free_result)
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(result)); /* Delete list entry */
@ -1735,11 +1735,11 @@ PHP_FUNCTION(ldap_count_entries)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(ldap_count_entries(ld->link, ldap_result));
@ -1760,11 +1760,11 @@ PHP_FUNCTION(ldap_first_entry)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if ((entry = ldap_first_entry(ld->link, ldap_result)) == NULL) {
@ -1793,10 +1793,10 @@ PHP_FUNCTION(ldap_next_entry)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if ((entry_next = ldap_next_entry(ld->link, resultentry->data)) == NULL) {
@ -1832,10 +1832,10 @@ PHP_FUNCTION(ldap_get_entries)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
ldap = ld->link;
@ -1927,11 +1927,11 @@ PHP_FUNCTION(ldap_first_attribute)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if ((attribute = ldap_first_attribute(ld->link, resultentry->data, &resultentry->ber)) == NULL) {
@ -1960,11 +1960,11 @@ PHP_FUNCTION(ldap_next_attribute)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if (resultentry->ber == NULL) {
@ -2007,11 +2007,11 @@ PHP_FUNCTION(ldap_get_attributes)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
array_init(return_value);
@ -2065,11 +2065,11 @@ PHP_FUNCTION(ldap_get_values_len)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_value_len = ldap_get_values_len(ld->link, resultentry->data, attr)) == NULL) {
@ -2104,11 +2104,11 @@ PHP_FUNCTION(ldap_get_dn)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
text = ldap_get_dn(ld->link, resultentry->data);
@ -2208,7 +2208,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
num_attribs = zend_hash_num_elements(Z_ARRVAL_P(entry));
@ -2448,7 +2448,7 @@ static void php_ldap_do_delete(INTERNAL_FUNCTION_PARAMETERS, int ext)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (serverctrls) {
@ -2597,7 +2597,7 @@ PHP_FUNCTION(ldap_modify_batch)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
/* perform validation */
@ -2880,7 +2880,7 @@ PHP_FUNCTION(ldap_errno)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(_get_lderrno(ld->link));
@ -2914,7 +2914,7 @@ PHP_FUNCTION(ldap_error)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
ld_errno = _get_lderrno(ld->link);
@ -2941,7 +2941,7 @@ PHP_FUNCTION(ldap_compare)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (serverctrls) {
@ -2994,7 +2994,7 @@ PHP_FUNCTION(ldap_get_option)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
switch (option) {
@ -3166,7 +3166,7 @@ PHP_FUNCTION(ldap_set_option)
ldap = NULL;
} else {
if ((ld = (ldap_linkdata *)zend_fetch_resource_ex(link, "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
ldap = ld->link;
}
@ -3349,11 +3349,11 @@ PHP_FUNCTION(ldap_parse_result)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
rc = ldap_parse_result(ld->link, ldap_result, &lerrcode,
@ -3424,11 +3424,11 @@ PHP_FUNCTION(ldap_parse_exop)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
rc = ldap_parse_extended_result(ld->link, ldap_result,
@ -3479,11 +3479,11 @@ PHP_FUNCTION(ldap_first_reference)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if ((entry = ldap_first_reference(ld->link, ldap_result)) == NULL) {
@ -3512,11 +3512,11 @@ PHP_FUNCTION(ldap_next_reference)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if ((entry_next = ldap_next_reference(ld->link, resultentry->data)) == NULL) {
@ -3546,11 +3546,11 @@ PHP_FUNCTION(ldap_parse_reference)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((resultentry = (ldap_resultentry *)zend_fetch_resource(Z_RES_P(result_entry), "ldap result entry", le_result_entry)) == NULL) {
return;
RETURN_THROWS();
}
if (ldap_parse_reference(ld->link, resultentry->data, &lreferrals, NULL /* &serverctrls */, 0) != LDAP_SUCCESS) {
@ -3594,7 +3594,7 @@ static void php_ldap_do_rename(INTERNAL_FUNCTION_PARAMETERS, int ext)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (newparent_len == 0) {
@ -3687,7 +3687,7 @@ PHP_FUNCTION(ldap_start_tls)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol)) != LDAP_SUCCESS) ||
@ -3749,7 +3749,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (Z_TYPE_P(callback) == IS_STRING && Z_STRLEN_P(callback) == 0) {
@ -3942,7 +3942,7 @@ PHP_FUNCTION(ldap_control_paged_result)
ldap = NULL;
} else {
if ((ld = (ldap_linkdata *)zend_fetch_resource_ex(link, "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
ldap = ld->link;
}
@ -4031,11 +4031,11 @@ PHP_FUNCTION(ldap_control_paged_result_response)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if ((ldap_result = (LDAPMessage *)zend_fetch_resource(Z_RES_P(result), "ldap result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
rc = ldap_parse_result(ld->link,
@ -4129,7 +4129,7 @@ PHP_FUNCTION(ldap_exop)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
if (reqdata) {
@ -4235,7 +4235,7 @@ PHP_FUNCTION(ldap_exop_passwd)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
switch (myargcount) {
@ -4320,7 +4320,7 @@ PHP_FUNCTION(ldap_exop_whoami)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
/* synchronous call */
@ -4358,7 +4358,7 @@ PHP_FUNCTION(ldap_exop_refresh)
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
return;
RETURN_THROWS();
}
lttl = (ber_int_t)zval_get_long(ttl);

View File

@ -369,22 +369,22 @@ typedef struct {
#define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \
if ((connection = (php_oci_connection *)zend_fetch_resource2(Z_RES_P(zval), "oci8 connection", le_connection, le_pconnection)) == NULL) { \
RETURN_FALSE; \
RETURN_THROWS(); \
}
#define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \
if ((statement = (php_oci_statement *)zend_fetch_resource(Z_RES_P(zval), "oci8 statement", le_statement)) == NULL) { \
RETURN_FALSE; \
RETURN_THROWS(); \
}
#define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \
if ((descriptor = (php_oci_descriptor *)zend_fetch_resource(Z_RES_P(zval), "oci8 descriptor", le_descriptor)) == NULL) { \
RETURN_FALSE; \
RETURN_THROWS(); \
}
#define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \
if ((collection = (php_oci_collection *)zend_fetch_resource(Z_RES_P(zval), "oci8 collection", le_collection)) == NULL) { \
RETURN_FALSE; \
RETURN_THROWS(); \
}
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \

View File

@ -665,7 +665,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (mode) {
@ -803,7 +803,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
rc = SQLTransact(conn->henv, conn->hdbc, (SQLUSMALLINT)((type)?SQL_COMMIT:SQL_ROLLBACK));
@ -850,7 +850,7 @@ void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -945,7 +945,7 @@ PHP_FUNCTION(odbc_prepare)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -1052,7 +1052,7 @@ PHP_FUNCTION(odbc_execute)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
/* XXX check for already bound parameters*/
@ -1258,7 +1258,7 @@ PHP_FUNCTION(odbc_cursor)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&len);
@ -1324,7 +1324,7 @@ PHP_FUNCTION(odbc_data_source)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(zv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
/* now we have the "connection" lets call the DataSource object */
@ -1382,7 +1382,7 @@ PHP_FUNCTION(odbc_exec)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -1478,7 +1478,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
#endif
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -1630,7 +1630,7 @@ PHP_FUNCTION(odbc_fetch_into)
#endif /* HAVE_SQL_EXTENDED_FETCH */
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -1736,7 +1736,7 @@ PHP_FUNCTION(solid_fetch_prev)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
@ -1778,7 +1778,7 @@ PHP_FUNCTION(odbc_fetch_row)
rownum = pv_row;
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -1844,7 +1844,7 @@ PHP_FUNCTION(odbc_result)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if ((result->numcols == 0)) {
@ -2023,7 +2023,7 @@ PHP_FUNCTION(odbc_result_all)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -2140,7 +2140,7 @@ PHP_FUNCTION(odbc_free_result)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->values) {
@ -2439,7 +2439,7 @@ PHP_FUNCTION(odbc_close)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
if (Z_RES_P(pv_conn)->type == le_pconn) {
@ -2476,7 +2476,7 @@ PHP_FUNCTION(odbc_num_rows)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
SQLRowCount(result->stmt, &rows);
@ -2498,7 +2498,7 @@ PHP_FUNCTION(odbc_next_result)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->values) {
@ -2549,7 +2549,7 @@ PHP_FUNCTION(odbc_num_fields)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(result->numcols);
@ -2569,7 +2569,7 @@ PHP_FUNCTION(odbc_field_name)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -2606,7 +2606,7 @@ PHP_FUNCTION(odbc_field_type)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -2659,7 +2659,7 @@ PHP_FUNCTION(odbc_field_num)
}
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
if (result->numcols == 0) {
@ -2696,7 +2696,7 @@ PHP_FUNCTION(odbc_autocommit)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
if (ZEND_NUM_ARGS() > 1) {
@ -2748,7 +2748,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (ZEND_NUM_ARGS() == 1) {
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
if (mode == 0) {
ret = conn->laststate;
@ -2806,7 +2806,7 @@ PHP_FUNCTION(odbc_setoption)
switch (pv_which) {
case 1: /* SQLSetConnectOption */
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
if (conn->persistent) {
@ -2821,7 +2821,7 @@ PHP_FUNCTION(odbc_setoption)
break;
case 2: /* SQLSetStmtOption */
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) == NULL) {
return;
RETURN_THROWS();
}
rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val);
@ -2862,7 +2862,7 @@ PHP_FUNCTION(odbc_tables)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -2931,7 +2931,7 @@ PHP_FUNCTION(odbc_columns)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3003,7 +3003,7 @@ PHP_FUNCTION(odbc_columnprivileges)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3081,7 +3081,7 @@ PHP_FUNCTION(odbc_foreignkeys)
#endif
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3149,7 +3149,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
data_type = (SQLSMALLINT) pv_data_type;
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3208,7 +3208,7 @@ PHP_FUNCTION(odbc_primarykeys)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3276,7 +3276,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3345,7 +3345,7 @@ PHP_FUNCTION(odbc_procedures)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3415,7 +3415,7 @@ PHP_FUNCTION(odbc_specialcolumns)
nullable = (SQLUSMALLINT) vnullable;
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3486,7 +3486,7 @@ PHP_FUNCTION(odbc_statistics)
reserved = (SQLUSMALLINT) vreserved;
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@ -3551,7 +3551,7 @@ PHP_FUNCTION(odbc_tableprivileges)
}
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
return;
RETURN_THROWS();
}
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));

View File

@ -2422,7 +2422,7 @@ PHP_FUNCTION(openssl_x509_free)
RETURN_THROWS();
}
if ((cert = (X509 *)zend_fetch_resource(Z_RES_P(x509), "OpenSSL X.509", le_x509)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(x509));
}
@ -4460,7 +4460,7 @@ PHP_FUNCTION(openssl_pkey_free)
RETURN_THROWS();
}
if ((pkey = (EVP_PKEY *)zend_fetch_resource(Z_RES_P(key), "OpenSSL key", le_key)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(key));
}
@ -4507,7 +4507,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
RETURN_THROWS();
}
if ((pkey = (EVP_PKEY *)zend_fetch_resource(Z_RES_P(key), "OpenSSL key", le_key)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
out = BIO_new(BIO_s_mem());
if (!PEM_write_bio_PUBKEY(out, pkey)) {
@ -4683,7 +4683,7 @@ PHP_FUNCTION(openssl_dh_compute_key)
RETURN_THROWS();
}
if ((pkey = (EVP_PKEY *)zend_fetch_resource(Z_RES_P(key), "OpenSSL key", le_key)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) {
RETURN_FALSE;

View File

@ -1553,7 +1553,7 @@ PHP_FUNCTION(pg_connect_poll)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
ret = PQconnectPoll(pgsql);
@ -1591,7 +1591,7 @@ PHP_FUNCTION(pg_close)
link = Z_RES_P(pgsql_link);
if (zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (link == PGG(default_link)) {
@ -1635,7 +1635,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
switch(entry_type) {
@ -1778,7 +1778,7 @@ PHP_FUNCTION(pg_parameter_status)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
param = (char*)PQparameterStatus(pgsql, param);
@ -1808,7 +1808,7 @@ PHP_FUNCTION(pg_ping)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* ping connection */
@ -1856,7 +1856,7 @@ PHP_FUNCTION(pg_query)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
@ -1959,7 +1959,7 @@ PHP_FUNCTION(pg_query_params)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
@ -2075,7 +2075,7 @@ PHP_FUNCTION(pg_prepare)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
@ -2162,7 +2162,7 @@ PHP_FUNCTION(pg_execute)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (PQ_SETNONBLOCKING(pgsql, 0)) {
@ -2259,7 +2259,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2326,7 +2326,7 @@ PHP_FUNCTION(pg_last_notice)
/* Just to check if user passed valid resoruce */
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
notices = zend_hash_index_find(&PGG(notices), (zend_ulong)Z_RES_HANDLE_P(pgsql_link));
@ -2444,7 +2444,7 @@ PHP_FUNCTION(pg_field_table)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (fnum < 0 || fnum >= PQnfields(pg_result->result)) {
@ -2537,7 +2537,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
@ -2629,7 +2629,7 @@ PHP_FUNCTION(pg_field_num)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2659,7 +2659,7 @@ PHP_FUNCTION(pg_fetch_result)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2758,7 +2758,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2920,7 +2920,7 @@ PHP_FUNCTION(pg_fetch_all)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2948,7 +2948,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -2988,7 +2988,7 @@ PHP_FUNCTION(pg_result_seek)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (row < 0 || row >= PQntuples(pg_result->result)) {
@ -3025,7 +3025,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -3103,7 +3103,7 @@ PHP_FUNCTION(pg_free_result)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(result));
@ -3127,7 +3127,7 @@ PHP_FUNCTION(pg_last_oid)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -3172,7 +3172,7 @@ PHP_FUNCTION(pg_trace)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
stream = php_stream_open_wrapper(z_filename, mode, REPORT_ERRORS, NULL);
@ -3212,7 +3212,7 @@ PHP_FUNCTION(pg_untrace)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
PQuntrace(pgsql);
@ -3249,7 +3249,7 @@ PHP_FUNCTION(pg_lo_create)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (oid) {
@ -3357,7 +3357,7 @@ PHP_FUNCTION(pg_lo_unlink)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (lo_unlink(pgsql, oid) == -1) {
@ -3431,7 +3431,7 @@ PHP_FUNCTION(pg_lo_open)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* r/w/+ is little bit more PHP-like than INV_READ/INV_WRITE and a lot of
@ -3502,7 +3502,7 @@ PHP_FUNCTION(pg_lo_close)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_lofp), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (lo_close((PGconn *)pgsql->conn, pgsql->lofd) < 0) {
@ -3535,7 +3535,7 @@ PHP_FUNCTION(pg_lo_read)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (argc > 1) {
@ -3586,7 +3586,7 @@ PHP_FUNCTION(pg_lo_write)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, str, len)) == (size_t)-1) {
@ -3612,7 +3612,7 @@ PHP_FUNCTION(pg_lo_read_all)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
tbytes = 0;
@ -3660,7 +3660,7 @@ PHP_FUNCTION(pg_lo_import)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (oid) {
@ -3796,7 +3796,7 @@ PHP_FUNCTION(pg_lo_export)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (lo_export(pgsql, oid, file_out) == -1) {
@ -3824,7 +3824,7 @@ PHP_FUNCTION(pg_lo_seek)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
#if HAVE_PG_LO64
@ -3858,7 +3858,7 @@ PHP_FUNCTION(pg_lo_tell)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
#if HAVE_PG_LO64
@ -3890,7 +3890,7 @@ PHP_FUNCTION(pg_lo_truncate)
}
if ((pgsql = (pgLofp *)zend_fetch_resource(Z_RES_P(pgsql_id), "PostgreSQL large object", le_lofp)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
#if HAVE_PG_LO64
@ -3936,7 +3936,7 @@ PHP_FUNCTION(pg_set_error_verbosity)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (verbosity & (PQERRORS_TERSE|PQERRORS_DEFAULT|PQERRORS_VERBOSE)) {
@ -3974,7 +3974,7 @@ PHP_FUNCTION(pg_set_client_encoding)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(PQsetClientEncoding(pgsql, encoding));
@ -4002,7 +4002,7 @@ PHP_FUNCTION(pg_client_encoding)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* Just do the same as found in PostgreSQL sources... */
@ -4038,7 +4038,7 @@ PHP_FUNCTION(pg_end_copy)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
result = PQendcopy(pgsql);
@ -4076,7 +4076,7 @@ PHP_FUNCTION(pg_put_line)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
result = PQputline(pgsql, query);
@ -4109,7 +4109,7 @@ PHP_FUNCTION(pg_copy_to)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!pg_delim) {
@ -4247,7 +4247,7 @@ PHP_FUNCTION(pg_copy_from)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!pg_delim) {
@ -4391,7 +4391,7 @@ PHP_FUNCTION(pg_escape_string)
#ifdef HAVE_PQESCAPE_CONN
if (link) {
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
ZSTR_LEN(to) = PQescapeStringConn(pgsql, ZSTR_VAL(to), ZSTR_VAL(from), ZSTR_LEN(from), NULL);
} else
@ -4436,7 +4436,7 @@ PHP_FUNCTION(pg_escape_bytea)
#ifdef HAVE_PQESCAPE_BYTEA_CONN
if (link) {
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
to = (char *)PQescapeByteaConn(pgsql, (unsigned char *)from, (size_t)from_len, &to_len);
} else
@ -4611,7 +4611,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
}
if ((pgsql = (PGconn *)zend_fetch_resource2(link, "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (pgsql == NULL) {
@ -4666,7 +4666,7 @@ PHP_FUNCTION(pg_result_error)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -4695,7 +4695,7 @@ PHP_FUNCTION(pg_result_error_field)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -4738,7 +4738,7 @@ PHP_FUNCTION(pg_connection_status)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(PQstatus(pgsql));
@ -4760,7 +4760,7 @@ PHP_FUNCTION(pg_transaction_status)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(PQtransactionStatus(pgsql));
@ -4782,7 +4782,7 @@ PHP_FUNCTION(pg_connection_reset)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
PQreset(pgsql);
@ -4830,7 +4830,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (PQ_SETNONBLOCKING(pgsql, 1)) {
@ -4902,7 +4902,7 @@ PHP_FUNCTION(pg_send_query)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
is_non_blocking = PQisnonblocking(pgsql);
@ -4975,7 +4975,7 @@ PHP_FUNCTION(pg_send_query_params)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
is_non_blocking = PQisnonblocking(pgsql);
@ -5071,7 +5071,7 @@ PHP_FUNCTION(pg_send_prepare)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
is_non_blocking = PQisnonblocking(pgsql);
@ -5146,7 +5146,7 @@ PHP_FUNCTION(pg_send_execute)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
is_non_blocking = PQisnonblocking(pgsql);
@ -5240,7 +5240,7 @@ PHP_FUNCTION(pg_get_result)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = PQgetResult(pgsql);
@ -5272,7 +5272,7 @@ PHP_FUNCTION(pg_result_status)
}
if ((pg_result = (pgsql_result_handle *)zend_fetch_resource(Z_RES_P(result), "PostgreSQL result", le_result)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
pgsql_result = pg_result->result;
@ -5305,7 +5305,7 @@ PHP_FUNCTION(pg_get_notify)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!(result_type & PGSQL_BOTH)) {
@ -5363,7 +5363,7 @@ PHP_FUNCTION(pg_get_pid)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_LONG(PQbackendPID(pgsql));
@ -5442,7 +5442,7 @@ PHP_FUNCTION(pg_socket)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
stream = php_stream_alloc(&php_stream_pgsql_fd_ops, pgsql, NULL, "r");
@ -5468,7 +5468,7 @@ PHP_FUNCTION(pg_consume_input)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_BOOL(PQconsumeInput(pgsql));
@ -5489,7 +5489,7 @@ PHP_FUNCTION(pg_flush)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
is_non_blocking = PQisnonblocking(pgsql);
@ -5643,7 +5643,7 @@ PHP_FUNCTION(pg_meta_data)
}
if ((pgsql = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
array_init(return_value);
@ -6522,7 +6522,7 @@ PHP_FUNCTION(pg_convert)
}
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (php_pgsql_flush_query(pg_link)) {
@ -6731,7 +6731,7 @@ PHP_FUNCTION(pg_insert)
}
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (php_pgsql_flush_query(pg_link)) {
@ -6943,7 +6943,7 @@ PHP_FUNCTION(pg_update)
}
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (php_pgsql_flush_query(pg_link)) {
@ -7035,7 +7035,7 @@ PHP_FUNCTION(pg_delete)
}
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (php_pgsql_flush_query(pg_link)) {
@ -7180,7 +7180,7 @@ PHP_FUNCTION(pg_select)
}
if ((pg_link = (PGconn *)zend_fetch_resource2(Z_RES_P(pgsql_link), "PostgreSQL link", le_link, le_plink)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (php_pgsql_flush_query(pg_link)) {

View File

@ -207,7 +207,7 @@ PHP_FUNCTION(shmop_read)
}
if ((shmop = (struct php_shmop *)zend_fetch_resource(Z_RES_P(shmid), "shmop", shm_type)) == NULL) {
return;
RETURN_THROWS();
}
if (start < 0 || start > shmop->size) {
@ -242,7 +242,7 @@ PHP_FUNCTION(shmop_close)
if ((shmop = (struct php_shmop *)zend_fetch_resource(Z_RES_P(shmid), "shmop", shm_type)) == NULL) {
return;
RETURN_THROWS();
}
zend_list_close(Z_RES_P(shmid));
@ -261,7 +261,7 @@ PHP_FUNCTION(shmop_size)
}
if ((shmop = (struct php_shmop *)zend_fetch_resource(Z_RES_P(shmid), "shmop", shm_type)) == NULL) {
return;
RETURN_THROWS();
}
RETURN_LONG(shmop->size);
@ -283,7 +283,7 @@ PHP_FUNCTION(shmop_write)
}
if ((shmop = (struct php_shmop *)zend_fetch_resource(Z_RES_P(shmid), "shmop", shm_type)) == NULL) {
return;
RETURN_THROWS();
}
if ((shmop->shmatflg & SHM_RDONLY) == SHM_RDONLY) {
@ -315,7 +315,7 @@ PHP_FUNCTION(shmop_delete)
}
if ((shmop = (struct php_shmop *)zend_fetch_resource(Z_RES_P(shmid), "shmop", shm_type)) == NULL) {
return;
RETURN_THROWS();
}
if (shmctl(shmop->shmid, IPC_RMID, NULL)) {

View File

@ -226,7 +226,7 @@ PHP_FUNCTION(socket_recvmsg)
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(zsocket),
php_sockets_le_socket_name, php_sockets_le_socket())) == NULL) {
return;
RETURN_THROWS();
}
msghdr = from_zval_run_conversions(zmsg, php_sock, from_zval_write_msghdr_recv,

View File

@ -861,7 +861,7 @@ PHP_FUNCTION(socket_accept)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (!php_accept_connect(php_sock, &new_sock, (struct sockaddr*)&sa, &php_sa_len)) {
@ -884,7 +884,7 @@ PHP_FUNCTION(socket_set_nonblock)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (!Z_ISUNDEF(php_sock->zstream)) {
@ -922,7 +922,7 @@ PHP_FUNCTION(socket_set_block)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
/* if socket was created from a stream, give the stream a chance to take
@ -963,7 +963,7 @@ PHP_FUNCTION(socket_listen)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (listen(php_sock->bsd_socket, backlog) != 0) {
@ -986,7 +986,7 @@ PHP_FUNCTION(socket_close)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (!Z_ISUNDEF(php_sock->zstream)) {
@ -1025,7 +1025,7 @@ PHP_FUNCTION(socket_write)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (ZEND_NUM_ARGS() < 3) {
@ -1069,7 +1069,7 @@ PHP_FUNCTION(socket_read)
tmpbuf = zend_string_alloc(length, 0);
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (type == PHP_NORMAL_READ) {
@ -1129,7 +1129,7 @@ PHP_FUNCTION(socket_getsockname)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
sa = (struct sockaddr *) &sa_storage;
@ -1203,7 +1203,7 @@ PHP_FUNCTION(socket_getpeername)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
sa = (struct sockaddr *) &sa_storage;
@ -1318,7 +1318,7 @@ PHP_FUNCTION(socket_connect)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
switch(php_sock->type) {
@ -1424,7 +1424,7 @@ PHP_FUNCTION(socket_bind)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
switch(php_sock->type) {
@ -1506,7 +1506,7 @@ PHP_FUNCTION(socket_recv)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(php_sock_res), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
/* overflow check */
@ -1554,7 +1554,7 @@ PHP_FUNCTION(socket_send)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
retval = send(php_sock->bsd_socket, buf, (buf_len < (size_t)len ? buf_len : (size_t)len), flags);
@ -1591,7 +1591,7 @@ PHP_FUNCTION(socket_recvfrom)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
/* overflow check */
@ -1712,7 +1712,7 @@ PHP_FUNCTION(socket_sendto)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
switch (php_sock->type) {
@ -1790,7 +1790,7 @@ PHP_FUNCTION(socket_get_option)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (level == IPPROTO_IP) {
@ -1905,7 +1905,7 @@ PHP_FUNCTION(socket_set_option)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
set_errno(0);
@ -2105,7 +2105,7 @@ PHP_FUNCTION(socket_shutdown)
}
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (shutdown(php_sock->bsd_socket, how_shutdown) != 0) {
@ -2131,7 +2131,7 @@ PHP_FUNCTION(socket_last_error)
if (arg1) {
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
RETVAL_LONG(php_sock->error);
} else {
@ -2153,7 +2153,7 @@ PHP_FUNCTION(socket_clear_error)
if (arg1) {
if ((php_sock = (php_socket *)zend_fetch_resource(Z_RES_P(arg1), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
php_sock->error = 0;
} else {
@ -2272,7 +2272,7 @@ PHP_FUNCTION(socket_export_stream)
RETURN_THROWS();
}
if ((socket = (php_socket *) zend_fetch_resource(Z_RES_P(zsocket), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
/* Either we already exported a stream or the socket came from an import,
@ -2429,7 +2429,7 @@ PHP_FUNCTION(socket_addrinfo_bind)
}
if ((ai = (struct addrinfo *) zend_fetch_resource(Z_RES_P(arg1), le_addrinfo_name, le_addrinfo)) == NULL) {
return;
RETURN_THROWS();
}
php_sock = php_create_socket();
@ -2495,7 +2495,7 @@ PHP_FUNCTION(socket_addrinfo_connect)
}
if ((ai = (struct addrinfo *) zend_fetch_resource(Z_RES_P(arg1), le_addrinfo_name, le_addrinfo)) == NULL) {
return;
RETURN_THROWS();
}
php_sock = php_create_socket();
@ -2559,7 +2559,7 @@ PHP_FUNCTION(socket_addrinfo_explain)
}
if ((ai = (struct addrinfo *) zend_fetch_resource(Z_RES_P(arg1), le_addrinfo_name, le_addrinfo)) == NULL) {
return;
RETURN_THROWS();
}
array_init(return_value);
@ -2619,7 +2619,7 @@ PHP_FUNCTION(socket_wsaprotocol_info_export)
RETURN_THROWS();
}
if ((socket = (php_socket *) zend_fetch_resource(Z_RES_P(zsocket), le_socket_name, le_socket)) == NULL) {
return;
RETURN_THROWS();
}
if (SOCKET_ERROR == WSADuplicateSocket(socket->bsd_socket, (DWORD)target_pid, &wi)) {

View File

@ -71,17 +71,17 @@ static zend_class_entry *dir_class_entry_ptr;
RETURN_THROWS(); \
} \
if ((dirp = (php_stream *)zend_fetch_resource_ex(tmp, "Directory", php_file_le_stream())) == NULL) { \
return; \
RETURN_THROWS(); \
} \
} else { \
if (!DIRG(default_dir) || \
(dirp = (php_stream *)zend_fetch_resource(DIRG(default_dir), "Directory", php_file_le_stream())) == NULL) { \
return; \
RETURN_THROWS(); \
} \
} \
} else { \
if ((dirp = (php_stream *)zend_fetch_resource(Z_RES_P(id), "Directory", php_file_le_stream())) == NULL) { \
return; \
RETURN_THROWS(); \
} \
}

View File

@ -1113,7 +1113,7 @@ PHP_FUNCTION(fscanf)
* with a leak if we have an invalid filehandle. This needs changing
* if the code behind ZEND_VERIFY_RESOURCE changed. - cc */
if (!what) {
RETURN_FALSE;
RETURN_THROWS();
}
buf = php_stream_get_line((php_stream *) what, NULL, 0, &len);

View File

@ -245,7 +245,7 @@ PHP_FUNCTION(proc_terminate)
ZEND_PARSE_PARAMETERS_END();
if ((proc = (struct php_process_handle *)zend_fetch_resource(Z_RES_P(zproc), "process", le_proc_open)) == NULL) {
return;
RETURN_THROWS();
}
#ifdef PHP_WIN32
@ -276,7 +276,7 @@ PHP_FUNCTION(proc_close)
ZEND_PARSE_PARAMETERS_END();
if ((proc = (struct php_process_handle *)zend_fetch_resource(Z_RES_P(zproc), "process", le_proc_open)) == NULL) {
return;
RETURN_THROWS();
}
FG(pclose_wait) = 1;
@ -306,7 +306,7 @@ PHP_FUNCTION(proc_get_status)
ZEND_PARSE_PARAMETERS_END();
if ((proc = (struct php_process_handle *)zend_fetch_resource(Z_RES_P(zproc), "process", le_proc_open)) == NULL) {
return;
RETURN_THROWS();
}
array_init(return_value);

View File

@ -1257,7 +1257,7 @@ PHP_FUNCTION(stream_filter_remove)
filter = zend_fetch_resource(Z_RES_P(zfilter), "stream filter", php_file_le_stream_filter());
if (!filter) {
return;
RETURN_THROWS();
}
if (php_stream_filter_flush(filter, 1) == FAILURE) {

View File

@ -392,7 +392,7 @@ PHP_FUNCTION(stream_bucket_make_writeable)
if ((brigade = (php_stream_bucket_brigade*)zend_fetch_resource(
Z_RES_P(zbrigade), PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade)) == NULL) {
return;
RETURN_THROWS();
}
ZVAL_NULL(return_value);
@ -429,7 +429,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
if ((brigade = (php_stream_bucket_brigade*)zend_fetch_resource(
Z_RES_P(zbrigade), PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade)) == NULL) {
return;
RETURN_THROWS();
}
if ((bucket = (php_stream_bucket *)zend_fetch_resource_ex(pzbucket, PHP_STREAM_BUCKET_RES_NAME, le_bucket)) == NULL) {

View File

@ -142,7 +142,7 @@ PHP_FUNCTION(msg_set_queue)
}
if ((mq = (sysvmsg_queue_t *)zend_fetch_resource(Z_RES_P(queue), "sysvmsg queue", le_sysvmsg)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
@ -183,7 +183,7 @@ PHP_FUNCTION(msg_stat_queue)
}
if ((mq = (sysvmsg_queue_t *)zend_fetch_resource(Z_RES_P(queue), "sysvmsg queue", le_sysvmsg)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
@ -262,7 +262,7 @@ PHP_FUNCTION(msg_remove_queue)
}
if ((mq = (sysvmsg_queue_t *)zend_fetch_resource(Z_RES_P(queue), "sysvmsg queue", le_sysvmsg)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (msgctl(mq->id, IPC_RMID, NULL) == 0) {
@ -316,7 +316,7 @@ PHP_FUNCTION(msg_receive)
}
if ((mq = (sysvmsg_queue_t *)zend_fetch_resource(Z_RES_P(queue), "sysvmsg queue", le_sysvmsg)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
messagebuffer = (struct php_msgbuf *) safe_emalloc(maxsize, 1, sizeof(struct php_msgbuf));
@ -379,7 +379,7 @@ PHP_FUNCTION(msg_send)
}
if ((mq = (sysvmsg_queue_t *)zend_fetch_resource(Z_RES_P(queue), "sysvmsg queue", le_sysvmsg)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (do_serialize) {

View File

@ -301,7 +301,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
}
if ((sem_ptr = (sysvsem_sem *)zend_fetch_resource(Z_RES_P(arg_id), "SysV semaphore", php_sysvsem_module.le_sem)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!acquire && sem_ptr->count == 0) {
@ -365,7 +365,7 @@ PHP_FUNCTION(sem_remove)
}
if ((sem_ptr = (sysvsem_sem *)zend_fetch_resource(Z_RES_P(arg_id), "SysV semaphore", php_sysvsem_module.le_sem)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
#if HAVE_SEMUN

View File

@ -75,7 +75,7 @@ ZEND_GET_MODULE(sysvshm)
#define SHM_FETCH_RESOURCE(shm_ptr, z_ptr) do { \
if ((shm_ptr = (sysvshm_shm *)zend_fetch_resource(Z_RES_P(z_ptr), PHP_SHM_RSRC_NAME, php_sysvshm.le_shm)) == NULL) { \
RETURN_FALSE; \
RETURN_THROWS(); \
} \
} while (0)
@ -235,7 +235,7 @@ PHP_FUNCTION(shm_put_var)
shm_list_ptr = zend_fetch_resource(Z_RES_P(shm_id), PHP_SHM_RSRC_NAME, php_sysvshm.le_shm);
if (!shm_list_ptr) {
smart_str_free(&shm_var);
RETURN_FALSE;
RETURN_THROWS();
}
/* insert serialized variable into shared memory */

View File

@ -790,7 +790,7 @@ PHP_FUNCTION(xmlrpc_server_destroy)
}
if ((server = (xmlrpc_server_data *)zend_fetch_resource(Z_RES_P(arg1), "xmlrpc server", le_xmlrpc_server)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
bSuccess = zend_list_close(Z_RES_P(arg1));
@ -913,7 +913,7 @@ PHP_FUNCTION(xmlrpc_server_register_method)
}
if ((server = (xmlrpc_server_data *)zend_fetch_resource(Z_RES_P(handle), "xmlrpc server", le_xmlrpc_server)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* register with C engine. every method just calls our standard callback,
@ -943,7 +943,7 @@ PHP_FUNCTION(xmlrpc_server_register_introspection_callback)
}
if ((server = (xmlrpc_server_data *)zend_fetch_resource(Z_RES_P(handle), "xmlrpc server", le_xmlrpc_server)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
Z_TRY_ADDREF_P(method_name);
@ -981,7 +981,7 @@ PHP_FUNCTION(xmlrpc_server_call_method)
}
if ((server = (xmlrpc_server_data *)zend_fetch_resource(Z_RES_P(handle), "xmlrpc server", le_xmlrpc_server)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* HACK: use output encoding for now */
@ -1077,7 +1077,7 @@ PHP_FUNCTION(xmlrpc_server_add_introspection_data)
}
if ((server = (xmlrpc_server_data *)zend_fetch_resource(Z_RES_P(handle), "xmlrpc server", le_xmlrpc_server)) == NULL) {
return;
RETURN_THROWS();
}
xDesc = PHP_to_XMLRPC(desc);

View File

@ -1104,7 +1104,7 @@ static PHP_NAMED_FUNCTION(zif_zip_close)
}
if ((z_rsrc = (zip_rsrc *)zend_fetch_resource(Z_RES_P(zip), le_zip_dir_name, le_zip_dir)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
/* really close the zip will break BC :-D */
@ -1126,7 +1126,7 @@ static PHP_NAMED_FUNCTION(zif_zip_read)
}
if ((rsrc_int = (zip_rsrc *)zend_fetch_resource(Z_RES_P(zip_dp), le_zip_dir_name, le_zip_dir)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (rsrc_int && rsrc_int->za) {
@ -1175,11 +1175,11 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
}
if ((zr_rsrc = (zip_read_rsrc *)zend_fetch_resource(Z_RES_P(zip_entry), le_zip_entry_name, le_zip_entry)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if ((z_rsrc = (zip_rsrc *)zend_fetch_resource(Z_RES_P(zip), le_zip_dir_name, le_zip_dir)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (zr_rsrc->zf != NULL) {
@ -1202,7 +1202,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close)
}
if ((zr_rsrc = (zip_read_rsrc *)zend_fetch_resource(Z_RES_P(zip_entry), le_zip_entry_name, le_zip_entry)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
RETURN_BOOL(SUCCESS == zend_list_close(Z_RES_P(zip_entry)));
@ -1224,7 +1224,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)
}
if ((zr_rsrc = (zip_read_rsrc *)zend_fetch_resource(Z_RES_P(zip_entry), le_zip_entry_name, le_zip_entry)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (len <= 0) {
@ -1258,7 +1258,7 @@ static void php_zip_entry_get_info(INTERNAL_FUNCTION_PARAMETERS, int opt) /* {{{
}
if ((zr_rsrc = (zip_read_rsrc *)zend_fetch_resource(Z_RES_P(zip_entry), le_zip_entry_name, le_zip_entry)) == NULL) {
RETURN_FALSE;
RETURN_THROWS();
}
if (!zr_rsrc->zf) {