fix: MML-UPF标准版5002数据行约有400+

This commit is contained in:
TsMask
2024-06-21 15:28:38 +08:00
parent e91ec1b9d2
commit a434d1003d
4 changed files with 16 additions and 10 deletions

View File

@@ -54,8 +54,8 @@ var (
var (
TIME_DELAY_AFTER_WRITE time.Duration = 200
TIME_DEAD_LINE time.Duration = 10
WIN_ROW_SIZE byte = 100
WIN_COL_SIZE byte = 100
WIN_ROW_SIZE int16 = 200
WIN_COL_SIZE int16 = 120
BUFFER_SIZE int = 65535
)
@@ -118,9 +118,15 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) {
// services.ResponseWithJson(w, http.StatusOK, response)
// return
// }
// 发送窗口大小设置命令
conn.Write([]byte{255, 251, 31}) // 发送WILL WINDOW SIZE
conn.Write([]byte{255, 250, 31, 0, WIN_ROW_SIZE, 0, WIN_COL_SIZE, 255, 240}) // 发送设置 WINDOW SIZE
conn.Write([]byte{255, 251, 31}) // 发送WILL WINDOW SIZE
conn.Write([]byte{
255, 250, 31,
byte(WIN_COL_SIZE >> 8), byte(WIN_COL_SIZE & 0xFF),
byte(WIN_ROW_SIZE >> 8), byte(WIN_ROW_SIZE & 0xFF),
255, 240,
}) // 发送设置 WINDOW SIZE
conn.SetDeadline(time.Now().Add(TIME_DEAD_LINE * time.Second))
loginStr := fmt.Sprintf("%s\n%s\n", config.GetYamlConfig().MML.User, config.GetYamlConfig().MML.Password)