Skip to content

Commit

Permalink
util (CPR): fix the problem of always timing out (fixup 1481d48)
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Mar 4, 2022
1 parent 0b8c097 commit 9b331c4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -133,6 +133,7 @@
- Makefile: work around the case the repository is cloned without `--recursive` `#D1655` 22ace5f
- repo: add subdirectories `make` and `docs` `#D1657` 75bd04c
- util: time out <kbd>CPR</kbd> requests `#D1669` 1481d48
- util (CPR): fix the problem of always timing out (fixup 1481d48) `#D1792` 0000000
- main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 0525528 88e2df5
- mandb: integrate `mandb` with `bash-completion` (motivated by Shahabaz-Bagwan, bbyfacekiller and EmilySeville7cfg) `#D1688` c1cd666
- syntax: do not start argument completions immediately after previous word (reported by EmilySeville7cfg) `#D1690` 371a5a4
Expand Down
25 changes: 22 additions & 3 deletions note.txt
Expand Up @@ -1813,9 +1813,6 @@ bash_tips

2022-02-20

* BUG 何故か2回目の char_width_@=auto がちゃんと動いていない気がする。何故だ
ろうか。後で確認する。

* BUG complete: cygwin$ pdflatex [TAB] で /usr/bin/cat: '': No such file or
directory というエラーが出力される。chat では再現しない。bash-completion は
ロードされていない。
Expand Down Expand Up @@ -6155,6 +6152,28 @@ bash_tips

2022-03-02

* canvas: BUG 何故か2回目の char_width_@=auto がちゃんと動いていない気がする [#D1792]
Ref #D1669

何故だろうか。後で確認する。

改めて試してみたがゆっくりやれば何度やっても問題はない。auto を代入してから
急激に RET 等を実行するとそれ以降は常に west, 7.0 にしかならなくなる。CPR
応答の順序がずれてしまっている可能性? 何処かのタイミングでずれを修正したら
治るのだろうか。

* _ble_term_CPR_hook に何か変な物が残存している可能性を確認。

→分かった。逆だった。timeout のコードが悪さをしていた。timeout 時刻の更
新を行っていなかったので常に timeout する状態になっていてまともに CPR が
受信できなくなっていた。 west, 7.0 というのは CPR 応答がなかった時の既定
の値という事だろう。

! ? そもそもどの様にしてずれが起こるのか。初めのずれが起こらない様に調整でき
! るのではないか。

結局 #D1669 の単純なバグだった。修正した。

* blehook -+= は入力しにくいし見にくいので != を一意追加として対応する [#D1791]

* done: != ... 未だ登録されていない時に追加する
Expand Down
2 changes: 2 additions & 0 deletions src/util.sh
Expand Up @@ -6171,13 +6171,15 @@ _ble_term_CPR_hook=()
function ble/term/CPR/request.buff {
((SECONDS>_ble_term_CPR_last_seconds+_ble_term_CPR_timeout)) &&
_ble_term_CPR_hook=()
_ble_term_CPR_last_seconds=$SECONDS
ble/array#push _ble_term_CPR_hook "$1"
ble/util/buffer $'\e[6n'
return 147
}
function ble/term/CPR/request.draw {
((SECONDS>_ble_term_CPR_last_seconds+_ble_term_CPR_timeout)) &&
_ble_term_CPR_hook=()
_ble_term_CPR_last_seconds=$SECONDS
ble/array#push _ble_term_CPR_hook "$1"
ble/canvas/put.draw $'\e[6n'
return 147
Expand Down

0 comments on commit 9b331c4

Please sign in to comment.