+2002-05-22 Ken Raeburn <raeburn@mit.edu>
+
+ * krlogin.c (oob): Loop reading data until we actually reach the
+ URG marker.
+
2002-03-26 Ken Raeburn <raeburn@mit.edu>
* defines.h (FAI_PREFIX): Don't define.
void oob()
{
char mark;
- char waste[RLOGIN_BUFSIZ];
- int atmark;
+ static char waste[RLOGIN_BUFSIZ];
+ int atmark, n;
mark = 0;
recv(rem, &mark, 1, MSG_OOB);
if (server_message(mark)) {
- if (ioctl(rem, SIOCATMARK, &atmark) < 0) {
- perror("ioctl");
- return;
+ for (;;) {
+ if (ioctl(rem, SIOCATMARK, &atmark) < 0) {
+ perror("ioctl");
+ return;
+ }
+ if (atmark)
+ break;
+ n = read(rem, waste, sizeof (waste));
+ if (n <= 0)
+ break;
}
- if (!atmark)
- read(rem, waste, sizeof (waste));
}
}