-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
examples/imap-append: Set size of data to be uploaded #1011
Conversation
Prior to this commit this example failed with error 'Cannot APPEND with unknown input file size'. Bug: curl#1008 Reported-by: lukaszgn@users.noreply.github.com Closes #XXXX
@jay, thanks for your PR! By analyzing the annotation information on this pull request, we identified @captain-caveman2k and @bagder to be potential reviewers |
It seems like a fine fix to me, the question is however why it is needed. An upload should stop when a zero is returned from the read callback as that example already does, so while this fix makes the example run fine again it might also just mask a bug... |
The problem is I don't think you can do that with IMAP. I assume the example must have worked at some point and I reviewed its history but I don't see the size was ever set. IMAP send extra data seems to be knowing the continuation size and communicating it to the server beforehand, like COMMAND OPTIONS {data-byte-count}. For example right now an APPEND starts like this: More detail from IMAP RFC for APPEND:
It doesn't define 'message literal' explicitly but earlier says:
And literal is defined in String as:
So I think we have to calculate the size beforehand. |
Ah, it has clearly been too long since I was hands-on with IMAP since I have totally forgotten about that detail. Then I'm in agreement with you. That's a necessary change of the example and we should even figure out somewhere where this is best documented... |
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.
👍
Prior to this commit this example failed with error
'Cannot APPEND with unknown input file size'.
Bug: #1008
Reported-by: lukaszgn@users.noreply.github.com
Closes #XXXX