TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Bill Bond
date: 1995-05-09 15:39:54
subject: BTPE

On May 03 22:48 95, Paul Edwards wrote to Mike Bilow:

MB>> like to go back to it.  It would just drop most of the 
MB>> characters during the paste operation, which is pretty hard 

PE> People have reported to me that this problem existed in all
PE> text mode applications (e.g. emacs), and was not specific to
PE> msged.  They also reported that the problem went away with
PE> the installation of warp.  BFN.  Paul.

The problem still exists even with Warp and is what I'd call a bug in
Msged.  It doesn't use blocking i/o (Peter don't read this :) ) and a paste
operation overflows the event buffer (EVent in os2scr.c).  

This isn't to say that there isn't/wasn't another bug in OS/2 that
contributed to this behavior.

The simple fix was to check for a full buffer before reading the keyboard
and not read from the keyboard until there was room in the buffer.  I sent
some netmail yesterday with some diffs that include this, but will post
here in case the netmail goes astray (2 longish messages with diffs).

from os2scr.c:

static int mykbhit(void)
{
    KBDKEYINFO ki;
        
    if (FullBuffer())
        return 0;

    ki.fbStatus = 0;
    KbdPeek(&ki, 0);

    if (ki.fbStatus & KBDTRF_FINAL_CHAR_IN) return (1);
    else return (0);
}


static int FullBuffer()
{
    if (((ebufin + 1) % EBUFSZ) != ebufout)
            return 0;
        else
            return 1;
}


The correct way to fix it would probably be to use separate threads for the
keyboard and mouse and use blocking i/o.  This might break the DOS support
though.  I haven't had time to explore this more fully.

Bill


--- Msgedsq/2 3.05wb.01
* Origin: The Hidden Kingdom, Williston, VT. (1:325/118.1)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 325/118 320/209 142/1 3615/50 396/1 270/101 105/103 42 712/515 711/808
@PATH: 711/809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.