Running SWRFUSS 1.3 that I've modified. Everything compiles clean, runs indefinitely without crash... however I keep seeing the EOF error from bool read_from_descriptor on some connections. Inevitably it seems to end in a disconnect on their end.
The read_from_descriptor call in game_loop:
--------------------------------------------
--------------------------------------------
--------------------------------------------------
I figured this might be a client end issue with MCCP so I added compressEnd to a few choice spots within the connection functions and hotboot.
This has solved instances of folks that would be DC'ed on hotboot(the disabling of MCCP in hotboot.c). However I can't seem to solve the new connection DC issue for others.
So I know it's returning a false check because nRead == 0 but why it's coming to that is beyond me.
Anyone else run into this on SWRFUSS or SmaugFUSS?
The read_from_descriptor call in game_loop:
--------------------------------------------
d->fcommand = FALSE;
if( FD_ISSET( d->descriptor, &in_set ) )
{
compressEnd(d); // Disable MCCP
d->idle = 0;
if( d->character )
d->character->timer = 0;
if( !read_from_descriptor( d ) )
{
FD_CLR( d->descriptor, &out_set );
if( d->character && ( d->connected == CON_PLAYING || d->connected == CON_EDITING ) )
save_char_obj( d->character );
d->outtop = 0;
close_socket( d, FALSE );
continue;
}
}
--------------------------------------------
bool read_from_descriptor( DESCRIPTOR_DATA * d )
{
int iStart;
/*
* Hold horses if pending command already.
*/
if( d->incomm[0] != '\0' )
return TRUE;
/*
* Check for overflow.
*/
iStart = strlen( d->inbuf );
if( iStart >= sizeof( d->inbuf ) - 10 )
{
sprintf( log_buf, "%s input overflow!", d->host );
log_string( log_buf );
write_to_descriptor( d, "\r\n*** PUT A LID ON IT!!! ***\r\n", 0 );
return FALSE;
}
for( ;; )
{
int nRead;
// nRead = read( d->descriptor, d->inbuf + iStart, sizeof( d->inbuf ) - 10 - iStart );
nRead = recv (d->descriptor, d->inbuf + iStart, sizeof (d->inbuf) - 10 - iStart, 0);
if( nRead > 0 )
{
iStart += nRead;
if( d->inbuf[iStart - 1] == '\n' || d->inbuf[iStart - 1] == '\r' )
break;
}
else if( nRead == 0 )
{
log_string_plus( "EOF encountered on read. Something Amiss", LOG_COMM, sysdata.log_level );
return FALSE;
}
else if( errno == EWOULDBLOCK )
break;
else
{
perror( "Read_from_descriptor" );
return FALSE;
}
}
d->inbuf[iStart] = '\0';
return TRUE;
}
--------------------------------------------------
I figured this might be a client end issue with MCCP so I added compressEnd to a few choice spots within the connection functions and hotboot.
This has solved instances of folks that would be DC'ed on hotboot(the disabling of MCCP in hotboot.c). However I can't seem to solve the new connection DC issue for others.
So I know it's returning a false check because nRead == 0 but why it's coming to that is beyond me.
Anyone else run into this on SWRFUSS or SmaugFUSS?