nextcloud-desktop/csync/src/httpbf
2014-02-24 19:32:41 +01:00
..
client Move csync in order to merge it with mirall 2014-01-13 14:39:50 +01:00
src Make it compile with the merge of csync mirall 2014-01-15 12:20:03 +01:00
tests add missing copyright header 2014-02-24 19:32:41 +01:00
CMakeLists.txt Remove cmake warning 2014-02-02 22:59:08 +01:00
README Move csync in order to merge it with mirall 2014-01-13 14:39:50 +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.