-
-
Notifications
You must be signed in to change notification settings - Fork 125
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use multipart_form instead of multipart-form-data #45
Conversation
Just skimming in, @dinosaure you might want to provide a script to generate the 100MB file (can be in a dune rule to automate it for users) instead of committing it to the repo, otherwise, it'll slow down the git clones for contributors |
c9a89bd
to
b26e0a4
Compare
Ah yes, I forget about that, sorry. |
Thanks! I'm reviewing the code now. I'm initially puzzled by this phrase, though:
AFAIK the current dependency |
dream.opam
Outdated
@@ -95,6 +95,10 @@ depends: [ | |||
"ppx_expect" {with-test} | |||
] | |||
|
|||
pin-depends: [ | |||
[ "multipart_form" "git+https://github.com/dinosaure/multipart_form#e4cbe0db5c6a03e02e9018c25e6ba0dbc5de4809" ] |
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.
Just leaving a note here, to resolve it once there is a multipart_form
release, so we can remove the pin-depends
and add a constraint instead.
So We noticed that we don't let any chance to OCaml to garbage-collect previous chunks and this is why we decided to use
We tried to play with Moreover, RFC 7578 deprecates I think, if we want to compare multiple implementations of |
fb17623
to
a3bc25b
Compare
52995fb
to
cfaee2e
Compare
I pushed-force a new version (without any changes on examples due to a cryptic compilation error with Let me know if something is not good for you 馃憤. |
Just to put down in writing here messages from chat, the cryptic errors are caused by ocaml-ppx/ppxlib#221, and it should be possible to fix them, for the time being, by downgrading ppxlib to 0.20.0. Once there is a fix, I'll have Dream require the fixed version, so that this doesn't come up again (hopefully!) (#56). |
I forced-pushed the last version which includes PS: the fix about |
Thank you! |
As mentioned in #3, this PR is a first-shot to be able to stream and upload large files with
dream
. I tried to respect as much as I can the initial interface and tweak a bit some details but:I'm not very convince by the API and the internal state of the request but I don't have the time to figure out about a better interface 馃槙. The state uses a trick about
object
to generate unique ID and I think this is the only obscure part of my code.Then, the "state-machine" is pretty simple and we don't need the ancient plumbing with streams & tasks.
Finally, the
multipart_form
package (what is needed for this PR) is unreleased but it's about few functions such as*.to_string
otHeader.to_list
. Hope that this PR is good, feel free to share a feedback 馃檪 .