Changeset 2fac2b1d070cdb9dd9f6ba5fa4977c148cf12600

Show
Ignore:
Timestamp:
01/12/06 21:26:05 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1165004765 +0000
git-parent:

[17853c532cf3f3aebd4eb454b7d5f50dde889f03]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1165004765 +0000
Message:

Hide httpd_t and httpd_host_t within httpd.c

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc.h

    r17853c5 r2fac2b1  
    3333extern const size_t libvlc_hotkeys_size; 
    3434 
     35extern vlc_object_t * 
     36vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type, 
     37                   const char *psz_type); 
     38 
    3539#endif 
  • src/misc/objects.c

    ra5ed35c r2fac2b1  
    3737#endif 
    3838 
     39#include "../libvlc.h" 
    3940#include <vlc_vout.h> 
    4041#include <vlc_aout.h> 
     
    5455 
    5556#include "vlc_httpd.h" 
    56 #include "../network/httpd.h" 
    5757#include "vlc_vlm.h" 
    5858#include "vlc_vod.h" 
     
    8888static vlc_mutex_t    structure_lock; 
    8989 
    90 static vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size, 
     90vlc_object_t *vlc_custom_create( vlc_object_t *p_this, size_t i_size, 
    9191                                 int i_type, const char *psz_type ) 
    9292{ 
     
    286286            psz_type = "stream output"; 
    287287            break; 
    288         case VLC_OBJECT_HTTPD: 
    289             i_size = sizeof( httpd_t ); 
    290             psz_type = "http server"; 
    291             break; 
    292         case VLC_OBJECT_HTTPD_HOST: 
    293             i_size = sizeof( httpd_host_t ); 
    294             psz_type = "http server"; 
    295             break; 
    296288        case VLC_OBJECT_VLM: 
    297289            i_size = sizeof( vlm_t ); 
  • src/network/httpd.c

    r5d10806 r2fac2b1  
    3636#include <vlc_tls.h> 
    3737#include <vlc_acl.h> 
    38 #include "httpd.h" 
     38#include "../libvlc.h" 
    3939 
    4040#include <string.h> 
     
    6565 
    6666static void httpd_ClientClean( httpd_client_t *cl ); 
     67 
     68struct httpd_t 
     69{ 
     70    VLC_COMMON_MEMBERS 
     71 
     72    int          i_host; 
     73    httpd_host_t **host; 
     74}; 
     75 
     76 
     77/* each host run in his own thread */ 
     78struct httpd_host_t 
     79{ 
     80    VLC_COMMON_MEMBERS 
     81 
     82    httpd_t     *httpd; 
     83 
     84    /* ref count */ 
     85    int         i_ref; 
     86 
     87    /* address/port and socket for listening at connections */ 
     88    char        *psz_hostname; 
     89    int         i_port; 
     90    int         *fd; 
     91 
     92    /* Statistics */ 
     93    counter_t *p_active_counter; 
     94    counter_t *p_total_counter; 
     95 
     96    vlc_mutex_t lock; 
     97 
     98    /* all registered url (becarefull that 2 httpd_url_t could point at the same url) 
     99     * This will slow down the url research but make my live easier 
     100     * All url will have their cb trigger, but only the first one can answer 
     101     * */ 
     102    int         i_url; 
     103    httpd_url_t **url; 
     104 
     105    int            i_client; 
     106    httpd_client_t **client; 
     107 
     108    /* TLS data */ 
     109    tls_server_t *p_tls; 
     110}; 
     111 
    67112 
    68113struct httpd_url_t 
     
    9821027} 
    9831028 
     1029static const char psz_object_type[] = "http server"; 
     1030 
    9841031httpd_host_t *httpd_TLSHostNew( vlc_object_t *p_this, const char *psz_hostname, 
    9851032                                int i_port, 
     
    10121059    { 
    10131060        msg_Info( p_this, "creating httpd" ); 
    1014         if( ( httpd = vlc_object_create( p_this, VLC_OBJECT_HTTPD ) ) == NULL ) 
     1061        httpd = (httpd_t *)vlc_custom_create( p_this, sizeof (*httpd), 
     1062                                              VLC_OBJECT_HTTPD, 
     1063                                              psz_object_type ); 
     1064        if (httpd == NULL) 
    10151065        { 
    10161066            vlc_mutex_unlock( lockval.p_address ); 
     
    10721122 
    10731123    /* create the new host */ 
    1074     host = vlc_object_create( p_this, VLC_OBJECT_HTTPD_HOST ); 
     1124    host = (httpd_host_t *)vlc_custom_create( p_this, sizeof (*host), 
     1125                                              VLC_OBJECT_HTTPD_HOST, 
     1126                                              psz_object_type ); 
     1127    if (host == NULL) 
     1128        goto error; 
     1129 
    10751130    host->httpd = httpd; 
    10761131    vlc_mutex_init( httpd, &host->lock );