[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: napster/doc/examples firewall.pl,NONE,1.1
From: |
Luca - De Whiskey's - De Vitis <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: napster/doc/examples firewall.pl,NONE,1.1 |
Date: |
Fri, 14 Jun 2002 05:14:38 -0400 |
Update of /cvsroot/phpgroupware/napster/doc/examples
In directory subversions:/tmp/cvs-serv23210/napster/doc/examples
Added Files:
firewall.pl
Log Message:
- Moved some examples files into module/doc/examples.
- Removed no more useful debian files.
--- NEW FILE ---
#!/usr/bin/perl
use Socket;
use IO::Handle;
open(STDERR, ">&STDOUT") || die "error opening STDOUT";
if(!$ARGV[0]) {
die "enter port";
}
socket(S, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die "error in socket";
bind(S, sockaddr_in($ARGV[0], INADDR_ANY)) || die "error in bind";
($port) = unpack_sockaddr_in(getsockname(S));
#print "$port\n";
setsockopt(S, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "error in
setsockopt";
listen(S, SOMAXCONN) || die "error in listen";
eval {
local $SIG{ALRM} = sub { die "error: alarm timed out" };
alarm 60;
accept(C, S);
alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) {
print "error: Accept timed out. Remote user did not send data.\n";
die; exit(-1);
}
C->autoflush(1);
syswrite(C, "1", 1);
sysread(C, $buf, 4);
if (!($buf eq "SEND")) {
print "error: invalid response - expected SEND: $buf\n"; # exit(-1);
}
sysread(C, $buf, 500);
if ($buf =~ /^([^\"]*)\"([^\"]*)\".*?([\d]*)$/) {
($nick, $name, $size) = ($1, $2, $3);
} else {
print "error: invalid response - expected fileinfo: $buf\n"; exit(-1);
}
syswrite(C, "0", 1);
eval {
local $SIG{ALRM} = sub { die "error: alarm timed out" };
alarm 60;
while($l = <C>) { alarm 0; print $l; alarm 60;}
alarm 0;
};
if ($@ and $@ !~ /alarm clock restart/) {
print "error: time out. Remote user stopped sending data.\n";
die; exit(-1);
}
exit;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: napster/doc/examples firewall.pl,NONE,1.1,
Luca - De Whiskey's - De Vitis <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: debian/ctrl Depends,1.1,NONE Section,1.1,NONE Source,1.1,NONE Suggests,1.1,NONE phpgroupware-addressbook.Description,1.1,NONE phpgroupware-admin.Description,1.1,NONE phpgroupware-api-doc.Description,1.1,NONE phpgroupware-api.Description,1.1,NONE phpgroupware-backup.Description,1.1,NONE phpgroupware-bookkeeping.Description,1.1,NONE phpgroupware-bookmarks.Description,1.1,NONE phpgroupware-brewer.Description,1.1,NONE phpgroupware-calendar.Description,1.1,NONE phpgroupware-chat.Description,1.1,NONE phpgroupware-chora.Description,1.1,NONE phpgroupware-comic.Description,1.1,NONE phpgroupware-core-doc.Description,1.1,NONE phpgroupware-core.Description,1.1,NONE phpgroupware-core.bak.Description,1.1,NONE phpgroupware-developer-tools.Description,1.1,NONE phpgroupware-dj.Description,1.1,NONE phpgroupware-eldaptir.Description,1.1,NONE phpgroupware-email.Description,1.1,NONE phpgroupware-filemanager.Description,1.1,NONE phpgroupware-forum.Description,1.1,NONE phpgroupware-ftp.Description,1.1,NONE phpgroupware-headlines.Description,1.1,NONE phpgroupware-hr.Description,1.1,NONE phpgroupware-img.Description,1.1,NONE phpgroupware-infolog.Description,1.1,NONE phpgroupware-inv.Description,1.1,NONE phpgroupware-manual.Description,1.1,NONE phpgroupware-mediadb.Description,1.1,NONE phpgroupware-messenger.Description,1.1,NONE phpgroupware-napster.Description,1.1,NONE phpgroupware-news-admin.Description,1.1,NONE phpgroupware-nntp.Description,1.1,NONE phpgroupware-notes.Description,1.1,NONE phpgroupware-phonelog.Description,1.1,NONE phpgroupware-phpsysinfo.Description,1.1,NONE phpgroupware-phpwebhosting.Description,1.1,NONE phpgroupware-polls.Description,1.1,NONE phpgroupware-preferences.Description,1.1,NONE phpgroupware-projects.Description,1.1,NONE phpgroupware-registration.Description,1.1,NONE phpgroupware-setup.Description,1.1,NONE phpgroupware-skel.Description,1.1,NONE phpgroupware-soap.Description,1.1,NONE phpgroupware-stocks.Description,1.1,NONE phpgroupware-syncml-server.Description,1.1,NONE phpgroupware-todo.Description,1.1,NONE phpgroupware-tts.Description,1.1,NONE phpgroupware-wap.Description,1.1,NONE phpgroupware-weather.Description,1.1,NONE phpgroupware-xmlrpc.Description,1.1,NONE phpgroupware.Description,1.1,NONE
- Next by Date:
[Phpgroupware-cvs] CVS: xmlrpc test.pl,1.1.1.1,NONE test.py,1.1.1.1,NONE
- Previous by thread:
[Phpgroupware-cvs] CVS: debian/ctrl Depends,1.1,NONE Section,1.1,NONE Source,1.1,NONE Suggests,1.1,NONE phpgroupware-addressbook.Description,1.1,NONE phpgroupware-admin.Description,1.1,NONE phpgroupware-api-doc.Description,1.1,NONE phpgroupware-api.Description,1.1,NONE phpgroupware-backup.Description,1.1,NONE phpgroupware-bookkeeping.Description,1.1,NONE phpgroupware-bookmarks.Description,1.1,NONE phpgroupware-brewer.Description,1.1,NONE phpgroupware-calendar.Description,1.1,NONE phpgroupware-chat.Description,1.1,NONE phpgroupware-chora.Description,1.1,NONE phpgroupware-comic.Description,1.1,NONE phpgroupware-core-doc.Description,1.1,NONE phpgroupware-core.Description,1.1,NONE phpgroupware-core.bak.Description,1.1,NONE phpgroupware-developer-tools.Description,1.1,NONE phpgroupware-dj.Description,1.1,NONE phpgroupware-eldaptir.Description,1.1,NONE phpgroupware-email.Description,1.1,NONE phpgroupware-filemanager.Description,1.1,NONE phpgroupware-forum.Description,1.1,NONE phpgroupware-ftp.Description,1.1,NONE phpgroupware-headlines.Description,1.1,NONE phpgroupware-hr.Description,1.1,NONE phpgroupware-img.Description,1.1,NONE phpgroupware-infolog.Description,1.1,NONE phpgroupware-inv.Description,1.1,NONE phpgroupware-manual.Description,1.1,NONE phpgroupware-mediadb.Description,1.1,NONE phpgroupware-messenger.Description,1.1,NONE phpgroupware-napster.Description,1.1,NONE phpgroupware-news-admin.Description,1.1,NONE phpgroupware-nntp.Description,1.1,NONE phpgroupware-notes.Description,1.1,NONE phpgroupware-phonelog.Description,1.1,NONE phpgroupware-phpsysinfo.Description,1.1,NONE phpgroupware-phpwebhosting.Description,1.1,NONE phpgroupware-polls.Description,1.1,NONE phpgroupware-preferences.Description,1.1,NONE phpgroupware-projects.Description,1.1,NONE phpgroupware-registration.Description,1.1,NONE phpgroupware-setup.Description,1.1,NONE phpgroupware-skel.Description,1.1,NONE phpgroupware-soap.Description,1.1,NONE phpgroupware-stocks.Description,1.1,NONE phpgroupware-syncml-server.Description,1.1,NONE phpgroupware-todo.Description,1.1,NONE phpgroupware-tts.Description,1.1,NONE phpgroupware-wap.Description,1.1,NONE phpgroupware-weather.Description,1.1,NONE phpgroupware-xmlrpc.Description,1.1,NONE phpgroupware.Description,1.1,NONE
- Next by thread:
[Phpgroupware-cvs] CVS: xmlrpc test.pl,1.1.1.1,NONE test.py,1.1.1.1,NONE
- Index(es):