Message94142
> From a quick look at the patch, if you call login() twice, the socket
> will be wrapped twice as well? Perhaps auth_tls() should have a
> protection against this.
You're right. Done.
> In prot_p() and prot_c(), it seems that self._prot_p is updated
> unconditionally, regardless of the FTP response.
Both PROT P and PROT C commands expect a 2xx response.
That's why I used voidcmd(). If a response different than 2xx is
received voidcmd() automatically raises an error_reply exception already
and self._prot_p doesn't get set.
> One more question, why is "ssl_version=ssl.PROTOCOL_TLSv1" hardwired?
You're right, it shouldn't be.
This is now provided as a class attribute.
The reason I used PROTOCOL_TLSv1 instead of PROTOCOL_SSLv23 (the ssl.py
default) is because RFC-4217 recommends it.
> In retrbinary(), retrlines(), storbinary() and storlines(), you
> certainly want some try/finally blocks so that the data connection
> always gets closed at the end.
I agree, it's a good practice.
I avoided to do that because the original FTP class is coded like that.
Anyway, this is done too now.
Modified patch is in attachment.
I hope I'll be able to work on tests and documentation during this week-
end. |
|
| Date |
User |
Action |
Args |
| 2009-10-16 18:43:25 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, gregory.p.smith, janssen, pitrou, roberte, iElectric, lszyba1, twhitema, jeffo, qwavel, lgedgar |
| 2009-10-16 18:43:25 | giampaolo.rodola | set | messageid: <1255718605.33.0.0816164650188.issue2054@psf.upfronthosting.co.za> |
| 2009-10-16 18:43:18 | giampaolo.rodola | link | issue2054 messages |
| 2009-10-16 18:43:17 | giampaolo.rodola | create | |
|