Work around uclibc getaddrinfo()

This commit is contained in:
prpr 2021-02-24 14:47:11 +00:00 committed by HummyPkg
parent 67afb37f27
commit f206766191

View File

@ -128,7 +128,7 @@ pkg method loadraw {} {
} else { } else {
set data [exec /bin/opkg info $name] set data [exec /bin/opkg info $name]
} }
foreach line [split $data "\n"] { foreach line [split $data "\n"] {
if {$tag ne "" && [string match { *} $line]} { if {$tag ne "" && [string match { *} $line]} {
append raw($tag) $line append raw($tag) $line
@ -225,7 +225,7 @@ proc {pkg loaddiagmeta} {} {
} }
proc {pkg fetchfile} {url} { proc {pkg fetchfile} {url} {
set f [socket stream hpkg.tv:80] set f [socket stream hpkg.tv:http]
$f puts -nonewline "GET /hdrfoxt2/$url HTTP/1.1\r\n" $f puts -nonewline "GET /hdrfoxt2/$url HTTP/1.1\r\n"
$f puts -nonewline "Host: hpkg.tv\r\n" $f puts -nonewline "Host: hpkg.tv\r\n"
$f puts -nonewline "Connection: close\r\n" $f puts -nonewline "Connection: close\r\n"
@ -237,7 +237,7 @@ proc {pkg fetchfile} {url} {
#puts "Web Header: $line" #puts "Web Header: $line"
set line [string trim [$f gets]] set line [string trim [$f gets]]
} }
# Save the body # Save the body
set ret [$f read] set ret [$f read]
$f close $f close