nextcloud-desktop/src/httpbf
2013-07-11 17:01:49 +02:00
..
client Initial checkin of the http-big-file handling. 2013-01-28 21:17:23 +01:00
src Better do not use the var name abort as it confuses syntax highlighter. 2013-07-11 17:01:49 +02:00
tests Initial checkin of the http-big-file handling. 2013-01-28 21:17:23 +01:00
CMakeLists.txt Add neon includes to httpbf build 2013-05-17 12:45:39 +02:00
README Initial checkin of the http-big-file handling. 2013-01-28 21:17:23 +01:00

This is a little code that does ownCloud file chunking.

Basically to put a local file to an url:
(Also see the client example code in client dir.)

/* Initialize the transfer, get a transfer struct. */
hbf_transfer_t *trans = hbf_init_transfer( url );

Hbf_State state;
if( trans ) {
  int fd = open_local_file( file );

  /* create a neon session to use for the transfer */
  ne_session *session = create_neon_session(uri);
 
  if( session && fd > -1 ) {
    /* Prepare the list of chunks, ie. calculate chunks and write back to trans. */
    state = hbf_splitlist(trans, fd);

    if( state == HBF_SUCCESS ) {
      /* Transfer all the chunks through the HTTP session using PUT. */
      state = hbf_transfer( session, trans, "PUT" );
    }
  }
}

GET a large file:
Do GET Range requests.