1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

small changes to the TCP/IP subsystem

This commit is contained in:
Bogdan Marinescu 2008-10-23 20:39:50 +00:00
parent 592b7a2ac7
commit 94f9f2dd9a
2 changed files with 13 additions and 2 deletions

View File

@ -287,7 +287,15 @@ void elua_uip_appcall()
{
#ifdef BUILD_CON_TCP
if( uip_conn->lport == HTONS( ELUA_NET_TELNET_PORT ) ) // special case: telnet server
elua_uip_telnet_socket = sockno;
{
if( elua_uip_telnet_socket == -1 )
{
uip_close();
return;
}
else
elua_uip_telnet_socket = sockno;
}
else
#endif
if( elua_uip_accept_request )
@ -383,6 +391,9 @@ void elua_uip_appcall()
#endif
int lastfound = 0;
// Check end of transmission
if( uip_datalen() < UIP_RECEIVE_WINDOW )
lastfound = 1;
// Check overflow
if( s->len < uip_datalen() )
{

View File

@ -146,7 +146,7 @@ static int net_recv( lua_State *L )
{
int sock = ( int )luaL_checkinteger( L, 1 );
elua_net_size maxsize;
s16 lastchar = -1;
s16 lastchar = ELUA_NET_NO_LASTCHAR;
unsigned timer_id = 0;
u32 timeout = 0;