Thread: Rom... BOOT?
View Single Post
Old 01-07-2009, 06:49 AM   #7
nash
New Member
 
Join Date: Jan 2008
Name: Nash
Location: California
Home MUD: wake.codehallow.com:2177
Posts: 12
nash is on a distinguished road
Re: Rom... BOOT?

Some fun testing led me to find that 1015 characters worth of input get me booted, and a quick look at the logs reveal the boot occuring in this loop in read_from_descriptor:

for (;; ){
int nRead;
nRead = read(d->descriptor,d->inbuf + iStart,sizeof(d->inbuf) - 10 - iStart);
if (nRead > 0){
iStart += nRead;
if(d->inbuf[iStart-1] == '\n' || d->inbuf[iStart-1] == '\r')
break;
}
elseif(nRead == 0){
log_string("EOF encountered on read.");//right here!!!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
returnfalse;
}
elseif(errno == EWOULDBLOCK)
break;
else{
perror("Read_from_descriptor");
returnfalse;
}
}

This is stock code, as I am not comfortable messing with sockets and core I/O, so this should be in most other ROM too...
Edit: Also... rats on it not saving the spaces...

Last edited by nash : 01-07-2009 at 06:54 AM.
nash is offline   Reply With Quote