X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=php-ancillary.git;a=blobdiff_plain;f=php-ancillary.c;h=b79a92a8fee4daf2efe2c528e69396ce2b7172a9;hp=31fa8397aa4577c232708f650d7e1727ffc16f1e;hb=HEAD;hpb=fb0fe2c49024cc3d711e092108066270a094b955 diff --git a/php-ancillary.c b/php-ancillary.c index 31fa839..b79a92a 100644 --- a/php-ancillary.c +++ b/php-ancillary.c @@ -97,7 +97,7 @@ ancil_recv_fds_with_buffer_ext(int sock, int *fds, unsigned n_fds, void *buffer, if((mop_len = recvmsg(sock, &msghdr, 0)) < 0) return(-1); - { + if (0 == 1) { int mop_fd; char mop_bf[512]; @@ -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); }