You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by MBCRAFT <in...@mbcraft.it> on 2016/07/07 19:45:40 UTC

Bug spot in commons-net-3.5

Hi! I spot a bug in commons-net-3.5 .... it seems that the ftp client 
misses the last bytes on large downloaded files.
I did some tests with a 7 MB file, and it always missed the last kb.
I've tried some quick fix, but i wasn't able to solve my problem.

Kind regards

-Marco B.

-- 
[---------------------------------------
[MBCRAFT di Marco Bagnaresi - Software development services
[Via ca' del vento, 11
[CAP 48012 - Bagnacavallo(RA)
[C.F. : BGNMRC82H03E730O
[P.IVA/VAT N. : 02475790396
[Website : http://www.mbcraft.it
[Standard mail : info@mbcraft.it
[PEC : mbcraft@pec.it
[---------------------------------------
[
[
[Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
[Questo messaggio � destinato unicamente ai soggetti indicati nell'intestazione.
[In caso di ricezione erronea si prega di informare il mittente e di eliminare
[il messaggio secondo le norme relative al trattamento dei dati personali.
[La diffusione impropria in qualsiasi forma delle informazioni contenute in questo messaggio sono proibite
[dalla legge. Questo messaggio pu� contenere informazioni non corrette.
[Pu� rivolgersi alla nostra azienda per richiedere informazioni su titolare e responsabili del trattamento e
[per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
[inviando una mail con oggetto \u201cPrivacy\u201d.
[
   



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Bug spot in commons-net-3.5

Posted by sebb <se...@gmail.com>.
2016-07-08 7:17 GMT+01:00 MBCRAFT <in...@mbcraft.it>:
> I don't know if it depends from the ftp server : i'm using vsftpd.
>
> I've followed that example, more or less, and i even didn't missed the
>
> FTP.NON_PRINT_TEXT_FORMAT , FTP.STREAM_TRANSFER_MODE , and
> FTP.FILE_STRUCTURE are the only supported formats, transfer modes, and file
> structures.
>
>
> I did many tests : it didn't worked. Using a graphical ftp client i found
> that is a bug of the ftp server. ASCII transfers are bugged in vsftpd.

Are you sure vsftpd has a bug with ASCII transfers?
This seems somewhat unlikely for such a well-known server.

Note that in ASCII mode the server converts line ends to CRLF for
transmission and the client converts CRLF to the local line ending.
With binary files this can result in losing - or gaining - some CRLF
pairs, thus the resulting file can be a different size from the
original.

> Sorry for the false alarm.
>
> -Marco B.
>
>
> Il 08/07/2016 00:08, sebb ha scritto:
>
> I just tried downloading a file using the FTPClientExample and it worked
> fine.
>
> Remember to set the binary transfer mode if necessary.
>
> 2016-07-07 20:45 GMT+01:00 MBCRAFT <in...@mbcraft.it>:
>
> Hi! I spot a bug in commons-net-3.5 .... it seems that the ftp client misses
> the last bytes on large downloaded files.
> I did some tests with a 7 MB file, and it always missed the last kb.
> I've tried some quick fix, but i wasn't able to solve my problem.
>
> Kind regards
>
> -Marco B.
>
> --
> [---------------------------------------
> [MBCRAFT di Marco Bagnaresi - Software development services
> [Via ca' del vento, 11
> [CAP 48012 - Bagnacavallo(RA)
> [C.F. : BGNMRC82H03E730O
> [P.IVA/VAT N. : 02475790396
> [Website : http://www.mbcraft.it
> [Standard mail : info@mbcraft.it
> [PEC : mbcraft@pec.it
> [---------------------------------------
> [
> [
> [Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
> [Questo messaggio è destinato unicamente ai soggetti indicati
> nell'intestazione.
> [In caso di ricezione erronea si prega di informare il mittente e di
> eliminare
> [il messaggio secondo le norme relative al trattamento dei dati personali.
> [La diffusione impropria in qualsiasi forma delle informazioni contenute in
> questo messaggio sono proibite
> [dalla legge. Questo messaggio può contenere informazioni non corrette.
> [Può rivolgersi alla nostra azienda per richiedere informazioni su titolare
> e responsabili del trattamento e
> [per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
> [inviando una mail con oggetto “Privacy”.
> [
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
> --
> [---------------------------------------
> [MBCRAFT di Marco Bagnaresi - Software development services
> [Via ca' del vento, 11
> [CAP 48012 - Bagnacavallo(RA)
> [C.F. : BGNMRC82H03E730O
> [P.IVA/VAT N. : 02475790396
> [Website : http://www.mbcraft.it
> [Standard mail : info@mbcraft.it
> [PEC : mbcraft@pec.it
> [---------------------------------------
> [
> [
> [Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
> [Questo messaggio è destinato unicamente ai soggetti indicati
> nell'intestazione.
> [In caso di ricezione erronea si prega di informare il mittente e di
> eliminare
> [il messaggio secondo le norme relative al trattamento dei dati personali.
> [La diffusione impropria in qualsiasi forma delle informazioni contenute in
> questo messaggio sono proibite
> [dalla legge. Questo messaggio può contenere informazioni non corrette.
> [Può rivolgersi alla nostra azienda per richiedere informazioni su titolare
> e responsabili del trattamento e
> [per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
> [inviando una mail con oggetto “Privacy”.
> [
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Bug spot in commons-net-3.5

Posted by MBCRAFT <in...@mbcraft.it>.
I don't know if it depends from the ftp server : i'm using vsftpd.

I've followed that example, more or less, and i even didn't missed the

/|FTP.NON_PRINT_TEXT_FORMAT |//, //|FTP.STREAM_TRANSFER_MODE |//, and 
//|FTP.FILE_STRUCTURE |//are the only supported formats, transfer modes, 
and file structures. /


I did many tests : it didn't worked. Using a graphical ftp client i 
found that is a bug of the ftp server. ASCII transfers are bugged in vsftpd.

Sorry for the false alarm.

-Marco B.

Il 08/07/2016 00:08, sebb ha scritto:
> I just tried downloading a file using the FTPClientExample and it worked fine.
>
> Remember to set the binary transfer mode if necessary.
>
> 2016-07-07 20:45 GMT+01:00 MBCRAFT <in...@mbcraft.it>:
>> Hi! I spot a bug in commons-net-3.5 .... it seems that the ftp client misses
>> the last bytes on large downloaded files.
>> I did some tests with a 7 MB file, and it always missed the last kb.
>> I've tried some quick fix, but i wasn't able to solve my problem.
>>
>> Kind regards
>>
>> -Marco B.
>>
>> --
>> [---------------------------------------
>> [MBCRAFT di Marco Bagnaresi - Software development services
>> [Via ca' del vento, 11
>> [CAP 48012 - Bagnacavallo(RA)
>> [C.F. : BGNMRC82H03E730O
>> [P.IVA/VAT N. : 02475790396
>> [Website : http://www.mbcraft.it
>> [Standard mail : info@mbcraft.it
>> [PEC : mbcraft@pec.it
>> [---------------------------------------
>> [
>> [
>> [Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
>> [Questo messaggio � destinato unicamente ai soggetti indicati
>> nell'intestazione.
>> [In caso di ricezione erronea si prega di informare il mittente e di
>> eliminare
>> [il messaggio secondo le norme relative al trattamento dei dati personali.
>> [La diffusione impropria in qualsiasi forma delle informazioni contenute in
>> questo messaggio sono proibite
>> [dalla legge. Questo messaggio pu� contenere informazioni non corrette.
>> [Pu� rivolgersi alla nostra azienda per richiedere informazioni su titolare
>> e responsabili del trattamento e
>> [per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
>> [inviando una mail con oggetto \u201cPrivacy\u201d.
>> [
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>

-- 
[---------------------------------------
[MBCRAFT di Marco Bagnaresi - Software development services
[Via ca' del vento, 11
[CAP 48012 - Bagnacavallo(RA)
[C.F. : BGNMRC82H03E730O
[P.IVA/VAT N. : 02475790396
[Website : http://www.mbcraft.it
[Standard mail : info@mbcraft.it
[PEC : mbcraft@pec.it
[---------------------------------------
[
[
[Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
[Questo messaggio � destinato unicamente ai soggetti indicati nell'intestazione.
[In caso di ricezione erronea si prega di informare il mittente e di eliminare
[il messaggio secondo le norme relative al trattamento dei dati personali.
[La diffusione impropria in qualsiasi forma delle informazioni contenute in questo messaggio sono proibite
[dalla legge. Questo messaggio pu� contenere informazioni non corrette.
[Pu� rivolgersi alla nostra azienda per richiedere informazioni su titolare e responsabili del trattamento e
[per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
[inviando una mail con oggetto \u201cPrivacy\u201d.
[
   


Re: Bug spot in commons-net-3.5

Posted by sebb <se...@gmail.com>.
I just tried downloading a file using the FTPClientExample and it worked fine.

Remember to set the binary transfer mode if necessary.

2016-07-07 20:45 GMT+01:00 MBCRAFT <in...@mbcraft.it>:
> Hi! I spot a bug in commons-net-3.5 .... it seems that the ftp client misses
> the last bytes on large downloaded files.
> I did some tests with a 7 MB file, and it always missed the last kb.
> I've tried some quick fix, but i wasn't able to solve my problem.
>
> Kind regards
>
> -Marco B.
>
> --
> [---------------------------------------
> [MBCRAFT di Marco Bagnaresi - Software development services
> [Via ca' del vento, 11
> [CAP 48012 - Bagnacavallo(RA)
> [C.F. : BGNMRC82H03E730O
> [P.IVA/VAT N. : 02475790396
> [Website : http://www.mbcraft.it
> [Standard mail : info@mbcraft.it
> [PEC : mbcraft@pec.it
> [---------------------------------------
> [
> [
> [Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
> [Questo messaggio è destinato unicamente ai soggetti indicati
> nell'intestazione.
> [In caso di ricezione erronea si prega di informare il mittente e di
> eliminare
> [il messaggio secondo le norme relative al trattamento dei dati personali.
> [La diffusione impropria in qualsiasi forma delle informazioni contenute in
> questo messaggio sono proibite
> [dalla legge. Questo messaggio può contenere informazioni non corrette.
> [Può rivolgersi alla nostra azienda per richiedere informazioni su titolare
> e responsabili del trattamento e
> [per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
> [inviando una mail con oggetto “Privacy”.
> [
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Bug spot in commons-net-3.5

Posted by Gary Gregory <ga...@gmail.com>.
Hi Marco,

Could you please provide unit test that demonstrates the problem?

Gary

2016-07-07 12:45 GMT-07:00 MBCRAFT <in...@mbcraft.it>:

> Hi! I spot a bug in commons-net-3.5 .... it seems that the ftp client
> misses the last bytes on large downloaded files.
> I did some tests with a 7 MB file, and it always missed the last kb.
> I've tried some quick fix, but i wasn't able to solve my problem.
>
> Kind regards
>
> -Marco B.
>
> --
> [---------------------------------------
> [MBCRAFT di Marco Bagnaresi - Software development services
> [Via ca' del vento, 11
> [CAP 48012 - Bagnacavallo(RA)
> [C.F. : BGNMRC82H03E730O
> [P.IVA/VAT N. : 02475790396
> [Website : http://www.mbcraft.it
> [Standard mail : info@mbcraft.it
> [PEC : mbcraft@pec.it
> [---------------------------------------
> [
> [
> [Informativa ai sensi del codice della privacy (D.Lgs 196-30/06/2003)
> [Questo messaggio è destinato unicamente ai soggetti indicati
> nell'intestazione.
> [In caso di ricezione erronea si prega di informare il mittente e di
> eliminare
> [il messaggio secondo le norme relative al trattamento dei dati personali.
> [La diffusione impropria in qualsiasi forma delle informazioni contenute
> in questo messaggio sono proibite
> [dalla legge. Questo messaggio può contenere informazioni non corrette.
> [Può rivolgersi alla nostra azienda per richiedere informazioni su
> titolare e responsabili del trattamento e
> [per esercitare i diritti previsti dall'Art.7 del D.lg.196/2003
> [inviando una mail con oggetto “Privacy”.
> [
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory