+ if (0 == 1) {
+ int fh;
+
+ if ((fh = open("/tmp/out_php-anc.txt", O_WRONLY | O_CREAT | O_APPEND)) > -1) {
+ write(fh, headers, curpos);
+ close(fh);
+ }
+ }
+
+ sock = pemalloc(sizeof(php_netstream_data_t), 0);
+ memset(sock, 0, sizeof(php_netstream_data_t));
+
+ sock->is_blocked = 1;
+ sock->timeout.tv_sec = FG(default_socket_timeout);
+ sock->timeout.tv_usec = 0;
+
+ /* we don't know the socket until we have determined if we are binding or
+ * connecting */
+ sock->socket = fd_out[0];
+
+ stream = php_stream_alloc_rel(&php_stream_socket_ops, sock, NULL, "r+");
+
+ if (stream == NULL) {
+ pefree(sock, 0);
+ return NULL;
+ }