FCGI

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

Version 0.48 -- 27 August 1999  <skimo@kotnet.org> Sven Verdoolaege

    - perl 5.005_60 compatibility
    - locking on platforms that need it
    - support for remote connections

Version 0.47 -- 31 July 1999  <skimo@kotnet.org> Sven Verdoolaege

    - move PRINTF into correct package
    - deprecated set_exit_status
    - general cleanup, moving old non thread safe interface
      from xs to perl

Version 0.46 -- 30 July 1999  <skimo@kotnet.org> Sven Verdoolaege

    - new thread safe interface
    - new threaded example program

Version 0.45 -- 8 March 1999  <skimo@kotnet.org> Sven Verdoolaege

    - FCGI.pm now part of the devel kit
    - library fixes  ("Rob Saccoccio" <robs@ipass.net>)
    - allow bypassing of installation of handlers
    - ActivePerl compatibility (Murray Nesbitt <murray@ActiveState.com>)

Version 0.43 -- 22 December 1998  <skimo@kotnet.org> Sven Verdoolaege

FCGI.xs  view on Meta::CPAN


#ifndef INT2PTR
#define INT2PTR(a,b) ((a) (b))
#endif

/* Deprecation added 2010-10-05.  The deprecated functionality should not be
 * removed for at least a year after that. */
#define WIDE_CHAR_DEPRECATION_MSG "Use of wide characters in %s is deprecated" \
  " and will stop working in a future version of FCGI"

#if defined(USE_ITHREADS)
static perl_mutex accept_mutex;
#endif

typedef struct FCGP_Request {
    int         accepted;
    int         bound;
    SV*         svin;
    SV*         svout;
    SV*         sverr;
    GV*         gv[3];

MANIFEST  view on Meta::CPAN

ChangeLog
configure
configure.in
configure.readme
eg/echo.pl
eg/remote.pl
eg/threaded.pl
FCGI.pm
FCGI.xs
fcgi_config.h.in
Makefile.PL
MANIFEST			This list of files
MANIFEST.SKIP
README
t/01-load.t
t/02-unix_domain_socket.t
typemap

eg/threaded.pl  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use threads;
use threads::shared;

use FCGI       qw[];
use IO::Handle qw[];

use constant THREAD_COUNT => 5;

my @count : shared = (0, (0) x THREAD_COUNT);

sub worker {
    my $k = shift;
    my %env;
    my $in  = IO::Handle->new;
    my $out = IO::Handle->new;
    my $err = IO::Handle->new;

    my $request = FCGI::Request($in, $out, $err, \%env);

    while ($request->Accept >= 0) {
        print $out
               "Content-type: text/html\r\n",
               "\r\n",
               "<title>FastCGI Hello! (multi-threaded perl, fcgiapp library)</title>",
               "<h1>FastCGI Hello! (multi-threaded perl, fcgiapp library)</h1>",
               "Request counts for ", THREAD_COUNT ," threads ",
               "running on host <i>$env{SERVER_NAME}</i>";

        {
            lock(@count);

            ++$count[$k];

            for(my $i = 1; $i <= THREAD_COUNT; $i++) {
                print $out $count[$i];
                print $out " ";
            }
        }
        $request->Flush;
        sleep(1);
    }
}

$_->join for map { threads->create(\&worker, $_) } 1..THREAD_COUNT;

fcgi_config_x86.h  view on Meta::CPAN

#undef HAVE_ARPA_INET_H
#undef HAVE_DLFCN_H
#undef HAVE_FILENO_PROTO
#undef HAVE_INTTYPES_H
#undef HAVE_IOSTREAM_WITHASSIGN_STREAMBUF
#undef HAVE_LIBNSL
#undef HAVE_LIBSOCKET
#undef HAVE_MEMORY_H
#undef HAVE_NETDB_H
#undef HAVE_NETINET_IN_H
#undef HAVE_PTHREAD
#undef HAVE_SOCKADDR_UN_SUN_LEN
#undef HAVE_SOCKLEN
#undef HAVE_STDINT_H
#undef HAVE_STDLIB_H
#undef HAVE_STRING_H
#undef HAVE_STRINGS_H
#undef HAVE_SYS_PARAM_H
#undef HAVE_SYS_SOCKET_H
#undef HAVE_SYS_STAT_H
#undef HAVE_SYS_TIME_H
#undef HAVE_SYS_TYPES_H
#undef HAVE_UNISTD_H
#undef HAVE_VA_ARG_LONG_DOUBLE_BUG
#undef PTHREAD_CREATE_JOINABLE
#undef STDC_HEADERS
#undef USE_LOCKING
#undef const
#undef inline
#undef ssize_t

fcgiapp.h  view on Meta::CPAN

 *
 *----------------------------------------------------------------------
 */
DLLAPI int FCGX_IsCGI(void);

/*
 *----------------------------------------------------------------------
 *
 * FCGX_Init --
 *
 *      Initialize the FCGX library.  Call in multi-threaded apps
 *      before calling FCGX_Accept_r().
 *
 *      Returns 0 upon success.
 *
 *----------------------------------------------------------------------
 */
DLLAPI int FCGX_Init(void);

/*
 *----------------------------------------------------------------------

os_unix.c  view on Meta::CPAN


/*
 *--------------------------------------------------------------
 *
 * OS_LibInit --
 *
 *      Set up the OS library for use.
 *
 *      NOTE: This function is really only needed for application
 *            asynchronous I/O.  It will most likely change in the
 *            future to setup the multi-threaded environment.
 *
 * Results:
 *	Returns 0 if success, -1 if not.
 *
 * Side effects:
 *	Async I/O table allocated and initialized.
 *
 *--------------------------------------------------------------
 */
int OS_LibInit(int stdioFds[3])

os_win32.c  view on Meta::CPAN

 * shutdown flag (then go back to waiting for a connection, etc).
 */
#define ACCEPT_TIMEOUT 1000

#define MUTEX_VARNAME "_FCGI_MUTEX_"
#define SHUTDOWN_EVENT_NAME "_FCGI_SHUTDOWN_EVENT_"
#define LOCALHOST "localhost"

static HANDLE hIoCompPort = INVALID_HANDLE_VALUE;
static HANDLE hStdinCompPort = INVALID_HANDLE_VALUE;
static HANDLE hStdinThread = INVALID_HANDLE_VALUE;

static HANDLE stdioHandles[3] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE,
				 INVALID_HANDLE_VALUE};

// This is a nail for listening to more than one port..
static HANDLE acceptMutex = INVALID_HANDLE_VALUE;

static BOOLEAN shutdownPending = FALSE;
static BOOLEAN shutdownNow = FALSE;

t/02-unix_domain_socket.t  view on Meta::CPAN

use Config;
use FCGI;
use FCGI::Client;
use File::Temp qw(tempfile);
use IO::Socket;
use Test::More 0.88;

my $can_fork = $Config{d_fork}
    || (
        ($^O eq 'MSWin32' || $^O eq 'NetWare')
        and $Config{useithreads}
        and $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
    );
if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bSocket\b/) {
    plan skip_all => 'Socket extension unavailable';
} elsif ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
    plan skip_all => 'IO extension unavailable';
} elsif ($^O eq 'os2') {
    eval { IO::Socket::pack_sockaddr_un('/foo/bar') || 1 };
    if ($@ !~ /not implemented/) {
        plan skip_all => 'compiled without TCP/IP stack v4';

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.619 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )