From owner-freebsd-hackers Tue Dec 5 13:54:42 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA08477 for hackers-outgoing; Tue, 5 Dec 1995 13:54:42 -0800 Received: from wiley.muc.ditec.de (wiley.muc.ditec.de [194.120.126.9]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA08471 for ; Tue, 5 Dec 1995 13:54:31 -0800 Received: from vector.enet ([139.92.42.187]) by wiley.muc.ditec.de (8.6.12/8.6.9) with ESMTP id WAA06568; Tue, 5 Dec 1995 22:54:17 +0100 Received: (from jhs@localhost) by vector.enet (8.6.12/8.6.9) id WAA02755; Tue, 5 Dec 1995 22:52:55 +0100 Date: Tue, 5 Dec 1995 22:52:55 +0100 From: "Julian Stacey jhs@freebsd.org" Message-Id: <199512052152.WAA02755@vector.enet> To: hackers@freebsd.org cc: khe@muc.ditec.de Subject: WebCopy.pl http://www.inf.utfsm.cl/~vparada/webcopy.html Reply-To: "Julian H. Stacey" Mailer: EXMH version 1.6.4 10/10/95 Sender: owner-hackers@freebsd.org Precedence: bulk -------- Hi hackers@freebsd.org, Has anyone tried http://www.inf.utfsm.cl/~vparada/webcopy.html Its a useful tree copying Web tool written in perl, Trouble is I can only get it to work on files served by my local httpd, & of course I want to grab someone else's tree, not my own stuff :-) (I keep getting connect: Operation timed out on both my host with Perl 5, on a FreeBSD stable host with Perl 4 ) For anyone tempted to have a play, I'd appreciate hearing if you get it to work on FreeBSD current, PS I was given these patches by a friend (khe) & have copied them to webcopy author, but I'm not conversant in Perl, so caveat emptor :-) PS KHE has got this stuff to run, on some host I dont have access to, (but he's at home, & I'm in a hurry :-) ------- *** webcopy.distrib Sat Jul 1 18:20:35 1995 --- webcopy.khe.tick Tue Dec 5 10:35:32 1995 *************** *** 45,51 **** # Library routines required # ! require 'sys/socket.ph'; require 'timelocal.pl'; # Global setup --- 45,53 ---- # Library routines required # ! # Old style! Require Socket.pm instead! (KHE) ! #require 'sys/socket.ph'; ! use Socket; require 'timelocal.pl'; # Global setup *************** *** 363,370 **** $sockaddr='S n a4 x8'; chop($local_host=`hostname`); $local_prot=(getprotobyname('tcp'))[2]; ! $local_sock=pack($sockaddr,&AF_INET,0,(gethostbyname($local_host))[4]); ! $remote_sock=pack($sockaddr,&AF_INET,$port,(gethostbyname($host))[4]); } sub transfer { --- 365,375 ---- $sockaddr='S n a4 x8'; chop($local_host=`hostname`); $local_prot=(getprotobyname('tcp'))[2]; ! # (KHE) ! # $local_sock=pack($sockaddr,&AF_INET,0,(gethostbyname($local_host))[4]); ! # $remote_sock=pack($sockaddr,&AF_INET,$port,(gethostbyname($host))[4]); ! $local_sock=pack($sockaddr,AF_INET,0,(gethostbyname($local_host))[4]); ! $remote_sock=pack($sockaddr,AF_INET,$port,(gethostbyname($host))[4]); } sub transfer { *************** *** 374,380 **** $update=(($_=&get_date($file)) && ("If-Modified-Since: $_$rn")) unless $post; $uselocal && $update && return(304,"Use local",0); ! socket(S,&PF_INET,&SOCK_STREAM,$local_prot) || die "$0: socket: $!\n"; bind(S,$local_sock) || die "$0: bind: $!\n"; connect(S,$remote_sock) || die "$0: connect: $!\n"; $_=select(S); $|=1; select($_); --- 379,387 ---- $update=(($_=&get_date($file)) && ("If-Modified-Since: $_$rn")) unless $post; $uselocal && $update && return(304,"Use local",0); ! # (KHE) ! # socket(S,&PF_INET,&SOCK_STREAM,$local_prot) || die "$0: socket: $!\n"; ! socket(S,PF_INET,SOCK_STREAM,$local_prot) || die "$0: socket: $!\n"; bind(S,$local_sock) || die "$0: bind: $!\n"; connect(S,$remote_sock) || die "$0: connect: $!\n"; $_=select(S); $|=1; select($_); ------- Julian H. Stacey jhs@freebsd.org http://www.freebsd.org/~jhs/