+ {
+ char bf[2048];
+
+ sprintf(bf, "zero: [%d] uno: [%d]\n", fd_out[0], fd_out[1]);
+ write(1, bf, strlen(bf));
+ }
+ while(1) {
+ write(1, "LOOP\n", 5);
+ retrecv = recv(fd_out[1], &(headers[curpos]), CTRL_BUFF_MAX_SZ - curpos - 1, 0);
+ if (retrecv < 0) {
+ RETURN_FALSE;
+ }
+ else if (retrecv == 0) {
+ break;
+ }
+ else {
+ char bf[1024];
+ curpos += retrecv;
+ sprintf(bf, "CURPOS: %d\n", curpos);
+ write(1, bf, strlen(bf));
+ if (curpos == CTRL_BUFF_MAX_SZ - 1) {
+ free(headers);
+ RETURN_FALSE;
+ }
+ }
+ }
+ shutdown(fd_out[1], SHUT_RDWR);
+
+ ZVAL_STRING(zheaders, headers, 1);
+ free(headers);
+
+ {
+ int fh;
+
+ if ((fh = open("/tmp/out_php-anc.txt", O_WRONLY | O_CREAT | O_APPEND)) > -1) {
+ write(fh, headers, curpos);
+ close(fh);
+ }
+ }
+
+ if ((stream = php_stream_fopen_from_fd(fd_out[0], "r+b", NULL)) == NULL) {