Smart HTTP support#49
Conversation
also, update references only if asked to (default is false)
This is not pretty
This was a bit more painful than what was planned, as:
- the the "smart" HTTP mode and in the Git/SSH ones have minor differences
- it was quite involved to wrap Lwt_io.{input,output}_channel and Cohttp
response and request bodies. But surpisingly, it seems to work well now.
Very limited testing so far but this works:
ogit clone https://github.com/samoht/test.git
(And it's using conduit, so `export CONDUIT_TLS=native` works as well:
OCaml everywhere!)
|
Note: currently support clone and fetch only, not push. Remaining patches coming tomorrow. |
There was a problem hiding this comment.
Hm, I wonder if this would be easier with a Cohttp_lwt_cstruct backend instead? @djs55 wanted this for the xapi socket backend too
There was a problem hiding this comment.
not sure. the idea here is just to consider the body as a normal channel (and do the chunk encoding automatically). Actually the "hard" bit is http_ic.
There was a problem hiding this comment.
ahh that's a nice API -- i'll think about if it would fit into either conduit or cohttp
There was a problem hiding this comment.
it's also parsing/skipping the HTTP headers, so yea would fit into cohttp better. The only issue is that is seems not possible to start reading the response while the the post body is not completely sent. Not sure if it is an issue with cohttp or with the Git servers.
There was a problem hiding this comment.
@avsm I think it could help if conduit close function didn't close both input and output channels.
6876454 to
520ffda
Compare
|
Need a new release of |
|
will do shortly
|
It was more painful than expected, especially bounding
Lwt_iochannels andCohttpbodies together. But it seems to work ...