Question about dpl_put_buffered and dpl_get_buffered

15 views
Skip to first unread message

Joacchim

unread,
Feb 8, 2011, 6:22:43 AM2/8/11
to SCOP
Hello,

While reading the functions offered by your library's API, i found
those two functions that seemd to use the HTTP chunked request system
of the S3 API.

I then read the code of the library in order to understand how to use
it, and found something that disturbed me. I think that either I
missed something in the API, either there's something wrong in it, but
I guess the people here are in the best place to answer me.

So, reading the code of the dpl_put_buffered section, I found that the
user as to provide a dpl_conn_t** to retrieve the current connection.
Fine with me, it's needed in order to be able to send each chunk one
by one, by reusing the same connection.
Actually, i searched the whole function for somewhere where the
dpl_conn_t** would be manipulated to use the connection it contains,
but it was nowhere to be found.

My question is then : Must the library's user retrieve the connection
and use it independently to send each chunk, or did i miss something
in the library that allows using it in a friendly manner ?

Vianney Rancurel

unread,
Feb 8, 2011, 9:09:17 AM2/8/11
to scalit...@googlegroups.com
Nope, you don't have to bother about the connection. In the case
you do a dpl_put_buffered() it returns the current dpl_conn_t*
then you wan write directly into it.

This API is quite low level, you may use the file API:

dpl_openwrite(), dpl_write(), dpl_close() to upload a file to the bucket instead.

If you want to understand how dpl_put_buffered() works then you can have a look to
how the dpl_openwrite(), dpl_write() and dpl_close() are implemented.

Vianney

Hello,

--

www.scality.com
Vianney Rancurel
+33 1 7809 8270
+33 6 7737 9967


Reply all
Reply to author
Forward
0 new messages