<commit_before>/*****************************************************************************
 * http.c
 *****************************************************************************
 * Copyright (C) 2001-2003 VideoLAN
 * $Id$
 *
 * Authors: <NAME> <<EMAIL>>
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/
#include <stdlib.h>

#include <vlc/vlc.h>
#include <vlc/sout.h>

#include "vlc_httpd.h"
#include "vlc_tls.h"

#define FREE( p ) if( p ) { free( p); (p) = NULL; }

#define DEFAULT_PORT        8080
#define DEFAULT_SSL_PORT    8443

/*****************************************************************************
 * Module descriptor
 *****************************************************************************/
static int  Open ( vlc_object_t * );
static void Close( vlc_object_t * );

#define SOUT_CFG_PREFIX "sout-http-"

#define USER_TEXT N_("Username")
#define USER_LONGTEXT N_("Allows you to give a user name that will be " \
                         "requested to access the stream." )
#define PASS_TEXT N_("Password")
#define PASS_LONGTEXT N_("Allows you to give a password that will be " \
                         "requested to access the stream." )
#define MIME_TEXT N_("Mime")
#define MIME_LONGTEXT N_("Allows you to give the mime returned by the server." )

#define CERT_TEXT N_( "Certificate file" )
#define CERT_LONGTEXT N_( "Path to the x509 PEM certificate file that will "\
                          "be used by the HTTP/SSL stream output" )
#define KEY_TEXT N_( "Private key file" )
#define KEY_LONGTEXT N_( "Path to the x509 PEM private key file that will " \
                         " be used by the HTTP/SSL stream output. Leave " \
                         "empty if you don't have one." )
#define CA_TEXT N_( "Root CA file" )
#define CA_LONGTEXT N_( "Path to the x509 PEM trusted root CA certificates " \
                        "(certificate authority) file that will be used by " \
                        "the HTTP/SSL stream output. Leave empty if you " \
                        "don't have one." )
#define CRL_TEXT N_( "CRL file" )
#define CRL_LONGTEXT N_( "Path to the x509 PEM Certificates Revocation List " \
                         "file that will be HTTP/SSL stream output. Leave " \
                         "empty if you don't have one." )

vlc_module_begin();
    set_description( _("HTTP stream output") );
    set_capability( "sout access", 0 );
    add_shortcut( "http" );
    add_shortcut( "https" );
    add_shortcut( "mmsh" );
    add_string( SOUT_CFG_PREFIX "user", "", NULL,
                USER_TEXT, USER_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "pwd", "", NULL,
                PASS_TEXT, PASS_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "mime", "", NULL,
                MIME_TEXT, MIME_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "cert", "vlc.pem", NULL,
                CERT_TEXT, CERT_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "key", NULL, NULL,
                KEY_TEXT, KEY_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "ca", NULL, NULL,
                CA_TEXT, CA_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "crl", NULL, NULL,
                CRL_TEXT, CRL_LONGTEXT, VLC_TRUE );
    set_callbacks( Open, Close );
vlc_module_end();


/*****************************************************************************
 * Exported prototypes
 *****************************************************************************/
static const char *ppsz_sout_options[] = {
    "user", "pwd", "mime", NULL
};

static int Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t  );

struct sout_access_out_sys_t
{<commit_msg>don't forget to add options to  *ppsz_sout_options[] (so that ca, crt, etc.. are also available using http{ca=...,crt=...} in the sout chain...<commit_after>/*****************************************************************************
 * http.c
 *****************************************************************************
 * Copyright (C) 2001-2003 VideoLAN
 * $Id$
 *
 * Authors: <NAME> <<EMAIL>>
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/
#include <stdlib.h>

#include <vlc/vlc.h>
#include <vlc/sout.h>

#include "vlc_httpd.h"
#include "vlc_tls.h"

#define FREE( p ) if( p ) { free( p); (p) = NULL; }

#define DEFAULT_PORT        8080
#define DEFAULT_SSL_PORT    8443

/*****************************************************************************
 * Module descriptor
 *****************************************************************************/
static int  Open ( vlc_object_t * );
static void Close( vlc_object_t * );

#define SOUT_CFG_PREFIX "sout-http-"

#define USER_TEXT N_("Username")
#define USER_LONGTEXT N_("Allows you to give a user name that will be " \
                         "requested to access the stream." )
#define PASS_TEXT N_("Password")
#define PASS_LONGTEXT N_("Allows you to give a password that will be " \
                         "requested to access the stream." )
#define MIME_TEXT N_("Mime")
#define MIME_LONGTEXT N_("Allows you to give the mime returned by the server." )

#define CERT_TEXT N_( "Certificate file" )
#define CERT_LONGTEXT N_( "Path to the x509 PEM certificate file that will "\
                          "be used by the HTTP/SSL stream output" )
#define KEY_TEXT N_( "Private key file" )
#define KEY_LONGTEXT N_( "Path to the x509 PEM private key file that will " \
                         " be used by the HTTP/SSL stream output. Leave " \
                         "empty if you don't have one." )
#define CA_TEXT N_( "Root CA file" )
#define CA_LONGTEXT N_( "Path to the x509 PEM trusted root CA certificates " \
                        "(certificate authority) file that will be used by " \
                        "the HTTP/SSL stream output. Leave empty if you " \
                        "don't have one." )
#define CRL_TEXT N_( "CRL file" )
#define CRL_LONGTEXT N_( "Path to the x509 PEM Certificates Revocation List " \
                         "file that will be HTTP/SSL stream output. Leave " \
                         "empty if you don't have one." )

vlc_module_begin();
    set_description( _("HTTP stream output") );
    set_capability( "sout access", 0 );
    add_shortcut( "http" );
    add_shortcut( "https" );
    add_shortcut( "mmsh" );
    add_string( SOUT_CFG_PREFIX "user", "", NULL,
                USER_TEXT, USER_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "pwd", "", NULL,
                PASS_TEXT, PASS_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "mime", "", NULL,
                MIME_TEXT, MIME_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "cert", "vlc.pem", NULL,
                CERT_TEXT, CERT_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "key", NULL, NULL,
                KEY_TEXT, KEY_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "ca", NULL, NULL,
                CA_TEXT, CA_LONGTEXT, VLC_TRUE );
    add_string( SOUT_CFG_PREFIX "crl", NULL, NULL,
                CRL_TEXT, CRL_LONGTEXT, VLC_TRUE );
    set_callbacks( Open, Close );
vlc_module_end();


/*****************************************************************************
 * Exported prototypes
 *****************************************************************************/
static const char *ppsz_sout_options[] = {
    "user", "pwd", "mime", "cert", "key", "ca", "crl", NULL
};

static int Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t  );

struct sout_access_out_sys_t
{
{'fraction_non_alphanumeric': 0.23417721518987342, 'fraction_numerical': 0.008581849388543231, 'mean_word_length': 3.35450723960766, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6484242', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2572, 'n_words': 892}