Quantcast
Channel: All Open Tickets - Tera Term on OSDN
Viewing all articles
Browse latest Browse all 2128

waitln command inputstr can contain several lines after a waitn command that times out - Tera Term Ticket #34510 on OSDN

$
0
0

waitln command inputstr can contain several lines after a waitn command that times out

Eröffnet am: 2014-10-19 06:08

Letztes Update: 2014-10-19 06:08

Auswertung:gmmellemVerantwortlicher:(Keine)
Priorität:5 - MittelMeilenstein:(Keine)
Typ:FehlerSchweregrad:5 - Mittel
Komponente:Tera Term MacroStatus:Offen
LösungKeine

Einzelheiten

If you do a waitln command after a waitn command that times out inputstr may contain several lines of text. Following code example below shows the problem. Run the code with a loop back plug on COM (pin 2 connected to pin 3) and terminal transmit to CR + LF to visualize the problem better 1. time the loop runs, inputstr contain "secondline>" 2. time the loop runs, inputstr contain "firstline CRLF secondline>" The problem does not occur when waitn command does not time out.

I have looked at the code, and I think I have found the problem. If a waitn command find the number of bytes (result = 1) the ClearWaitN() function is run (line 164 in ttmmain.cpp). on the other hand if the function times out, ClearWaitN() if not run. This again cause the Receive line buffer not to be cleared inside PutRecvLnBuff(BYTE b) function when it should later in the waitln command (line 403 ttmdde.c is always false). I have inserted a ClearWaitN(); in line 441 ttmmain.cpp when waitn exit because of timeout. Compiled and tested that problem is gone. (however i do not know the code well enough to not guarantee that this modification don't have any unknown side effects)

Code example:

timeout = 1
for tmpcnt  1 2
    flushrecv
    sendln 'firstline'
    sendln 'secondline>'

    waitln '>'
    sprintf 'waitln %d.time inputstr [%s], result [%d]' tmpcnt inputstr result
    messagebox inputstr 'Test'

    waitn 1
next}}}

Letzte Aktualisierung für dieses Ticket

2014-10-19 06:08 Aktualisiert von: gmmellem

  • New Ticket "waitln command inputstr can contain several lines after a waitn command that times out" created

Viewing all articles
Browse latest Browse all 2128