-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resume partial writes in gnutls_bye() #596
base: master
Are you sure you want to change the base?
Conversation
src/lftp_ssl.cc
Outdated
if(handshake_done) | ||
gnutls_bye(session,GNUTLS_SHUT_RDWR); // FIXME - E_AGAIN | ||
res=gnutls_bye(session,GNUTLS_SHUT_RDWR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move declaration of res here, it's better to declare in a more local scope where it is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean:
res=gnutls_bye(session,GNUTLS_SHUT_RDWR); | |
int res=gnutls_bye(session,GNUTLS_SHUT_RDWR); |
And remove int res;
from the top of lftp_ssl_gnutls::shutdown()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right
src/lftp_ssl.cc
Outdated
{ | ||
int res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int res; |
Forced push based on your feedback. |
@@ -42,7 +42,7 @@ int IOBufferSSL::Do() | |||
if(Put_LL("",0)<0) | |||
return MOVED; | |||
if(ssl->handshake_done && eof) | |||
ssl->shutdown(); | |||
PutEOF_LL(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use return value?
@@ -340,10 +340,22 @@ void lftp_ssl_gnutls::load_keys() | |||
} | |||
gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cred); | |||
} | |||
void lftp_ssl_gnutls::shutdown() | |||
int lftp_ssl_gnutls::shutdown() | |||
{ | |||
if(handshake_done) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opening brace?
Co-authored-by: Štěpán Brož <[email protected]>
This pull request should make lftp resume partial writes that happen in gnutls_bye() on SSL shutdown.
A partial write on SSL shutdown can cause problems with some FTPS servers, e.g. IIS on Windows.
This is my first pull request to lftp, any feedback welcome.