--- ray/src/hd/rhdisp.c 1998/08/26 13:06:09 3.32 +++ ray/src/hd/rhdisp.c 1998/11/11 16:58:51 3.35 @@ -109,7 +109,7 @@ char *argv[]; if (inp & DFL(DC_QUIT)) serv_request(DR_SHUTDOWN, 0, NULL); } - if (rdy & RDY_SIN) /* user input from sstdin */ + if (rdy & RDY_SIN && !imm_mode) /* user input from sstdin */ switch (usr_input()) { case DC_PAUSE: pause = 1; @@ -289,8 +289,9 @@ again: } copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN)); goto again; - } - beam_sync(0); /* update server */ + } + /* update server */ + imm_mode = beam_sync(0) > 0; /* record new view */ if (v < viewhist || v >= viewhist+VIEWHISTLEN) { copystruct(viewhist + (nhist%VIEWHISTLEN), v); @@ -421,14 +422,15 @@ serv_result() /* get next server result and process case DS_STARTIMM: case DS_ENDIMM: #ifdef DEBUG - if (imm_mode != (msg.type==DS_STARTIMM)) { + { time_t tnow = time(NULL); - if (imm_mode) timm += tnow - tmodesw; - else tadd += tnow - tmodesw; + if (msg.type==DS_STARTIMM) tadd += tnow - tmodesw; + else timm += tnow - tmodesw; tmodesw = tnow; } #endif - imm_mode = msg.type==DS_STARTIMM; + if (!(imm_mode = msg.type==DS_STARTIMM)) + dev_flush(); goto noargs; case DS_ACKNOW: case DS_SHUTDOWN: @@ -457,6 +459,11 @@ char *p; { MSGHEAD msg; int m; + /* consistency checks */ +#ifdef DEBUG + if (nbytes < 0 || nbytes > 0 & p == NULL) + error(CONSISTENCY, "bad buffer handed to serv_request"); +#endif /* get server's attention for big request */ if (nbytes >= BIGREQSIZ-sizeof(MSGHEAD)) { serv_request(DR_ATTEN, 0, NULL);