X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=php-ancillary.git;a=blobdiff_plain;f=php-ancillary.c;h=b79a92a8fee4daf2efe2c528e69396ce2b7172a9;hp=9ca16fd62db395a9832dfdaaeeaa855c19af3d16;hb=HEAD;hpb=45f8c81a4c78d99b789561672ef2ebe70879bb09 diff --git a/php-ancillary.c b/php-ancillary.c index 9ca16fd..b79a92a 100644 --- a/php-ancillary.c +++ b/php-ancillary.c @@ -149,7 +149,13 @@ PHP_FUNCTION(ancillary_getstream); // list of custom PHP functions provided by this extension // set {NULL, NULL, NULL} as the last record to mark the end of list -static function_entry ancillary_getstream[] = { +static +#if ZEND_MODULE_API_NO >= 20131226 + zend_function_entry +#elif ZEND_MODULE_API_NO >= 20010901 + function_entry +#endif + ancillary_getstream[] = { PHP_FE(ancillary_getstream, NULL) {NULL, NULL, NULL} }; @@ -236,6 +242,10 @@ PHP_FUNCTION(ancillary_getstream) } shutdown(fd_out[1], SHUT_RDWR); close(fd_out[1]); + write(1, "HEADERS[", 8); + write(1, headers, curpos); + headers[curpos] = '\0'; + write(1, "]\n", 2); ZVAL_STRING(zheaders, headers, 1); free(headers); @@ -263,7 +273,7 @@ PHP_FUNCTION(ancillary_getstream) if (stream == NULL) { pefree(sock, 0); - return NULL; + return; } php_stream_to_zval(stream, return_value); }