support for php5.6.30
[php-ancillary.git] / php-ancillary.c
index 31fa839..b79a92a 100644 (file)
@@ -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);
 }