亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ftp.c

?? VLC Player Source Code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * ftp.c: FTP input module ***************************************************************************** * Copyright (C) 2001-2006 the VideoLAN team * Copyright ? 2006 Rémi Denis-Courmont * $Id$ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> - original code *          Rémi Denis-Courmont <rem # videolan.org> - EPSV support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************//***************************************************************************** * Preamble *****************************************************************************/#ifdef HAVE_CONFIG_H# include "config.h"#endif#include <vlc_common.h>#include <vlc_plugin.h>#include <assert.h>#include <vlc_access.h>#include <vlc_interface.h>#include <vlc_network.h>#include "vlc_url.h"#include <vlc_sout.h>#ifndef IPPORT_FTP# define IPPORT_FTP 21u#endif/***************************************************************************** * Module descriptor *****************************************************************************/static int   InOpen ( vlc_object_t * );static void  InClose( vlc_object_t * );static int  OutOpen ( vlc_object_t * );static void OutClose( vlc_object_t * );#define CACHING_TEXT N_("Caching value in ms")#define CACHING_LONGTEXT N_( \    "Caching value for FTP streams. This " \    "value should be set in milliseconds." )#define USER_TEXT N_("FTP user name")#define USER_LONGTEXT N_("User name that will " \    "be used for the connection.")#define PASS_TEXT N_("FTP password")#define PASS_LONGTEXT N_("Password that will be " \    "used for the connection.")#define ACCOUNT_TEXT N_("FTP account")#define ACCOUNT_LONGTEXT N_("Account that will be " \    "used for the connection.")vlc_module_begin();    set_shortname( "FTP" );    set_description( N_("FTP input") );    set_capability( "access", 0 );    set_category( CAT_INPUT );    set_subcategory( SUBCAT_INPUT_ACCESS );    add_integer( "ftp-caching", 2 * DEFAULT_PTS_DELAY / 1000, NULL,                 CACHING_TEXT, CACHING_LONGTEXT, true );    add_string( "ftp-user", "anonymous", NULL, USER_TEXT, USER_LONGTEXT,                false );    add_string( "ftp-pwd", "anonymous@example.com", NULL, PASS_TEXT,                PASS_LONGTEXT, false );    add_string( "ftp-account", "anonymous", NULL, ACCOUNT_TEXT,                ACCOUNT_LONGTEXT, false );    add_shortcut( "ftp" );    set_callbacks( InOpen, InClose );    add_submodule();    set_shortname( "FTP" );    set_description( N_("FTP upload output") );    set_capability( "sout access", 0 );    set_category( CAT_SOUT );    set_subcategory( SUBCAT_SOUT_ACO );    set_callbacks( OutOpen, OutClose );vlc_module_end();/***************************************************************************** * Local prototypes *****************************************************************************/static ssize_t Read( access_t *, uint8_t *, size_t );static ssize_t Write( sout_access_out_t *, block_t * );static int Seek( access_t *, int64_t );static int OutSeek( sout_access_out_t *, off_t );static int Control( access_t *, int, va_list );struct access_sys_t{    vlc_url_t  url;    int        fd_cmd;    int        fd_data;    char       sz_epsv_ip[NI_MAXNUMERICHOST];    bool       out;};#define GET_OUT_SYS( p_this ) \    ((access_sys_t *)(((sout_access_out_t *)(p_this))->p_sys))static int ftp_SendCommand( vlc_object_t *, access_sys_t *, const char *, ... );static int ftp_ReadCommand( vlc_object_t *, access_sys_t *, int *, char ** );static int ftp_StartStream( vlc_object_t *, access_sys_t *, int64_t );static int ftp_StopStream ( vlc_object_t *, access_sys_t * );static int Login( vlc_object_t *p_access, access_sys_t *p_sys ){    int i_answer;    char *psz;    /* *** Open a TCP connection with server *** */    int fd = p_sys->fd_cmd = net_ConnectTCP( p_access, p_sys->url.psz_host,                                             p_sys->url.i_port );    if( fd == -1 )    {        msg_Err( p_access, "connection failed" );        intf_UserFatal( p_access, false, _("Network interaction failed"),                        _("VLC could not connect with the given server.") );        return -1;    }    while( ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) == 1 );    if( i_answer / 100 != 2 )    {        msg_Err( p_access, "connection rejected" );        intf_UserFatal( p_access, false, _("Network interaction failed"),                        _("VLC's connection to the given server was rejected.") );        return -1;    }    msg_Dbg( p_access, "connection accepted (%d)", i_answer );    if( p_sys->url.psz_username && *p_sys->url.psz_username )        psz = strdup( p_sys->url.psz_username );    else        psz = var_CreateGetString( p_access, "ftp-user" );    if( !psz )        return -1;    if( ftp_SendCommand( p_access, p_sys, "USER %s", psz ) < 0 ||        ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )    {        free( psz );        return -1;    }    free( psz );    switch( i_answer / 100 )    {        case 2:            msg_Dbg( p_access, "user accepted" );            break;        case 3:            msg_Dbg( p_access, "password needed" );            if( p_sys->url.psz_password && *p_sys->url.psz_password )                psz = strdup( p_sys->url.psz_password );            else                psz = var_CreateGetString( p_access, "ftp-pwd" );            if( !psz )                return -1;            if( ftp_SendCommand( p_access, p_sys, "PASS %s", psz ) < 0 ||                ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )            {                free( psz );                return -1;            }            free( psz );            switch( i_answer / 100 )            {                case 2:                    msg_Dbg( p_access, "password accepted" );                    break;                case 3:                    msg_Dbg( p_access, "account needed" );                    psz = var_CreateGetString( p_access, "ftp-account" );                    if( ftp_SendCommand( p_access, p_sys, "ACCT %s",                                         psz ) < 0 ||                        ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) < 0 )                    {                        free( psz );                        return -1;                    }                    free( psz );                    if( i_answer / 100 != 2 )                    {                        msg_Err( p_access, "account rejected" );                        intf_UserFatal( p_access, false,                                        _("Network interaction failed"),                                        _("Your account was rejected.") );                        return -1;                    }                    msg_Dbg( p_access, "account accepted" );                    break;                default:                    msg_Err( p_access, "password rejected" );                    intf_UserFatal( p_access, false,                                    _("Network interaction failed"),                                    _("Your password was rejected.") );                    return -1;            }            break;        default:            msg_Err( p_access, "user rejected" );            intf_UserFatal( p_access, false,                        _("Network interaction failed"),                        _("Your connection attempt to the server was rejected.") );            return -1;    }    return 0;}static int Connect( vlc_object_t *p_access, access_sys_t *p_sys ){    if( Login( p_access, p_sys ) < 0 )        return -1;    /* Extended passive mode */    if( ftp_SendCommand( p_access, p_sys, "EPSV ALL" ) < 0 )    {        msg_Err( p_access, "cannot request extended passive mode" );        net_Close( p_sys->fd_cmd );        return -1;    }    if( ftp_ReadCommand( p_access, p_sys, NULL, NULL ) == 2 )    {        if( net_GetPeerAddress( p_sys->fd_cmd, p_sys->sz_epsv_ip, NULL ) )        {            net_Close( p_sys->fd_cmd );            return -1;        }    }    else    {        /* If ESPV ALL fails, we fallback to PASV.         * We have to restart the connection in case there is a NAT that         * understands EPSV ALL in the way, and hence won't allow PASV on         * the initial connection.         */        msg_Info( p_access, "FTP Extended passive mode disabled" );        net_Close( p_sys->fd_cmd );        if( Login( p_access, p_sys ) )        {            net_Close( p_sys->fd_cmd );            return -1;        }    }    /* check binary mode support */    if( ftp_SendCommand( p_access, p_sys, "TYPE I" ) < 0 ||        ftp_ReadCommand( p_access, p_sys, NULL, NULL ) != 2 )    {        msg_Err( p_access, "cannot set binary transfer mode" );        net_Close( p_sys->fd_cmd );        return -1;    }    return 0;}static int parseURL( vlc_url_t *url, const char *path ){    if( path == NULL )        return VLC_EGENERIC;    /* *** Parse URL and get server addr/port and path *** */    while( *path == '/' )        path++;    vlc_UrlParse( url, path, 0 );    if( url->psz_host == NULL || *url->psz_host == '\0' )        return VLC_EGENERIC;    if( url->i_port <= 0 )        url->i_port = IPPORT_FTP; /* default port */    /* FTP URLs are relative to user's default directory (RFC1738)    For absolute path use ftp://foo.bar//usr/local/etc/filename */    if( url->psz_path && *url->psz_path == '/' )        url->psz_path++;    return VLC_SUCCESS;}/**************************************************************************** * Open: connect to ftp server and ask for file ****************************************************************************/static int InOpen( vlc_object_t *p_this ){    access_t     *p_access = (access_t*)p_this;    access_sys_t *p_sys;    char         *psz_arg;    /* Init p_access */    STANDARD_READ_ACCESS_INIT    p_sys->fd_data = -1;    p_sys->out = false;    if( parseURL( &p_sys->url, p_access->psz_path ) )        goto exit_error;    if( Connect( p_this, p_sys ) )        goto exit_error;    /* get size */    if( ftp_SendCommand( p_this, p_sys, "SIZE %s", p_sys->url.psz_path ? : "" ) < 0 ||        ftp_ReadCommand( p_this, p_sys, NULL, &psz_arg ) != 2 )    {        msg_Err( p_access, "cannot get file size" );        net_Close( p_sys->fd_cmd );        goto exit_error;    }    p_access->info.i_size = atoll( &psz_arg[4] );    free( psz_arg );    msg_Dbg( p_access, "file size: %"PRId64, p_access->info.i_size );    /* Start the 'stream' */    if( ftp_StartStream( p_this, p_sys, 0 ) < 0 )    {        msg_Err( p_access, "cannot retrieve file" );        net_Close( p_sys->fd_cmd );        goto exit_error;    }    /* Update default_pts to a suitable value for ftp access */    var_Create( p_access, "ftp-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );    return VLC_SUCCESS;exit_error:    vlc_UrlClean( &p_sys->url );    free( p_sys );    return VLC_EGENERIC;}static int OutOpen( vlc_object_t *p_this ){    sout_access_out_t *p_access = (sout_access_out_t *)p_this;    access_sys_t      *p_sys;    p_sys = malloc( sizeof( *p_sys ) );    if( p_sys == NULL )        return VLC_ENOMEM;    memset( p_sys, 0, sizeof( *p_sys ) );    /* Init p_access */    p_sys->fd_data = -1;    p_sys->out = true;    if( parseURL( &p_sys->url, p_access->psz_path ) )        goto exit_error;    if( Connect( p_this, p_sys ) )        goto exit_error;    /* Start the 'stream' */    if( ftp_StartStream( p_this, p_sys, 0 ) < 0 )    {        msg_Err( p_access, "cannot store file" );        net_Close( p_sys->fd_cmd );        goto exit_error;    }    p_access->pf_seek = OutSeek;    p_access->pf_write = Write;    p_access->p_sys = (void *)p_sys;    return VLC_SUCCESS;exit_error:    vlc_UrlClean( &p_sys->url );    free( p_sys );    return VLC_EGENERIC;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久久久免费精品国产| 亚洲综合色丁香婷婷六月图片| 亚洲成人福利片| 成人av资源下载| 国产欧美一区二区精品性色| 免费在线看一区| 日韩精品一区二区在线观看| 亚洲欧洲在线观看av| 国产成人综合在线| 国产日韩综合av| 免费日韩伦理电影| 国产成人精品免费在线| 欧洲国内综合视频| 亚洲一区免费视频| 在线观看一区日韩| 亚洲国产日产av| 欧美性xxxxxxxx| 天天综合网 天天综合色| 欧美色窝79yyyycom| 偷拍日韩校园综合在线| 欧美久久久一区| 日本vs亚洲vs韩国一区三区| 欧美一级欧美三级在线观看| 日韩激情视频在线观看| 日韩欧美不卡一区| 极品美女销魂一区二区三区免费| 欧美精品一区二区久久久| 国产中文一区二区三区| 国产精品乱子久久久久| 91性感美女视频| 视频一区在线播放| 久久综合久久鬼色中文字| 国产成人精品影院| 亚洲一卡二卡三卡四卡五卡| 欧美精品亚洲二区| 国产伦精品一区二区三区免费| 国产精品国产三级国产aⅴ中文| 99精品久久免费看蜜臀剧情介绍| 亚洲精品亚洲人成人网在线播放| 高清国产一区二区| 午夜视频一区二区| 久久精品在这里| 欧美天堂一区二区三区| 国产乱子伦视频一区二区三区 | 黄色精品一二区| 国产精品久久久久久户外露出| 欧美丝袜丝nylons| 风间由美性色一区二区三区| 亚洲愉拍自拍另类高清精品| 26uuu国产电影一区二区| 91丨国产丨九色丨pron| 韩日av一区二区| 亚洲电影在线播放| 中文字幕亚洲区| 久久久久国产精品免费免费搜索| 欧美人体做爰大胆视频| 成人免费视频caoporn| 经典三级一区二区| 视频一区二区三区在线| 樱花影视一区二区| 亚洲视频你懂的| 国产精品久久久久久久第一福利 | 日韩精品三区四区| 亚洲免费观看高清| 欧美一级国产精品| 99久久精品国产一区二区三区 | 一区二区三区在线视频观看58| 久久久久亚洲蜜桃| 欧美大尺度电影在线| 制服.丝袜.亚洲.中文.综合| 欧美精品自拍偷拍| 欧美日本在线视频| 欧美日韩激情一区二区| 欧美日韩国产精品成人| 欧美久久久久免费| 日韩欧美国产高清| 精品国产乱码久久久久久免费| 日韩久久精品一区| 精品少妇一区二区三区在线视频 | 91极品美女在线| 在线观看视频欧美| 欧美高清www午色夜在线视频| 正在播放一区二区| 久久精品一区蜜桃臀影院| 欧美国产一区在线| 亚洲另类春色校园小说| 亚洲chinese男男1069| 免费成人av在线| 国产大陆a不卡| 97久久精品人人澡人人爽| 成人一区二区三区中文字幕| 成熟亚洲日本毛茸茸凸凹| 在线观看三级视频欧美| 欧美另类高清zo欧美| 亚洲精品一区二区三区香蕉| 中文字幕中文字幕一区二区| 亚洲一级二级三级在线免费观看| 午夜欧美在线一二页| 丰满岳乱妇一区二区三区| 欧美丝袜自拍制服另类| 久久久欧美精品sm网站 | 在线视频综合导航| 精品国产不卡一区二区三区| 亚洲精品ww久久久久久p站| 久久99国产精品尤物| 一本大道久久a久久综合婷婷| 日韩情涩欧美日韩视频| 亚洲综合一二三区| 粉嫩av一区二区三区在线播放| 欧美日韩一区久久| 亚洲色图一区二区| 国产成人自拍网| 91精品国模一区二区三区| 亚洲精品高清在线观看| 国产成人av电影在线观看| 777a∨成人精品桃花网| 亚洲午夜在线观看视频在线| www..com久久爱| 欧美激情综合五月色丁香小说| 日本欧美大码aⅴ在线播放| 日本久久一区二区| 26uuu欧美| 天堂av在线一区| 欧美日韩精品专区| 亚洲另类中文字| 91丨porny丨国产入口| 欧美极品aⅴ影院| 成人午夜看片网址| 国产精品亲子乱子伦xxxx裸| 国产一区亚洲一区| 国产日韩v精品一区二区| 国产一区二区视频在线| 欧美电视剧在线看免费| 韩国v欧美v日本v亚洲v| 亚洲精品一线二线三线| 国产精品一区二区三区网站| 久久久久国产一区二区三区四区 | 亚洲成人精品在线观看| 欧美理论电影在线| 久久99在线观看| 久久精品一区二区三区av| 成人精品鲁一区一区二区| 中文在线一区二区| 北岛玲一区二区三区四区 | 色综合久久久久久久久| 午夜精品123| 欧美zozo另类异族| av中文字幕不卡| 亚洲一区二区四区蜜桃| 精品国产乱码久久久久久图片 | 麻豆一区二区三| 国产精品网站在线| 欧美三级日韩三级国产三级| 久久99精品久久久久婷婷| 国产欧美精品日韩区二区麻豆天美| 97精品久久久午夜一区二区三区 | 成人黄色777网| 午夜精品久久久久久久99樱桃| 日韩精品一区二区三区中文不卡 | 国产一区二区在线观看视频| 亚洲天堂av一区| 精品国产91九色蝌蚪| 色就色 综合激情| 国产一区二区在线影院| 午夜精品123| 亚洲欧美视频在线观看视频| 精品国产人成亚洲区| 在线免费观看日本一区| 国产成人啪午夜精品网站男同| 亚洲不卡在线观看| 亚洲精品自拍动漫在线| 亚洲精品在线观| 91麻豆精品国产91久久久久久| av激情亚洲男人天堂| 国产v综合v亚洲欧| 蜜臀久久99精品久久久画质超高清 | 精品一区二区三区视频在线观看| 国产精品福利一区| 国产日韩亚洲欧美综合| 日韩午夜在线播放| 日韩一区二区中文字幕| 欧美日韩一级大片网址| 欧美主播一区二区三区| 色综合久久99| 97久久超碰国产精品| www.日韩精品| 91网址在线看| 色偷偷88欧美精品久久久| 91香蕉视频在线| jlzzjlzz欧美大全| 成人av在线一区二区三区| 成人av在线电影| 成人精品电影在线观看| 99久免费精品视频在线观看| 91在线小视频| 91在线观看视频| 色综合中文字幕国产 | 偷窥少妇高潮呻吟av久久免费| 亚洲一区二区三区在线| 日韩黄色免费电影|