#540967 dupload: consider to add support to http proxy with ftp protocol

Package:
dupload
Source:
dupload
Submitter:
Leinier Cruz Salfran
Date:
2010-09-07 11:27:03 UTC
Severity:
wishlist
#540967#5
Date:
2009-08-10 08:12:28 UTC
From:
To:
hello Josip Rodin.

i'm want to contribute to 'dupload' adding support to http proxy server when upload
files with ftp method. i must to use a http proxy server in order to reach http/ftp
servers and for that reason i would like to use 'dupload' with that feature.

i made this code against 'dupload 2.6.6' .. hope you can add to future releases.

[dupload_ftp_proxy_support-2.6.6.diff]
22a23,24
58a61
77a81
148a153
229,231c234,242
< p("Uploading ($method) to $fqdn:$incoming");
< p("and moving to $fqdn:$queuedir") if $queuedir;
< p("\n");
---
506,509c517,518
< 	p "Uploading (ftp) to $host ($fqdn)\n";
< 	if (!$dry) {
< 		ftp_open($fqdn, $login, $passwd);
< 		$server->cwd($incoming);
---
511,512c520,527
< 		p "+ ftp_open($fqdn, $login, $passwd)\n";
< 		p "+ ftp::cwd($incoming\n";
---
555,558c570,579
< 				unless ($server->put($file, $file)) {
<                                         $result = $server->message();
<                                         $server->delete($file) ;
< 					fatal("Can't upload $file: $result");
---
559a581
604c626
< 			p", renaming";
---
607,610c629,635
< 					$server->rename($file, $queuedir . $file)
< 						or
<                                                 $result=$server->message(),
<                                                 $server->delete($file),
---
611a637
714c740
< if ($method eq "ftp") {
---
880a907,923


this code requires 'libwww-perl' package and was tested with success, here logs:

[/etc/dupload.conf]
$cfg{'salfrancl'} = {
	fqdn => 'salfrancl.ipigto.rimed.cu',
	method => 'ftp',
	incoming => '/incoming',
	dinstall_runs => 1,
};

# export ftp_proxy=http://proxy.ipigto.rimed.cu:3128/
# ./dupload --to salfrancl libsockets++_2.3.5_i386.changes
dupload note: no announcement will be sent.
Checking signatures before upload......signatures are ok
Uploading (ftp) to salfrancl.ipigto.rimed.cu:/incoming throught (http://proxy.ipigto.rimed.cu:3128/)
[ job libsockets++_2.3.5_i386 from libsockets++_2.3.5_i386.changes
 libsockets++_2.3.5_i386.deb, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++-dev_2.3.5_all.deb, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.diff.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.orig.tar.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.dsc, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5_i386.changes ok ]
Uploading (ftp) to local (salfrancl.ipigto.rimed.cu) throught (http://proxy.ipigto.rimed.cu:3128/)
[ Uploading job libsockets++_2.3.5_i386
 libsockets++_2.3.5_i386.deb 279.1 kB, ok (0 s, 279.10 kB/s)
 libsockets++-dev_2.3.5_all.deb 50.2 kB, ok (0 s, 50.16 kB/s)
 libsockets++_2.3.5.diff.gz 2.8 kB, ok (0 s, 2.84 kB/s)
 libsockets++_2.3.5.orig.tar.gz 170.5 kB, ok (0 s, 170.50 kB/s)
 libsockets++_2.3.5.dsc 1.1 kB, ok (0 s, 1.09 kB/s)
 libsockets++_2.3.5_i386.changes 2.1 kB, ok (0 s, 2.06 kB/s) ]

[/etc/dupload.conf]
$cfg{'salfrancl'} = {
        fqdn => 'salfrancl.ipigto.rimed.cu',
        method => 'ftp',
        incoming => '/incoming',
        queuedir => '/incoming/queue',
        dinstall_runs => 1,
};

# ./dupload --to salfrancl libsockets++_2.3.5_i386.changes
dupload note: no announcement will be sent.
Checking signatures before upload......signatures are ok
Uploading (ftp) to salfrancl.ipigto.rimed.cu:/incoming/queue throught (http://proxy.ipigto.rimed.cu:3128/)
[ job libsockets++_2.3.5_i386 from libsockets++_2.3.5_i386.changes
 libsockets++_2.3.5_i386.deb, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++-dev_2.3.5_all.deb, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.diff.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.orig.tar.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5.dsc, size ok, md5sum ok, sha1sum ok, sha256sum ok
 libsockets++_2.3.5_i386.changes ok ]
Uploading (ftp) to salfrancl (salfrancl.ipigto.rimed.cu) throught (http://proxy.ipigto.rimed.cu:3128/)
[ Uploading job libsockets++_2.3.5_i386
 libsockets++_2.3.5_i386.deb 279.1 kB, ok (0 s, 279.10 kB/s)
 libsockets++-dev_2.3.5_all.deb 50.2 kB, ok (0 s, 50.16 kB/s)
 libsockets++_2.3.5.diff.gz 2.8 kB, ok (0 s, 2.84 kB/s)
 libsockets++_2.3.5.orig.tar.gz 170.5 kB, ok (0 s, 170.50 kB/s)
 libsockets++_2.3.5.dsc 1.1 kB, ok (0 s, 1.09 kB/s)
 libsockets++_2.3.5_i386.changes 2.1 kB, ok (0 s, 2.06 kB/s) ]


regards.

#540967#10
Date:
2010-09-07 11:09:48 UTC
From:
To:
Hi Josip! Hi Leinier!

I personally think that HTTP proxy support is very important feature. I
vote for it. Right now neither dupload nor dput have support for proxy.

Leinier, why you do a manual configuration of LWP::UserAgent object
instead of just saying:

my $ua = LWP::UserAgent->new('env_proxy' => 1);

Can you please also make a unified diff and send it to this bug report
*as attachment* to the message? I will be very grateful.

Thanks.