File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1938,10 +1938,12 @@ http_head_printf() {
19381938
19391939 IFS=/ read -r proto foo node query <<< "$1"
19401940 node=${node%:*}
1941- # $node works here good as it connects via IPv6 first, then IPv4
1942- bash -c "exec 33<>/dev/tcp/$node/80" 2>/dev/null &
1941+ # $node works here good as it connects via IPv6 first, then IPv4.
1942+ # This is a subshell, so fd 8 is not inherited
1943+ bash -c "exec 8<>/dev/tcp/$node/80" 2>/dev/null &
19431944 wait_kill $! $HEADER_MAXSLEEP
1944- if [[ $? -ne 0 ]]; then
1945+ if [[ $? -eq 0 ]]; then
1946+ exec 33<>/dev/tcp/$node/80
19451947 # not killed --> socket open. Now we connect to the virtual host "$node"
19461948 printf -- "%b" "HEAD ${proto}//${node}/${query} HTTP/1.1\r\nUser-Agent: ${useragent}\r\nHost: ${node}\r\n${request_header}\r\nAccept: */*\r\n\r\n\r\n" >&33 2>$errfile
19471949 ret=0
You can’t perform that action at this time.
0 commit comments