* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_input.h>
set_category( CAT_INTERFACE );
set_subcategory( SUBCAT_INTERFACE_CONTROL );
add_string( "telnet-host", "", NULL, TELNETHOST_TEXT,
- TELNETHOST_LONGTEXT, VLC_TRUE );
+ TELNETHOST_LONGTEXT, true );
add_integer( "telnet-port", TELNETPORT_DEFAULT, NULL, TELNETPORT_TEXT,
- TELNETPORT_LONGTEXT, VLC_TRUE );
+ TELNETPORT_LONGTEXT, true );
add_password( "telnet-password", TELNETPWD_DEFAULT, NULL, TELNETPWD_TEXT,
- TELNETPWD_LONGTEXT, VLC_TRUE );
- set_description( _("VLM remote control interface") );
- add_category_hint( "VLM", NULL, VLC_FALSE );
+ TELNETPWD_LONGTEXT, true );
+ set_description( N_("VLM remote control interface") );
+ add_category_hint( "VLM", NULL, false );
set_capability( "interface", 0 );
set_callbacks( Open , Close );
vlc_module_end();
free( cl );
p_sys->clients[i] = NULL;
}
- if( p_sys->clients != NULL ) free( p_sys->clients );
+ free( p_sys->clients );
net_ListenClose( p_sys->pi_fd );
cl->i_mode + 2 );
}
- if (i_recv <= 0)
+ if (i_recv <= 0 && ( end || errno != EAGAIN ) )
goto drop;
}
}
if (ufd[ncli + i].revents == 0)
continue;
- fd = accept (ufd[ncli + i].fd, NULL, NULL);
+ fd = net_AcceptSingle (VLC_OBJECT(p_intf), ufd[ncli + i].fd);
if (fd == -1)
continue;
TAB_APPEND( p_sys->i_clients, p_sys->clients, cl );
}
}
- if( psz_password )
- free( psz_password );
+ free( psz_password );
}
static void Write_message( telnet_client_t *client, vlm_message_t *message,
client->p_buffer_read = client->buffer_read;
(client->p_buffer_read)[0] = 0; // if (cl->p_buffer_read)[0] = '\n'
- if( client->buffer_write ) free( client->buffer_write );
+ free( client->buffer_write );
/* generate the psz_message string */
if( message )