[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Any tips or documentation for writing a new Curl_handler (protocol)?



On Wed, Jul 11, 2018 at 01:16:33PM +0100, Richard W.M. Jones wrote:
> On Wed, Jul 11, 2018 at 02:09:02PM +0200, Wouter Verhelst wrote:
> > Personally, I'm not entirely sure that libcurl really maps well to NBD,
> > tbh, since NBD is not a "one request per URL" protocol like most other
> > libcurl-supported protocols currently are (at least for the most part).
> > 
> > But I have to admit that I'm not too familiar with the libcurl internals
> 
> I believe we're OK here.  As long as I write the NBD Curl handler so
> that it holds open the NBD connection between READFUNCTION/
> WRITEFUNCTION callbacks.
> 
> In other words, it acts somewhat like HTTP keepalive.

Yeah, sure. When I said "I don't think it maps very well," I didn't mean
to also say "and you can't hack your way around that" ;-)

I'm sure there are various ways of working around that problem; that
doesn't make it a good idea to do so.

> (Of course most people will be more familiar with the curl command
> line tool, and in that case a single use of the curl command line tool
> will correspond to a single NBD connection, roughly speaking).

Sure. I have done some (minimal) work with the libcurl API in the past
though, and even there I think the more common case is "give libcurl a
URL, give it a callback, tell it to have fun". I'm not sure that's the
best way forward for an NBD client-side library, since we expect to do a
lot more back-and-forth than that.

-- 
Could you people please use IRC like normal people?!?

  -- Amaya Rodrigo Sastre, trying to quiet down the buzz in the DebConf 2008
     Hacklab


Reply to: