Greetings, and thanks for looking into this! Waldek Hebisch <[EMAIL PROTECTED]> writes:
> I wrote: > > root wrote: > > > Apparently the ptys are opened in raw mode and do not interpret the > > > control characters but pass them down the pipe to AXIOMsys. However > > > the (read) from axiom simply gets the cntrl-D and tries to parse it. > > > > > > I'm not really sure how this should be handled. Clearly you don't > > > want sman to open up a pty that interprets control characters. > > > Nor do you want lisp's (read) to interpret control characters. > > > > > > > It is not the case. One thing is a bug in sman: when the user > > presses ^D\n sman passes "(1) ->\n" (more precisly AXIOMsys > > reads what is inside quotes). AXIOMsys reacts with an error > > message (exactly like if user gave this input). > > I tracked the problem one step further: > > There is a bug in 'sockio-c.c.pamphlet'. Namely, 'remote_stdio' > function contains the following code: > > if (FD_ISSET(0, &rd)) { > fgets(buf,1024,stdin); > len = strlen(buf); > /* > gets(buf); > len = strlen(buf); > *(buf+len) = '\n'; > *(buf+len+1) = '\0'; > */ > swrite(sock, buf, len, "writing to remote stdin"); > > If we have EOF on stdin fgets reads nothing and the old content > of 'buf' (containing the last AXIOMsys output!) is sent back to > AXIOMsys. I am not sure what the correct fix is: we can easily > detect EOF, but we can not just exit: to exit we have kill > the whole tree of processes spawned by 'sman'. The code above > is executed from 'spadclient' and it is possible to have > more than one copy of 'spadclient' connected to one AXIOMsys, > so we probably should track number of connected clients > and exit AXIOMsys when number of clients goes down to zero > (but we have to be careful at startup, as for short time > there is no client). > It seems that ^D can only be read from the AXIOMsys terminal, which I think should cause an exit of that AXIOMsys. This will close the socket, so that sman or spadclient should be able to have read return 0, which should then cause it to close that connection on its end too. When this should cause a general exit from sman is beyond me -- perhaps there is useful work that can be done with just the hypertex up but no console. Personally, I don't think it too egregious to terminate everything when the 'master' axiom sys (i.e. the first one opened') reads EOF. Take care, > > -- > Waldek Hebisch > [EMAIL PROTECTED] > > > -- Camm Maguire [EMAIL PROTECTED] ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]