#!/usr/bin/perl use ExtUtils::testlib; use RawLibfaim; require "aim_consts.pm"; # struct aim_conn_t *authconn = NULL, *waitingconn = NULL; my $aimsess = new RawLibfaim::Session; #my $authcon = RawLibfaim::new_aim_conn_t(); #my $waintingconn = RawLibfaim::new_aim_conn_t(); # /* int keepgoing = 1; # char *proxy, *proxyusername, *proxypass; # char *listingpath; # int selstat = 0; # if ( !(screenname = getenv("SCREENNAME")) || # !(password = getenv("PASSWORD"))) # { # printf("Must specify SCREENAME and PASSWORD in environment.\n"); # return -1; # } # server = getenv("AUTHSERVER"); # proxy = getenv("SOCKSPROXY"); # proxyusername = getenv("SOCKSNAME"); # proxypass = getenv("SOCKSPASS"); */ # aim_session_init(&aimsess); # RawLibfaim::aim_session_init($aimsess); $aimsess->init; # printf("Did aim_session_init okay.\n"); print "aim_session_init succesful.\n"; # authconn = # aim_newconn(&aimsess, AIM_CONN_TYPE_AUTH, FAIM_LOGIN_SERVER); $authconn = new RawLibfaim::Connection( $aimsess, &AIM_CONN_TYPE_AUTH, &FAIM_LOGIN_SERVER); # if (authconn == NULL) { # fprintf(stderr, "faimtest: internal connection error while in aim_login. bailing out.\n"); # /*return -1; */ # } else if (authconn->fd == -1) { # if (authconn->status & AIM_CONN_STATUS_RESOLVERR) # fprintf(stderr, "faimtest: could not resolve authorizer name\n"); # else if (authconn->status & AIM_CONN_STATUS_CONNERR) # fprintf(stderr, "faimtest: could not connect to authorizer\n"); # aim_conn_kill(&aimsess, &authconn); # } # printf("Connected to authorizer.\n"); unless($authconn) { die("faimtest: internal connection error while in aim_login. Bailing out.\n"); } elsif ($authconn->fd == -1) { if($authconn->status & &AIM_CONN_STATUS_RESOLVERR) { die "faimtest: could not resolve authorizer name\n"; } elsif ($authconn->status & &AIM_CONN_STATUS_CONNERR) { die "faimtest: could not connect to authorizer\n"; } $authconn->kill($aimsess); die "Dead connection"; } print "Connected to authorizer.\n";