- fd_set fds_read, fds_write;
- int i_handle_max = 0;
- int i_ret, i_len, fd, i;
-
- /* if a new client wants to communicate */
- fd = net_Accept( p_intf, p_sys->pi_fd, p_sys->i_clients > 0 ? 0 : -1 );
- if( fd > 0 )
- {
- char *psz_pwd = strdup( _("Password"));
- telnet_client_t *cl;
-
- /* to be non blocking */
-#if defined( WIN32 ) || defined( UNDER_CE )
- {
- unsigned long i_dummy = 1;
- ioctlsocket( fd, FIONBIO, &i_dummy );
- }
-#else
- fcntl( fd, F_SETFL, O_NONBLOCK );
-#endif
- cl = malloc( sizeof( telnet_client_t ));
- cl->i_tel_cmd = 0;
- cl->fd = fd;
- cl->buffer_write = NULL;
- cl->p_buffer_write = cl->buffer_write;
- realloc( psz_pwd, strlen(psz_pwd)+ 5 + 1 );
- strncat( psz_pwd, ": \xff\xfb\x01", 5);
- Write_message( cl, NULL, psz_pwd, WRITE_MODE_PWD );
- free( psz_pwd );
- TAB_APPEND( p_sys->i_clients, p_sys->clients, cl );
- }