mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
this fixes the error and makes complete oCC compile with GCC 5. error: ISO C does not support '__FUNCTION__' predefined identifier [-Wpedantic] According to the porting guide: The fix is either to use the standard predefined identifier __func__ (since C99), or to use the __extension__ keyword. |
||
|---|---|---|
| .. | ||
| client | ||
| src | ||
| tests | ||
| CMakeLists.txt | ||
| README | ||
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.