Commit Graph

333 Commits (master)

Author SHA1 Message Date
Vitaliy Filippov 98416354f7 Remove "me in readers" condition (fix #37) 2016-01-11 18:15:29 +03:00
Vitaliy Filippov 86acd18978 Fix ResourceTest 2016-01-06 12:55:46 +03:00
Vitaliy Filippov 4a4e22026b Fix json Val type check 2016-01-06 02:21:33 +03:00
Vitaliy Filippov b6c0013052 Fix subdir/subsubdir/newfile bug
New files put in sub-subdirs of drive root were also trashed locally instead of begin uploaded to the server
2016-01-06 01:48:30 +03:00
Vitaliy Filippov 60acb75967 Fix local index updating for items already in sync 2016-01-06 01:44:22 +03:00
Vitaliy Filippov 0112330c1d Do not die and do not update local state of file on sync exceptions. Should fix #47 2016-01-05 20:14:35 +03:00
Vitaliy Filippov d606a360be Merge pull request #54 from Artox/pr
std::vector::erase is expensive; use std::list:erase instead
2016-01-03 19:24:39 +03:00
Vitaliy Filippov 3b9aa4f2aa Add new_rev switch support to drive v2 api client 2016-01-03 18:24:34 +03:00
Vitaliy Filippov ca4a0b6b80 Index allows us to not turn -f on when changing ignore regexp 2016-01-03 17:40:23 +03:00
Josua Mayer b49a89ad34 std::vector::erase is expensive; use std::list:erase instead
erasing from a vector at random is very expensive. std::list however is made for that purpose!
2016-01-03 14:24:55 +01:00
Vitaliy Filippov 00311e8365 Implement automatic rename detection 2016-01-03 12:43:22 +03:00
Vitaliy Filippov 23fa985bdb Do not track last_sync at all, clear srv_time's with -f option 2016-01-03 02:01:02 +03:00
Vitaliy Filippov 8f640ebdad Check local index instead of last_sync time, totally disable separate folder and changes sync passes 2016-01-03 02:01:02 +03:00
Vitaliy Filippov af05c7c626 Use stored server times to check for server-side modifications
(broken because deleted/new detection logic relies on last_sync/last_change)
2016-01-03 02:01:02 +03:00
Vitaliy Filippov 4edff0a816 Cache file checksums and modification times in local index (in JSON in .grive_state) 2016-01-03 02:01:01 +03:00
Vitaliy Filippov 5381919e5b Enable warnings and fix them 2016-01-03 02:01:01 +03:00
Vitaliy Filippov 5fb3c187fe Oops this was a fail. ignore option was ignored if it was previously empty in grive_state. Fixes #50 2015-12-28 02:00:47 +03:00
Vitaliy Filippov ff9d7bcd14 Warn, but not die, on filesystem exceptions during sync. Fixes #44 2015-12-13 01:53:35 +03:00
Vitaliy Filippov 9c43ad9cc9 Internally convert -s option to ignore regexp. Fixes #49, should fix #42. 2015-12-12 17:19:07 +03:00
Vitaliy Filippov 7e6e153a3a Use regex_search() instead of regex_match(), turn on -f implicitly when changing ignore regexp (should fix #43) 2015-12-12 17:19:00 +03:00
Vitaliy Filippov 85b35b4fca Fix RelPath() for --ignore option to work correctly 2015-12-12 16:44:02 +03:00
Vitaliy Filippov 41bf5ba845 "Fix" file size at the moment of adding it to ConcatStream (fixes #39) 2015-11-11 13:08:08 +03:00
Vitaliy Filippov afbd9d7234 Merge pull request #40 from theopolis/check_downloadurl
Check for missing downloadUrl
2015-11-11 12:30:28 +03:00
Dylan Wulf 3b608329b9 Added ability to move and rename files/directories 2015-11-10 12:54:49 +03:00
Teddy Reed 9156785334 Check for missing downloadUrl 2015-11-09 20:27:55 -08:00
Vitaliy Filippov 81b1a4f05c Fix non-virtual destructor and missing return value (fixes "illegal instruction" under FreeBSD) 2015-10-10 21:43:54 +00:00
Vitaliy Filippov df99954382 Change m_str.replace back to insert + remove StringStream limit 2015-10-10 13:01:05 +03:00
Vitaliy Filippov 887da88c14 Simplify http::Agent methods and use multipart upload
Should speed-up uploads by updating metadata and contents at the same time.
Also should fix most 412 errors because of the update atomicity.
2015-10-10 00:54:05 +03:00
Vitaliy Filippov 679fa0eec6 Use title instead of originalFilename - fixes #32 2015-10-08 14:23:59 +03:00
Vitaliy Filippov 1cca10272d Track both server-side and local sync times - fixes #6 2015-10-08 13:30:50 +03:00
Vitaliy Filippov d9300c953e Fix .trash and .grive_state in drive location when used with -p option
Previously .trash and .grive_state were incorrectly placed in the current
working directory instead of synced root directory (-p).
2015-10-08 01:41:35 +03:00
Vitaliy Filippov f288c559c6 Oops. I was thinking auto_ptr is smart_ptr O_o. Sorry. Also fix #33 2015-10-07 01:57:28 +03:00
Vitaliy Filippov dc8e172a27 Handle error HTTP responses in OAuth2 2015-09-30 15:52:24 +03:00
Vitaliy Filippov 9402bff12e Implement normal reliable HTTP logging (in Agent)
Flushes on every call so may be slightly slow, but in return always provides full
information in case of a segfault or a failed assertion.
2015-09-30 15:01:50 +03:00
Vitaliy Filippov 9b8e0c826b Remove request logging from Drive/Feed/Syncer (prepare to move it into CurlAgent) 2015-09-30 13:54:45 +03:00
Vitaliy Filippov 7ac15187d3 Add --ignore (perl regexp) option 2015-09-25 13:11:56 +03:00
Vitaliy Filippov 6f35a32ca2 Get auth headers again before each Put() retry - fixes #19 2015-08-04 22:59:09 +03:00
Vitaliy Filippov 308aab92cf Also print response body on 401 2015-07-04 00:25:13 +03:00
Vitaliy Filippov 1d47616518 Fix #17 (curl_slist memory leak) 2015-07-04 00:18:59 +03:00
Vitaliy Filippov 5da32905ea Move old tests to fix build errors, fixes #14 2015-06-27 23:18:03 +03:00
Vitaliy Filippov 70ec926e2a Add response body and headers to diagnostic information on HTTP 400 and above
Also should fix #13 because stops AuthAgent from using the same response multiple times
2015-06-27 22:58:09 +03:00
Vitaliy Filippov 82705f39b0 Fix 412's on reupload. Fixes #5 2015-05-21 19:23:45 +03:00
Vitaliy Filippov 37b2cf3102 Ignore files without md5Checksum. Fixes #2 2015-05-20 15:14:24 +03:00
Vitaliy Filippov 815d0ea44e Make libbfd happy. In conjunction with libiberty fixes #1 2015-05-20 02:15:01 +03:00
Vitaliy Filippov c006e75d26 Return libiberty back 2015-05-20 02:15:01 +03:00
Vitaliy Filippov 29241002eb Add myself to copyrights, change README 2015-05-17 22:11:35 +03:00
Vitaliy Filippov 0bdbf87514 Ignore local .trash, fix REST API - it mostly works 2015-05-17 21:05:24 +03:00
Vitaliy Filippov 2d34d7708b Implement upload methods for REST API Syncer (basic file upload to root now works) 2015-05-17 20:10:03 +03:00
Vitaliy Filippov a4521d9d62 Remove obsolete gdbm & iberty cmake modules 2015-05-17 16:59:58 +03:00
Vitaliy Filippov 862fca035a Move all protocol interaction into Syncers out of the base code 2015-05-17 16:54:04 +03:00
Vitaliy Filippov 717a6a4793 Use vector<Entry> instead of iterator_adaptor to hide implementation details 2015-05-17 14:32:04 +03:00
Vitaliy Filippov dabaaac38f Cleanup Feed interface (remove some unused methods) 2015-05-17 12:29:00 +03:00
Vitaliy Filippov 6a15dd09a5 Split Resource to global (base/Resource) and API-specific ({drive,drive2}/Syncer) parts 2015-05-17 02:00:00 +03:00
Vitaliy Filippov f41e4f6dd3 Split Entry to v1::Entry1 and v2::Entry2 2015-05-16 21:10:38 +03:00
Vitaliy Filippov b0255d9699 Add Entry constructor for new Drive REST API 2015-05-16 19:38:43 +03:00
Vitaliy Filippov 2d8da5cab3 Remove doclist API specific fields from Entry class: kind, create_link, edit_link and alt_self 2015-05-16 12:35:41 +03:00
Vitaliy Filippov 770baca3fc Reduce syscalls slightly more (os::FileCTime is still left...) 2015-05-16 01:05:19 +03:00
Vitaliy Filippov 5bc503279a Remove JSON-C json wrappers, use YAJL for everything 2015-05-16 00:37:02 +03:00
Vitaliy Filippov ac1763f2c7 Merge https://github.com/visap/grive/commits/visa 2015-05-16 00:36:26 +03:00
Vitaliy Filippov f16f212281 use pkg-config also for finding json-c (fixes paths on debian) 2015-05-14 01:20:35 +03:00
Vitaliy Filippov c0c89c306c Remove useless swap() code 2015-05-14 01:10:09 +03:00
Vitaliy Filippov 400d9e0c0f Fix long/int cast errors 2014-07-23 14:51:13 +04:00
Vitaliy Filippov 459313ecf5 Find YAJL via pkg-config 2014-07-23 14:51:13 +04:00
Visa Putkinen 3775572f46 Retry upload on XML error instead of crashing
Sometimes the Google Drive API sends malformed XML which crashes grive.
This patch adds a simple try-catch to Resource::Upload that retries the
upload if an XML exception is thrown from AuthAgent::Put.
2013-11-27 00:15:24 +02:00
Visa Putkinen 84785ec473 Fix hang when upload receives HTTP 500
When an uploading PUT request got a HTTP 500 as reponse, grive hanged
forever inside libcurl. This was because the File parameter was not
rewound to 0 position on retry. The XmlResponse had to be cleared as
well.

Rewinding the File and clearing the XmlResponse were not enough to fix
the problem, because when retrying after 500, HTTP 410 Gone or 412
Precondition failed is often received, and CheckHttpResponse would throw
an exception that crashes grive. Therefore, I implemented a retry logic
to Resource::Upload that retries the whole upload transaction if 410 or
412 was received.
2013-11-27 00:15:24 +02:00
Visa Putkinen 645bb2e7d4 Add delay before auth token refresh
This is sometimes necessary to prevent too frequent requests.
2013-11-27 00:15:15 +02:00
Visa Putkinen 986ab4acc6 Log XML on parse failure 2013-11-25 00:18:47 +02:00
Visa Putkinen 8b434dad14 Reduce number of syscalls while scanning local files 2013-11-24 14:34:03 +02:00
Visa Putkinen c15bfbe8bc Ignore only .grive and .grive_state 2013-11-24 14:25:01 +02:00
Vitaliy Filippov 752eb3fdda Allow to sync just one directory in the root 2013-09-08 02:36:30 +04:00
Nestal Wan 27817e835f using the new Json classes for bgrive 2013-05-03 00:40:04 +08:00
Nestal Wan 6ba04dcfba added operator<< to print out json 2013-05-02 00:55:39 +08:00
Nestal Wan 6fa6e690c6 added json writer 2013-05-02 00:41:47 +08:00
Nestal Wan abfa9ce765 added ValResponse class to parse JSON from http 2013-05-02 00:04:42 +08:00
Nestal Wan 2d29692601 added yajl parser 2013-05-01 22:47:37 +08:00
Nestal Wan 540e3d82db added type conversion to supported types 2013-05-01 13:36:29 +08:00
Nestal Wan 658fb757e3 added Val class for generic representation of JSON, but there's some problems with maps 2013-05-01 01:56:34 +08:00
Nestal Wan d5ca8e0afa show title and mime in GUI 2013-04-30 00:13:13 +08:00
Nestal Wan 15b3b85807 UT compile fixes 2013-04-29 23:49:01 +08:00
Nestal Wan bba65c0cc7 show files now. working good. 2013-04-29 23:47:33 +08:00
Nestal Wan 93fe68ce4c fixing the problems with multiple parent 2013-04-29 23:47:33 +08:00
Nestal Wan 94d66f0d30 can show tree now, but still has issues 2013-04-29 23:47:33 +08:00
Nestal Wan 326ae20ca7 showing in qt model, but no child 2013-04-29 23:47:33 +08:00
Nestal Wan ee6408d05f changed to store parent IDs 2013-04-29 23:47:33 +08:00
Nestal Wan 87d96972f7 Added Query() helper to Feed. and common URI header 2013-04-29 23:47:33 +08:00
Nestal Wan 209d0b5a59 added code to fetch all folders 2013-04-29 23:47:33 +08:00
Nestal Wan 62dc542341 refactored old GDoc API into v1 namespace. using v2 namespace for new Google Drive API 2013-04-29 23:47:33 +08:00
Nestal Wan 738435837b using DataStream instead of Receiveable 2013-04-29 23:47:32 +08:00
Nestal Wan 443a85d558 removing redundant header parameter in Feed 2013-04-29 23:47:32 +08:00
Nestal Wan d4a7fae273 refactored exception handling 2013-04-29 23:47:32 +08:00
Nestal Wan 755ee1c9ad new qt gui 2013-04-29 23:47:32 +08:00
justin 29f17397c1 fix broken unit tests 2012-08-01 20:46:59 +01:00
Nestal Wan 804fe923f2 refactored the config file part from #109 2012-07-30 16:52:59 +08:00
Nestal Wan 612b35a090 fixed compiler warnings 2012-07-30 16:43:51 +08:00
Nestal Wan bec8362639 added template contructor for object 2012-07-30 16:43:36 +08:00
Nestal Wan 0b2a8c0a54 clean up on #109 2012-07-30 15:24:47 +08:00
justin 034891a610 issue 86 allow sync folder to be specified, move Config class and add basic unit test 2012-07-29 18:17:41 +01:00
justin e0383a843c remove unused code 2012-07-29 17:53:02 +01:00
Nestal Wan d831b8d59f support creating revisions with --new-rev (#87) 2012-07-27 00:45:53 +08:00
Nestal Wan fd81cc1fe4 added --log-xml for debugging (#80) 2012-07-27 00:17:44 +08:00