示例#1
0
static void
handle_stat(struct vsf_session* p_sess)
{
  vsf_cmdio_write_hyphen(p_sess, FTP_STATOK, "FTP server status:");
  vsf_cmdio_write_raw(p_sess, "     Connected to ");
  vsf_cmdio_write_raw(p_sess, str_getbuf(&p_sess->remote_ip_str));
  vsf_cmdio_write_raw(p_sess, "\r\n");
  vsf_cmdio_write_raw(p_sess, "     Logged in as ");
  vsf_cmdio_write_raw(p_sess, str_getbuf(&p_sess->user_str));
  vsf_cmdio_write_raw(p_sess, "\r\n");
  vsf_cmdio_write_raw(p_sess, "     TYPE: ");
  if (p_sess->is_ascii)
  {
    vsf_cmdio_write_raw(p_sess, "ASCII\r\n");
  }
  else
  {
    vsf_cmdio_write_raw(p_sess, "BINARY\r\n");
  }
  if (p_sess->bw_rate_max == 0)
  {
    vsf_cmdio_write_raw(p_sess, "     No session bandwidth limit\r\n");
  }
  else
  {
    vsf_cmdio_write_raw(p_sess, "     Session bandwidth limit in byte/s is ");
    vsf_cmdio_write_raw(p_sess, vsf_sysutil_ulong_to_str(p_sess->bw_rate_max));
    vsf_cmdio_write_raw(p_sess, "\r\n");
  }
  if (tunable_idle_session_timeout == 0)
  {
    vsf_cmdio_write_raw(p_sess, "     No session timeout\r\n");
  }
  else
  {
    vsf_cmdio_write_raw(p_sess, "     Session timeout in seconds is ");
    vsf_cmdio_write_raw(p_sess,
      vsf_sysutil_ulong_to_str(tunable_idle_session_timeout));
    vsf_cmdio_write_raw(p_sess, "\r\n");
  }
  if (p_sess->num_clients > 0)
  {
    vsf_cmdio_write_raw(p_sess, "     At session startup, client count was ");
    vsf_cmdio_write_raw(p_sess, vsf_sysutil_ulong_to_str(p_sess->num_clients));
    vsf_cmdio_write_raw(p_sess, "\r\n");
  }
  vsf_cmdio_write_raw(p_sess, "     vsFTPd - secure, fast, stable\r\n");
  vsf_cmdio_write(p_sess, FTP_STATOK, "End of status");
}
示例#2
0
文件: str.c 项目: Einheri/wl500g
void
str_append_ulong(struct mystr* p_str, unsigned long the_ulong)
{
  str_append_text(p_str, vsf_sysutil_ulong_to_str(the_ulong));
}