File: globals.pl_

package info (click to toggle)
libwhisker2-perl 2.5-1.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,168 kB
  • sloc: perl: 9,119; makefile: 22
file content (38 lines) | stat: -rw-r--r-- 973 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    ## LW module manager stuff ##

    $LW_SSL_LIB          = 0;
    $LW_SSL_KEEPALIVE    = 0;
    $LW_NONBLOCK_CONNECT = 1;

    $_SSL_LIBRARY = undef;

    eval "use Socket";
    if ( !$@ ) {
        eval "use Net::SSLeay";    # do we have SSL support?
        if ( !$@ ) {
            $LW_SSL_LIB   = 1;
            $_SSL_LIBRARY = 'Net::SSLeay';
            Net::SSLeay::load_error_strings();
            Net::SSLeay::SSLeay_add_ssl_algorithms();
            Net::SSLeay::randomize();

        }
        else {
            eval "use Net::SSL";
            if ( !$@ ) {
                $LW_SSL_LIB   = 2;
                $_SSL_LIBRARY = 'Net::SSL';
            }
        }

        if ( $^O !~ /Win32/ ) {
            eval "use POSIX qw(:errno_h :fcntl_h)";
            if ($@) { $LW_NONBLOCK_CONNECT = 0; }
        }
        else {

            # taken from Winsock2.h
            *EINPROGRESS = sub { 10036 };
            *EWOULDBLOCK = sub { 10035 };
        }
    }