mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-20 03:00:45 +00:00
ykxmz 1.5.0锛氫慨澶嶆墜琛ㄧ TLS 璇佷功鏍¢獙 + MTU 淇缃戠粶绋冲畾鎬?
琚帶绔?- 淇 MTU 闂锛氬す MSS + 璺緞 MTU 鎺㈡祴锛堝叕缃戝彲鐢ㄧ巼 48% -> 100%锛?- 澶嶇敤 HTTP 杩炴帴锛堝厤鎺夋瘡娆℃柊寤?TLS 鐨?30% 鎻℃墜澶辫触锛?- 姣忓垎閽熷洖澶存壘灞€鍩熺綉锛岃嚜鍔ㄥ垏鍥炲揩 400 鍊嶇殑璺緞 - 鐢婚潰蹇冭烦甯э細闈欐鏃剁渷娴侀噺锛屽鎴风浠嶇煡閬撴祦鏄椿鐨?- 閿佸睆鏃剁粰鍑哄彲鎿嶄綔鐨勬彁绀? 鎵嬭〃绔?- 鍐呯疆 GTS Root R4 / GlobalSign Root CA锛屼慨 SSLHandshakeException - 杩炴帴閿欒缈昏瘧鎴愪汉璇濓紙璇佷功/鏃堕棿/瑙f瀽/瓒呮椂鍒嗗埆鎻愮ず锛?- 缁忎腑杞繛涓婂悗鐢ㄦ湇鍔″櫒鎶ョ殑鍦板潃鍒锋柊宸查厤瀵硅褰?- 鏂板灞€鍩熺綉杩炴帴椤甸潰銆佹湇鍔″櫒寤惰繜妫€娴? 鏈嶅姟鍣ㄧ - 鏀寔 chunked 璇锋眰浣擄紙淇瘡 16 绉掍竴娆$殑杩炴帴閿欎贡涓庡ぇ闈㈢Н 502锛?- 缃戠粶璋冧紭鑴氭湰 net-tune.sh锛堝紑鏈鸿嚜鍔ㄥ簲鐢級 - 绠$悊椤碉細鎵归噺鍒犻櫎銆佺綉缁滀綋妫€銆佷笅杞藉尯 - 闅ч亾鏀?HTTP/2 + 鍙岃繛鎺? 鏂囨。 - 璁稿彲鍗忚 / 瀹夎鍓嶅繀璇?/ 瀹夎鍚庨』鐭ワ紙浣滆€咃細灏忛害瀛愶級
This commit is contained in:
@@ -0,0 +1,241 @@
|
||||
|
||||
# -*- tcl -*-
|
||||
# ### ### ### ######### ######### #########
|
||||
## Overview
|
||||
|
||||
# Higher-level commands which invoke the functionality of this package
|
||||
# for an arbitrary tcl shell (tclsh, wish, ...). This is required by a
|
||||
# repository as while the tcl shell executing packages uses the same
|
||||
# platform in general as a repository application there can be
|
||||
# differences in detail (i.e. 32/64 bit builds).
|
||||
|
||||
# ### ### ### ######### ######### #########
|
||||
## Requirements
|
||||
|
||||
package require platform
|
||||
namespace eval ::platform::shell {}
|
||||
|
||||
# ### ### ### ######### ######### #########
|
||||
## Implementation
|
||||
|
||||
# -- platform::shell::generic
|
||||
|
||||
proc ::platform::shell::generic {shell} {
|
||||
# Argument is the path to a tcl shell.
|
||||
|
||||
CHECK $shell
|
||||
LOCATE base out
|
||||
|
||||
set code {}
|
||||
# Forget any pre-existing platform package, it might be in
|
||||
# conflict with this one.
|
||||
lappend code {package forget platform}
|
||||
# Inject our platform package
|
||||
lappend code [list source $base]
|
||||
# Query and print the architecture
|
||||
lappend code {puts [platform::generic]}
|
||||
# And done
|
||||
lappend code {exit 0}
|
||||
|
||||
set arch [RUN $shell [join $code \n]]
|
||||
|
||||
if {$out} {file delete -force $base}
|
||||
return $arch
|
||||
}
|
||||
|
||||
# -- platform::shell::identify
|
||||
|
||||
proc ::platform::shell::identify {shell} {
|
||||
# Argument is the path to a tcl shell.
|
||||
|
||||
CHECK $shell
|
||||
LOCATE base out
|
||||
|
||||
set code {}
|
||||
# Forget any pre-existing platform package, it might be in
|
||||
# conflict with this one.
|
||||
lappend code {package forget platform}
|
||||
# Inject our platform package
|
||||
lappend code [list source $base]
|
||||
# Query and print the architecture
|
||||
lappend code {puts [platform::identify]}
|
||||
# And done
|
||||
lappend code {exit 0}
|
||||
|
||||
set arch [RUN $shell [join $code \n]]
|
||||
|
||||
if {$out} {file delete -force $base}
|
||||
return $arch
|
||||
}
|
||||
|
||||
# -- platform::shell::platform
|
||||
|
||||
proc ::platform::shell::platform {shell} {
|
||||
# Argument is the path to a tcl shell.
|
||||
|
||||
CHECK $shell
|
||||
|
||||
set code {}
|
||||
lappend code {puts $tcl_platform(platform)}
|
||||
lappend code {exit 0}
|
||||
|
||||
return [RUN $shell [join $code \n]]
|
||||
}
|
||||
|
||||
# ### ### ### ######### ######### #########
|
||||
## Internal helper commands.
|
||||
|
||||
proc ::platform::shell::CHECK {shell} {
|
||||
if {![file exists $shell]} {
|
||||
return -code error "Shell \"$shell\" does not exist"
|
||||
}
|
||||
if {![file executable $shell]} {
|
||||
return -code error "Shell \"$shell\" is not executable (permissions)"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
proc ::platform::shell::LOCATE {bv ov} {
|
||||
upvar 1 $bv base $ov out
|
||||
|
||||
# Locate the platform package for injection into the specified
|
||||
# shell. We are using package management to find it, whereever it
|
||||
# is, instead of using hardwired relative paths. This allows us to
|
||||
# install the two packages as TMs without breaking the code
|
||||
# here. If the found package is wrapped we copy the code somewhere
|
||||
# where the spawned shell will be able to read it.
|
||||
|
||||
# This code is brittle, it needs has to adapt to whatever changes
|
||||
# are made to the TM code, i.e. the provide statement generated by
|
||||
# tm.tcl
|
||||
|
||||
set pl [package ifneeded platform [package require platform]]
|
||||
set base [lindex $pl end]
|
||||
|
||||
set out 0
|
||||
if {[lindex [file system $base]] ne "native"} {
|
||||
set temp [TEMP]
|
||||
file copy -force $base $temp
|
||||
set base $temp
|
||||
set out 1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
proc ::platform::shell::RUN {shell code} {
|
||||
set c [TEMP]
|
||||
set cc [open $c w]
|
||||
puts $cc $code
|
||||
close $cc
|
||||
|
||||
set e [TEMP]
|
||||
|
||||
set code [catch {
|
||||
exec $shell $c 2> $e
|
||||
} res]
|
||||
|
||||
file delete $c
|
||||
|
||||
if {$code} {
|
||||
append res \n[read [set chan [open $e r]]][close $chan]
|
||||
file delete $e
|
||||
return -code error "Shell \"$shell\" is not executable ($res)"
|
||||
}
|
||||
|
||||
file delete $e
|
||||
return $res
|
||||
}
|
||||
|
||||
proc ::platform::shell::TEMP {} {
|
||||
set prefix platform
|
||||
|
||||
# This code is copied out of Tcllib's fileutil package.
|
||||
# (TempFile/tempfile)
|
||||
|
||||
set tmpdir [DIR]
|
||||
|
||||
set chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
set nrand_chars 10
|
||||
set maxtries 10
|
||||
set access [list RDWR CREAT EXCL TRUNC]
|
||||
set permission 0600
|
||||
set channel ""
|
||||
set checked_dir_writable 0
|
||||
set mypid [pid]
|
||||
for {set i 0} {$i < $maxtries} {incr i} {
|
||||
set newname $prefix
|
||||
for {set j 0} {$j < $nrand_chars} {incr j} {
|
||||
append newname [string index $chars \
|
||||
[expr {int(rand()*62)}]]
|
||||
}
|
||||
set newname [file join $tmpdir $newname]
|
||||
if {[file exists $newname]} {
|
||||
after 1
|
||||
} else {
|
||||
if {[catch {open $newname $access $permission} channel]} {
|
||||
if {!$checked_dir_writable} {
|
||||
set dirname [file dirname $newname]
|
||||
if {![file writable $dirname]} {
|
||||
return -code error "Directory $dirname is not writable"
|
||||
}
|
||||
set checked_dir_writable 1
|
||||
}
|
||||
} else {
|
||||
# Success
|
||||
close $channel
|
||||
return [file normalize $newname]
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$channel ne ""} {
|
||||
return -code error "Failed to open a temporary file: $channel"
|
||||
} else {
|
||||
return -code error "Failed to find an unused temporary file name"
|
||||
}
|
||||
}
|
||||
|
||||
proc ::platform::shell::DIR {} {
|
||||
# This code is copied out of Tcllib's fileutil package.
|
||||
# (TempDir/tempdir)
|
||||
|
||||
global tcl_platform env
|
||||
|
||||
set attempdirs [list]
|
||||
|
||||
foreach tmp {TMPDIR TEMP TMP} {
|
||||
if { [info exists env($tmp)] } {
|
||||
lappend attempdirs $env($tmp)
|
||||
}
|
||||
}
|
||||
|
||||
switch $tcl_platform(platform) {
|
||||
windows {
|
||||
lappend attempdirs "C:\\TEMP" "C:\\TMP" "\\TEMP" "\\TMP"
|
||||
}
|
||||
macintosh {
|
||||
set tmpdir $env(TRASH_FOLDER) ;# a better place?
|
||||
}
|
||||
default {
|
||||
lappend attempdirs \
|
||||
[file join / tmp] \
|
||||
[file join / var tmp] \
|
||||
[file join / usr tmp]
|
||||
}
|
||||
}
|
||||
|
||||
lappend attempdirs [pwd]
|
||||
|
||||
foreach tmp $attempdirs {
|
||||
if { [file isdirectory $tmp] && [file writable $tmp] } {
|
||||
return [file normalize $tmp]
|
||||
}
|
||||
}
|
||||
|
||||
# Fail if nothing worked.
|
||||
return -code error "Unable to determine a proper directory for temporary files"
|
||||
}
|
||||
|
||||
# ### ### ### ######### ######### #########
|
||||
## Ready
|
||||
|
||||
package provide platform::shell 1.1.4
|
||||
Reference in New Issue
Block a user