synk, branch HEADsynchronize files between hosts
3349544b57211c18f3a54bfa4d48b2065f260a192019-07-01T09:10:15Z2019-07-01T09:10:15ZUpdate contact informationWilly Goiffondev@z3bra.orgcommit 3349544b57211c18f3a54bfa4d48b2065f260a19
parent 7e7eb4e731666891586edb57108c00f4c456bb80
Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 1 Jul 2019 11:10:15 +0200
Update contact information
7e7eb4e731666891586edb57108c00f4c456bb802017-07-20T06:24:19Z2017-07-20T06:24:19ZBump version 1.1z3bracontactatz3bradotorgcommit 7e7eb4e731666891586edb57108c00f4c456bb80
parent f664728af377b54b993801c61a4ad8212b8ed812
Author: z3bra <contactatz3bradotorg>
Date: Thu, 20 Jul 2017 08:24:19 +0200
Bump version 1.1
f664728af377b54b993801c61a4ad8212b8ed8122017-06-08T06:12:10Z2017-06-08T06:12:10ZAdd makefile to build the softwarez3bracontactatz3bradotorgcommit f664728af377b54b993801c61a4ad8212b8ed812
parent 4694eb9f62d7532d313a3a8d5dc01d524efdd04e
Author: z3bra <contactatz3bradotorg>
Date: Thu, 8 Jun 2017 08:12:10 +0200
Add makefile to build the software
4694eb9f62d7532d313a3a8d5dc01d524efdd04e2017-06-08T06:11:51Z2017-06-08T06:11:51ZUpdate README for better clarityz3bracontactatz3bradotorgcommit 4694eb9f62d7532d313a3a8d5dc01d524efdd04e
parent 66edfe5193f6f9d3d8650544c7dad52a752c68a4
Author: z3bra <contactatz3bradotorg>
Date: Thu, 8 Jun 2017 08:11:51 +0200
Update README for better clarity
66edfe5193f6f9d3d8650544c7dad52a752c68a42017-06-08T06:06:29Z2017-06-08T06:06:29ZAdd missing netinet/in.h headerz3bracontactatz3bradotorgcommit 66edfe5193f6f9d3d8650544c7dad52a752c68a4
parent 2caf25119d8f52f1c4b13b0bbbf039569754c578
Author: z3bra <contactatz3bradotorg>
Date: Thu, 8 Jun 2017 08:06:29 +0200
Add missing netinet/in.h header
2caf25119d8f52f1c4b13b0bbbf039569754c5782017-06-06T06:32:46Z2017-06-06T06:32:46ZRename variables to match naming conventionz3bracontactatz3bradotorgcommit 2caf25119d8f52f1c4b13b0bbbf039569754c578
parent 6db93742576edd6cd9b99fda1c85c492f8944acc
Author: z3bra <contactatz3bradotorg>
Date: Tue, 6 Jun 2017 08:32:46 +0200
Rename variables to match naming convention
6db93742576edd6cd9b99fda1c85c492f8944acc2017-06-06T06:30:14Z2017-06-06T06:30:14ZMake argument type more specificz3bracontactatz3bradotorgcommit 6db93742576edd6cd9b99fda1c85c492f8944acc
parent ba4d659fcb168165b34f165dd480b8b7b2187f56
Author: z3bra <contactatz3bradotorg>
Date: Tue, 6 Jun 2017 08:30:14 +0200
Make argument type more specific
Real reason is that gcc 6.x doesn't recognize "char * []" as a "complete
type", and I don't like warnings... Screw you, GNU!
ba4d659fcb168165b34f165dd480b8b7b2187f562017-06-06T06:29:37Z2017-06-06T06:29:37ZRearrange headers orderz3bracontactatz3bradotorgcommit ba4d659fcb168165b34f165dd480b8b7b2187f56
parent 05c2017d3f988551b0cfe535424a8ff713b6cd31
Author: z3bra <contactatz3bradotorg>
Date: Tue, 6 Jun 2017 08:29:37 +0200
Rearrange headers order
05c2017d3f988551b0cfe535424a8ff713b6cd312016-09-12T11:40:55Z2016-09-12T11:40:55ZBump version 1.0z3brawillyatmailoodotorgcommit 05c2017d3f988551b0cfe535424a8ff713b6cd31
parent aa9ebd6d6195dad020c1e2ff124a955b62e120b2
Author: z3bra <willyatmailoodotorg>
Date: Mon, 12 Sep 2016 13:40:55 +0200
Bump version 1.0
aa9ebd6d6195dad020c1e2ff124a955b62e120b22016-09-09T11:28:55Z2016-09-09T11:28:55ZWait for the client to close the connectionz3brawillyatmailoodotorgcommit aa9ebd6d6195dad020c1e2ff124a955b62e120b2
parent a1da0e4995ec90f1913f3680543dc0f3c86c524c
Author: z3bra <willyatmailoodotorg>
Date: Fri, 9 Sep 2016 13:28:55 +0200
Wait for the client to close the connection
a1da0e4995ec90f1913f3680543dc0f3c86c524c2016-09-09T06:31:47Z2016-09-09T06:31:47ZUse _POSIX_PATH_MAX instead of PATH_MAXWillywillyatmailoodotorgcommit a1da0e4995ec90f1913f3680543dc0f3c86c524c
parent 8b8a17a79f10982e0c838b3dff5c91aef3fe936c
Author: Willy <willyatmailoodotorg>
Date: Fri, 9 Sep 2016 08:31:47 +0200
Use _POSIX_PATH_MAX instead of PATH_MAX
8b8a17a79f10982e0c838b3dff5c91aef3fe936c2016-09-09T06:04:15Z2016-09-09T06:04:15ZParse config in client mode onlyWillywillyatmailoodotorgcommit 8b8a17a79f10982e0c838b3dff5c91aef3fe936c
parent a456dce1c91772af689a17850b8224705bd34719
Author: Willy <willyatmailoodotorg>
Date: Fri, 9 Sep 2016 08:04:15 +0200
Parse config in client mode only
a456dce1c91772af689a17850b8224705bd347192016-09-08T16:07:35Z2016-09-08T16:07:35ZUpdate mkfile to install manpagesWillywillyatmailoodotorgcommit a456dce1c91772af689a17850b8224705bd34719
parent 85d4dbcb1860db1aadc119514f93cd8930300e64
Author: Willy <willyatmailoodotorg>
Date: Thu, 8 Sep 2016 18:07:35 +0200
Update mkfile to install manpages
85d4dbcb1860db1aadc119514f93cd8930300e642016-09-08T16:03:06Z2016-09-08T16:03:24ZAdd manpage for the synk.conf(5) fileWillywillyatmailoodotorgcommit 85d4dbcb1860db1aadc119514f93cd8930300e64
parent 462ae7788c98eb609661e919418ca0bb55b358fa
Author: Willy <willyatmailoodotorg>
Date: Thu, 8 Sep 2016 18:03:06 +0200
Add manpage for the synk.conf(5) file
462ae7788c98eb609661e919418ca0bb55b358fa2016-09-08T12:22:47Z2016-09-08T12:22:52ZAdd manpage for the synk(1) commandWillywillyatmailoodotorgcommit 462ae7788c98eb609661e919418ca0bb55b358fa
parent aa93f8110afe112cdb55cf72b6245b576ebdbc08
Author: Willy <willyatmailoodotorg>
Date: Thu, 8 Sep 2016 14:22:47 +0200
Add manpage for the synk(1) command
aa93f8110afe112cdb55cf72b6245b576ebdbc082016-09-08T12:19:48Z2016-09-08T12:19:48ZPass the -p flag in server modeWillywillyatmailoodotorgcommit aa93f8110afe112cdb55cf72b6245b576ebdbc08
parent 7db446f73d41673b6503f5a58c50147d77e903ef
Author: Willy <willyatmailoodotorg>
Date: Thu, 8 Sep 2016 14:19:48 +0200
Pass the -p flag in server mode
7db446f73d41673b6503f5a58c50147d77e903ef2016-09-08T06:21:45Z2016-09-08T06:21:45ZHOST arg is optionnalWillywillyatmailoodotorgcommit 7db446f73d41673b6503f5a58c50147d77e903ef
parent b28a530c497502283f0fd988dd5f781cce78c967
Author: Willy <willyatmailoodotorg>
Date: Thu, 8 Sep 2016 08:21:45 +0200
HOST arg is optionnal
b28a530c497502283f0fd988dd5f781cce78c9672016-09-07T12:37:45Z2016-09-07T12:37:45ZAdd debug informationsWillywillyatmailoodotorgcommit b28a530c497502283f0fd988dd5f781cce78c967
parent 408ba38ec5c0c74adec071d58f3219471cedfb70
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 14:37:45 +0200
Add debug informations
408ba38ec5c0c74adec071d58f3219471cedfb702016-09-07T12:09:07Z2016-09-07T12:09:07ZMerge branch 'loadconf'Willywillyatmailoodotorgcommit 408ba38ec5c0c74adec071d58f3219471cedfb70
parent 737370d683dbd0e04feae39f454169158a27091b
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 14:09:07 +0200
Merge branch 'loadconf'
737370d683dbd0e04feae39f454169158a27091b2016-09-07T12:07:20Z2016-09-07T12:07:20ZRemove log level LOG_ERRORWillywillyatmailoodotorgcommit 737370d683dbd0e04feae39f454169158a27091b
parent 1ee2824f8112b6ad79b95c811f8f8d3ed98f701f
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 14:07:20 +0200
Remove log level LOG_ERROR
81eb0c58c25c896c7629b32d80897fb1e7b1ebf72016-09-07T12:01:11Z2016-09-07T12:01:11ZDefine config file format in READMEWillywillyatmailoodotorgcommit 81eb0c58c25c896c7629b32d80897fb1e7b1ebf7
parent ee0f6f75bd5de8de145fda094c6aef938732c6b9
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 14:01:11 +0200
Define config file format in README
ee0f6f75bd5de8de145fda094c6aef938732c6b92016-09-07T11:44:12Z2016-09-07T11:44:17ZCleanup header filesWillywillyatmailoodotorgcommit ee0f6f75bd5de8de145fda094c6aef938732c6b9
parent b3f644e436534e648650db11022bd575defe56f9
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 13:44:12 +0200
Cleanup header files
b3f644e436534e648650db11022bd575defe56f92016-09-07T10:55:10Z2016-09-07T10:55:10ZUse yacc(1) to parse config fileWillywillyatmailoodotorgcommit b3f644e436534e648650db11022bd575defe56f9
parent 11db759707a8de9f5dc0686083d679d16a756555
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 12:55:10 +0200
Use yacc(1) to parse config file
11db759707a8de9f5dc0686083d679d16a7565552016-09-07T10:53:53Z2016-09-07T10:54:35ZMove global declarations to synk.hWillywillyatmailoodotorgcommit 11db759707a8de9f5dc0686083d679d16a756555
parent 2634aec4e642158dd6970891129b9fa8f7e0e81e
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 12:53:53 +0200
Move global declarations to synk.h
2634aec4e642158dd6970891129b9fa8f7e0e81e2016-09-06T22:45:56Z2016-09-06T22:45:56ZRename default macrosWillywillyatmailoodotorgcommit 2634aec4e642158dd6970891129b9fa8f7e0e81e
parent f6019ad0e9d48e70fa1f065b4dec323841a8c4a7
Author: Willy <willyatmailoodotorg>
Date: Wed, 7 Sep 2016 00:45:56 +0200
Rename default macros
f6019ad0e9d48e70fa1f065b4dec323841a8c4a72016-09-06T16:54:20Z2016-09-06T16:54:20ZNew flag to specify config pathWillywillyatmailoodotorgcommit f6019ad0e9d48e70fa1f065b4dec323841a8c4a7
parent 43a97e482b12a092bc8b38ea684e4ffa9f984e3a
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 18:54:20 +0200
New flag to specify config path
43a97e482b12a092bc8b38ea684e4ffa9f984e3a2016-09-06T16:46:48Z2016-09-06T16:46:48ZAbility to load peers from a fileWillywillyatmailoodotorgcommit 43a97e482b12a092bc8b38ea684e4ffa9f984e3a
parent 1ee2824f8112b6ad79b95c811f8f8d3ed98f701f
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 18:46:48 +0200
Ability to load peers from a file
1ee2824f8112b6ad79b95c811f8f8d3ed98f701f2016-09-06T11:42:08Z2016-09-06T11:42:08ZUpdate README to reflect current program stateWillywillyatmailoodotorgcommit 1ee2824f8112b6ad79b95c811f8f8d3ed98f701f
parent ae6498b42f302ea8e5287d13efc8c0508bdef941
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 13:42:08 +0200
Update README to reflect current program state
ae6498b42f302ea8e5287d13efc8c0508bdef9412016-09-06T11:41:49Z2016-09-06T11:41:49ZSlight change to a debug logWillywillyatmailoodotorgcommit ae6498b42f302ea8e5287d13efc8c0508bdef941
parent 91e24d608a0bc1f2f875cc61a1471724471b064a
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 13:41:49 +0200
Slight change to a debug log
91e24d608a0bc1f2f875cc61a1471724471b064a2016-09-06T11:37:33Z2016-09-06T11:37:33ZDon't flush the peer list between synchronisationsWillywillyatmailoodotorgcommit 91e24d608a0bc1f2f875cc61a1471724471b064a
parent 0f59adb46300524c2901a4a11c4a96f493413bbc
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 13:37:33 +0200
Don't flush the peer list between synchronisations
localhost is added to the peer list at the start of the program.
For each file to sync, the peer list is reused. It will be flushed after
all args have been processed.
This commit also fixes a small "bug" where 'syncfile()' doesn't wait for
all its chilren to return.
This means we won't sync the next file until the current one isn't
finished synchronising. Not sure wether or not this is a good thing, but
at least the logs appear in the "natural" order now.
0f59adb46300524c2901a4a11c4a96f493413bbc2016-09-06T10:16:23Z2016-09-06T10:16:23ZHandle files smaller than 127 bytesWillywillyatmailoodotorgcommit 0f59adb46300524c2901a4a11c4a96f493413bbc
parent 6dc505684ce6858d82889b8c487b768daaa3533d
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 12:16:23 +0200
Handle files smaller than 127 bytes
6dc505684ce6858d82889b8c487b768daaa3533d2016-09-06T06:46:01Z2016-09-06T06:46:01ZPeer localhost data with other peersWillywillyatmailoodotorgcommit 6dc505684ce6858d82889b8c487b768daaa3533d
parent 6ea0770423ed8bc445f150d43a6e18beeeb9bb25
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 08:46:01 +0200
Peer localhost data with other peers
6ea0770423ed8bc445f150d43a6e18beeeb9bb252016-09-06T06:35:02Z2016-09-06T06:35:02ZUpdate log messagesWillywillyatmailoodotorgcommit 6ea0770423ed8bc445f150d43a6e18beeeb9bb25
parent 2481dadd4fb2e8b42866d81fa5ae5c600121f021
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 08:35:02 +0200
Update log messages
2481dadd4fb2e8b42866d81fa5ae5c600121f0212016-09-06T06:34:18Z2016-09-06T06:34:18ZLower sha512 buffer sizeWillywillyatmailoodotorgcommit 2481dadd4fb2e8b42866d81fa5ae5c600121f021
parent 10e495a116df71afd7de3190ad207955889b010b
Author: Willy <willyatmailoodotorg>
Date: Tue, 6 Sep 2016 08:34:18 +0200
Lower sha512 buffer size
10e495a116df71afd7de3190ad207955889b010b2016-09-04T21:18:13Z2016-09-04T21:18:13ZFix comparison and add logsWillywillyatmailoodotorgcommit 10e495a116df71afd7de3190ad207955889b010b
parent bc9d67414e3bc01b83f7a6b054397fa3e2ee986e
Author: Willy <willyatmailoodotorg>
Date: Sun, 4 Sep 2016 23:18:13 +0200
Fix comparison and add logs
bc9d67414e3bc01b83f7a6b054397fa3e2ee986e2016-09-04T08:32:23Z2016-09-04T08:32:23ZRearrange function declarationWillywillyatmailoodotorgcommit bc9d67414e3bc01b83f7a6b054397fa3e2ee986e
parent a5fa976251072410375f2466833bef081e496846
Author: Willy <willyatmailoodotorg>
Date: Sun, 4 Sep 2016 10:32:23 +0200
Rearrange function declaration
a5fa976251072410375f2466833bef081e4968462016-09-03T22:55:17Z2016-09-03T22:55:17ZWait for child processes before returningWillywillyatmailoodotorgcommit a5fa976251072410375f2466833bef081e496846
parent 9453df688994798aebaffc745559c95dd492ebba
Author: Willy <willyatmailoodotorg>
Date: Sun, 4 Sep 2016 00:55:17 +0200
Wait for child processes before returning
9453df688994798aebaffc745559c95dd492ebba2016-09-03T22:03:58Z2016-09-03T22:04:03ZRely on remote synk(1) being in the PATHWillywillyatmailoodotorgcommit 9453df688994798aebaffc745559c95dd492ebba
parent ae21e085a572875e7e01381047853252d65ac663
Author: Willy <willyatmailoodotorg>
Date: Sun, 4 Sep 2016 00:03:58 +0200
Rely on remote synk(1) being in the PATH
ae21e085a572875e7e01381047853252d65ac6632016-09-03T21:59:55Z2016-09-03T21:59:55ZAdd a -q(uiet) mode to kill error messagesWillywillyatmailoodotorgcommit ae21e085a572875e7e01381047853252d65ac663
parent e872191ae4694a75d961467620784755eae1d160
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:59:55 +0200
Add a -q(uiet) mode to kill error messages
e872191ae4694a75d961467620784755eae1d1602016-09-03T21:57:31Z2016-09-03T21:57:31ZDon't fail if a file doesn't existsWillywillyatmailoodotorgcommit e872191ae4694a75d961467620784755eae1d160
parent 40270e60f6416f066c74fede12926f41b43b6070
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:57:31 +0200
Don't fail if a file doesn't exists
40270e60f6416f066c74fede12926f41b43b60702016-09-03T21:53:59Z2016-09-03T21:53:59ZConvert perror() calls to log(LOG_ERROR, ..)Willywillyatmailoodotorgcommit 40270e60f6416f066c74fede12926f41b43b6070
parent 63b3591f24ae303a61fd0c0be9f4bef8a4e98a24
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:53:59 +0200
Convert perror() calls to log(LOG_ERROR, ..)
63b3591f24ae303a61fd0c0be9f4bef8a4e98a242016-09-03T21:46:08Z2016-09-03T21:46:08ZActually run the rsync command generatedWillywillyatmailoodotorgcommit 63b3591f24ae303a61fd0c0be9f4bef8a4e98a24
parent 9aeb4bdc5ffb6c15f8ac96fadb3da1daa32e3c0e
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:46:08 +0200
Actually run the rsync command generated
9aeb4bdc5ffb6c15f8ac96fadb3da1daa32e3c0e2016-09-03T21:45:18Z2016-09-03T21:45:18ZSet verbosity to LOG_ERROR by defaultWillywillyatmailoodotorgcommit 9aeb4bdc5ffb6c15f8ac96fadb3da1daa32e3c0e
parent 5634711a7f8b6ef5b1d2d011697c21f3d4223b84
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:45:18 +0200
Set verbosity to LOG_ERROR by default
5634711a7f8b6ef5b1d2d011697c21f3d4223b842016-09-03T21:36:20Z2016-09-03T21:36:20ZMake the client reconnect RETRY timesWillywillyatmailoodotorgcommit 5634711a7f8b6ef5b1d2d011697c21f3d4223b84
parent cc46dfd595f112a68c17b7d01be792228e506aec
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:36:20 +0200
Make the client reconnect RETRY times
cc46dfd595f112a68c17b7d01be792228e506aec2016-09-03T21:34:46Z2016-09-03T21:34:46ZUse SIGALRM to make the server timeoutWillywillyatmailoodotorgcommit cc46dfd595f112a68c17b7d01be792228e506aec
parent 06e9c0735e637b1caf7bc32415880039e303f488
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:34:46 +0200
Use SIGALRM to make the server timeout
06e9c0735e637b1caf7bc32415880039e303f4882016-09-03T21:28:34Z2016-09-03T21:28:34ZPut host in serverloop in network orderWillywillyatmailoodotorgcommit 06e9c0735e637b1caf7bc32415880039e303f488
parent d0b15bb852ef0841e4d4542a91d45f0cc0fd02ab
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 23:28:34 +0200
Put host in serverloop in network order
d0b15bb852ef0841e4d4542a91d45f0cc0fd02ab2016-09-03T20:58:46Z2016-09-03T20:58:46ZUse hostname over IP for ssh/rsyncWillywillyatmailoodotorgcommit d0b15bb852ef0841e4d4542a91d45f0cc0fd02ab
parent 9e7246ff44e8e5a2bd5813d37683bc5640f6f8d7
Author: Willy <willyatmailoodotorg>
Date: Sat, 3 Sep 2016 22:58:46 +0200
Use hostname over IP for ssh/rsync
9e7246ff44e8e5a2bd5813d37683bc5640f6f8d72016-09-02T17:02:03Z2016-09-02T17:02:03ZMerge branch 'rspawn'Willywillyatmailoodotorgcommit 9e7246ff44e8e5a2bd5813d37683bc5640f6f8d7
parent 82e2b998925748562da710ef5ec8a01df652ef01
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 19:02:03 +0200
Merge branch 'rspawn'
82e2b998925748562da710ef5ec8a01df652ef012016-09-02T17:01:31Z2016-09-02T17:01:31ZMake the HOST param mandatoryWillywillyatmailoodotorgcommit 82e2b998925748562da710ef5ec8a01df652ef01
parent 8360556462013f145204a0e253c09986886414bc
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 19:01:31 +0200
Make the HOST param mandatory
8360556462013f145204a0e253c09986886414bc2016-09-02T16:59:48Z2016-09-02T16:59:48ZSave the hostname information in peer_t structsWillywillyatmailoodotorgcommit 8360556462013f145204a0e253c09986886414bc
parent b90c17add7b3b57172237a1eea69253d90f2407c
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 18:59:48 +0200
Save the hostname information in peer_t structs
b90c17add7b3b57172237a1eea69253d90f2407c2016-09-02T16:57:30Z2016-09-02T16:57:30ZAdd function to quickly resolve hostnames to in_addrWillywillyatmailoodotorgcommit b90c17add7b3b57172237a1eea69253d90f2407c
parent 82cf376888b0a53cfc1928a739a951bd0fbf30b1
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 18:57:30 +0200
Add function to quickly resolve hostnames to in_addr
ed209850f9ea2cadc0d40d6b157f71cfd76ed36a2016-09-02T11:57:41Z2016-09-02T11:57:41ZSpawn a server-mode synk on each peerWillywillyatmailoodotorgcommit ed209850f9ea2cadc0d40d6b157f71cfd76ed36a
parent 82cf376888b0a53cfc1928a739a951bd0fbf30b1
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 13:57:41 +0200
Spawn a server-mode synk on each peer
82cf376888b0a53cfc1928a739a951bd0fbf30b12016-09-02T11:52:57Z2016-09-02T11:52:57ZMake server mode one-shotWillywillyatmailoodotorgcommit 82cf376888b0a53cfc1928a739a951bd0fbf30b1
parent e88965f27c0b666e672353ad1a79558fe0f86f6b
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 13:52:57 +0200
Make server mode one-shot
This make the server able to handle a single connection only, and thus,
will make it terminate after syncing.
this also moves threading out of the equation.
e88965f27c0b666e672353ad1a79558fe0f86f6b2016-09-01T23:07:48Z2016-09-01T23:07:48ZFix sha512_compare() to use a referent peerWillywillyatmailoodotorgcommit e88965f27c0b666e672353ad1a79558fe0f86f6b
parent b59800dbb6e6361dfe8e2597b3585450d8763509
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 01:07:48 +0200
Fix sha512_compare() to use a referent peer
b59800dbb6e6361dfe8e2597b3585450d87635092016-09-01T23:05:44Z2016-09-01T23:05:44ZAdd verbose flagWillywillyatmailoodotorgcommit b59800dbb6e6361dfe8e2597b3585450d8763509
parent 91fe72f11a4c218d94a2694ad150ea1ed46edaae
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 01:05:44 +0200
Add verbose flag
91fe72f11a4c218d94a2694ad150ea1ed46edaae2016-09-01T22:38:15Z2016-09-01T22:39:39ZRead struct from server in chunksWillywillyatmailoodotorgcommit 91fe72f11a4c218d94a2694ad150ea1ed46edaae
parent 726cfff486a2c923d14397e15c8b64f95c7a96a3
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 00:38:15 +0200
Read struct from server in chunks
Structure will be sent from the server to the client in chunks of
RECVSIZ bytes, to deal with data fractionning over TCP.
726cfff486a2c923d14397e15c8b64f95c7a96a32016-09-01T22:37:52Z2016-09-01T22:37:52ZImplement log(LEVEL, fmt, ...) mechanismWillywillyatmailoodotorgcommit 726cfff486a2c923d14397e15c8b64f95c7a96a3
parent 41d70cb397f5b59584e1ca4b95f3e16c340a4ce7
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 00:37:52 +0200
Implement log(LEVEL, fmt, ...) mechanism
41d70cb397f5b59584e1ca4b95f3e16c340a4ce72016-09-01T22:36:04Z2016-09-01T22:36:04ZReformatting code for shorter linesWillywillyatmailoodotorgcommit 41d70cb397f5b59584e1ca4b95f3e16c340a4ce7
parent 644b6f8d59e9e9770fbd096806256f4148b32e98
Author: Willy <willyatmailoodotorg>
Date: Fri, 2 Sep 2016 00:36:04 +0200
Reformatting code for shorter lines
644b6f8d59e9e9770fbd096806256f4148b32e982016-09-01T16:34:12Z2016-09-01T16:34:12Zsyncfile() returns with 0 if no difference is foundWillywillyatmailoodotorgcommit 644b6f8d59e9e9770fbd096806256f4148b32e98
parent fa827f5f90ee4bb0bc0ebf47bebaab48045d62ed
Author: Willy <willyatmailoodotorg>
Date: Thu, 1 Sep 2016 18:34:12 +0200
syncfile() returns with 0 if no difference is found
fa827f5f90ee4bb0bc0ebf47bebaab48045d62ed2016-09-01T12:10:58Z2016-09-01T12:10:58ZFunction dosyncÃ(Ã) outputs the commands to runWillywillyatmailoodotorgcommit fa827f5f90ee4bb0bc0ebf47bebaab48045d62ed
parent 55f96b7e9985c6d3449d57bdd37b7720c6f5a4c1
Author: Willy <willyatmailoodotorg>
Date: Thu, 1 Sep 2016 14:10:58 +0200
Function dosyncÃ(Ã) outputs the commands to run
55f96b7e9985c6d3449d57bdd37b7720c6f5a4c12016-09-01T12:09:15Z2016-09-01T12:09:15ZCosmetic changes and small bugfixesWillywillyatmailoodotorgcommit 55f96b7e9985c6d3449d57bdd37b7720c6f5a4c1
parent 94ac24242e7b1a7d168e6c1505b71cb6a5585b99
Author: Willy <willyatmailoodotorg>
Date: Thu, 1 Sep 2016 14:09:15 +0200
Cosmetic changes and small bugfixes
94ac24242e7b1a7d168e6c1505b71cb6a5585b992016-09-01T10:06:39Z2016-09-01T10:06:46Zdosync() function to actually perform the synkroWillywillyatmailoodotorgcommit 94ac24242e7b1a7d168e6c1505b71cb6a5585b99
parent deb721c47bda91d79cc7b7d6160a8d5b644359d6
Author: Willy <willyatmailoodotorg>
Date: Thu, 1 Sep 2016 12:06:39 +0200
dosync() function to actually perform the synkro
deb721c47bda91d79cc7b7d6160a8d5b644359d62016-09-01T06:05:57Z2016-09-01T06:05:57ZImprove error checking in concat()Willywillyatmailoodotorgcommit deb721c47bda91d79cc7b7d6160a8d5b644359d6
parent 41a5e83a69cf024c072941210d90196e213c3f9e
Author: Willy <willyatmailoodotorg>
Date: Thu, 1 Sep 2016 08:05:57 +0200
Improve error checking in concat()
41a5e83a69cf024c072941210d90196e213c3f9e2016-08-31T21:46:50Z2016-08-31T21:46:50ZNew function to concatenate arraysWillywillyatmailoodotorgcommit 41a5e83a69cf024c072941210d90196e213c3f9e
parent da5b2a4bb3b995389485a50167dc232c8337b740
Author: Willy <willyatmailoodotorg>
Date: Wed, 31 Aug 2016 23:46:50 +0200
New function to concatenate arrays
da5b2a4bb3b995389485a50167dc232c8337b7402016-08-30T22:15:56Z2016-08-30T22:15:56ZAdd an echo() functionWillywillyatmailoodotorgcommit da5b2a4bb3b995389485a50167dc232c8337b740
parent 500c9acbff9c266759980f4fa5162e40056c2054
Author: Willy <willyatmailoodotorg>
Date: Wed, 31 Aug 2016 00:15:56 +0200
Add an echo() function
500c9acbff9c266759980f4fa5162e40056c20542016-08-30T21:03:38Z2016-08-30T21:03:38ZRemove useless logWillywillyatmailoodotorgcommit 500c9acbff9c266759980f4fa5162e40056c2054
parent 367e1d6ea7e87b08c1fc48db623e066015361ccd
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 23:03:38 +0200
Remove useless log
367e1d6ea7e87b08c1fc48db623e066015361ccd2016-08-30T21:00:13Z2016-08-30T21:00:13ZHave getmetadata() return a pointer to the metadataWillywillyatmailoodotorgcommit 367e1d6ea7e87b08c1fc48db623e066015361ccd
parent bfc62edabc6cbd02cb2788fed0ade60b56b9a282
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 23:00:13 +0200
Have getmetadata() return a pointer to the metadata
bfc62edabc6cbd02cb2788fed0ade60b56b9a2822016-08-30T20:45:27Z2016-08-30T20:45:27ZComment getmetadata() functionWillywillyatmailoodotorgcommit bfc62edabc6cbd02cb2788fed0ade60b56b9a282
parent e1f37a92c2a59173505a48495338e7c37855a8b6
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:45:27 +0200
Comment getmetadata() function
e1f37a92c2a59173505a48495338e7c37855a8b62016-08-30T20:39:24Z2016-08-30T20:39:24ZRename syncstatus() to uptodate()Willywillyatmailoodotorgcommit e1f37a92c2a59173505a48495338e7c37855a8b6
parent 66a2949e476739232a5cb7888d118d1f2d6dd5b8
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:39:24 +0200
Rename syncstatus() to uptodate()
66a2949e476739232a5cb7888d118d1f2d6dd5b82016-08-30T20:35:13Z2016-08-30T20:35:13ZAdd syncfile(), the main wrapper functionWillywillyatmailoodotorgcommit 66a2949e476739232a5cb7888d118d1f2d6dd5b8
parent 697a309f1a1667cf47385370c18e3387af07c06d
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:35:13 +0200
Add syncfile(), the main wrapper function
697a309f1a1667cf47385370c18e3387af07c06d2016-08-30T20:34:41Z2016-08-30T20:34:41ZAdd function to sync a master peer with a listWillywillyatmailoodotorgcommit 697a309f1a1667cf47385370c18e3387af07c06d
parent 7e527e7825ec47e18fbba3ebb88ef9910bfa5ec4
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:34:41 +0200
Add function to sync a master peer with a list
7e527e7825ec47e18fbba3ebb88ef9910bfa5ec42016-08-30T20:33:09Z2016-08-30T20:33:09ZCheck sync status amongst a peer listWillywillyatmailoodotorgcommit 7e527e7825ec47e18fbba3ebb88ef9910bfa5ec4
parent c20b5a3174a84d877f65d2885ec681943e67751f
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:33:09 +0200
Check sync status amongst a peer list
c20b5a3174a84d877f65d2885ec681943e67751f2016-08-30T20:32:24Z2016-08-30T20:32:24ZGet the most recent file from a list of peersWillywillyatmailoodotorgcommit c20b5a3174a84d877f65d2885ec681943e67751f
parent 5db306110bbecf1f8b8f7067ef64f244716af280
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:32:24 +0200
Get the most recent file from a list of peers
5db306110bbecf1f8b8f7067ef64f244716af2802016-08-30T20:31:07Z2016-08-30T20:31:07ZAdd function to get metadata from a peerWillywillyatmailoodotorgcommit 5db306110bbecf1f8b8f7067ef64f244716af280
parent 0b4e0f2bd28198e42d8dd21df92bf3c0b37bf544
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:31:07 +0200
Add function to get metadata from a peer
0b4e0f2bd28198e42d8dd21df92bf3c0b37bf5442016-08-30T20:26:41Z2016-08-30T20:26:41ZPass peer list head to functionsWillywillyatmailoodotorgcommit 0b4e0f2bd28198e42d8dd21df92bf3c0b37bf544
parent 4965d5192b39ed71a08892e0c75aba38a446a03c
Author: Willy <willyatmailoodotorg>
Date: Tue, 30 Aug 2016 22:26:41 +0200
Pass peer list head to functions
4965d5192b39ed71a08892e0c75aba38a446a03c2016-08-27T15:24:42Z2016-08-27T15:24:42ZRename 'node' to 'peer'Willywillyatmailoodotorgcommit 4965d5192b39ed71a08892e0c75aba38a446a03c
parent 8230add7e8d3d28830d8a22976e111c323171fa2
Author: Willy <willyatmailoodotorg>
Date: Sat, 27 Aug 2016 17:24:42 +0200
Rename 'node' to 'peer'
8230add7e8d3d28830d8a22976e111c323171fa22016-08-27T15:24:26Z2016-08-27T15:24:26ZAdd informations about functionnalitiesWillywillyatmailoodotorgcommit 8230add7e8d3d28830d8a22976e111c323171fa2
parent 671e5ee704165beccfd85e7dbb60740d0c703bc7
Author: Willy <willyatmailoodotorg>
Date: Sat, 27 Aug 2016 17:24:26 +0200
Add informations about functionnalities
671e5ee704165beccfd85e7dbb60740d0c703bc72016-08-26T06:58:42Z2016-08-26T06:58:42ZProvide an insight of the algorithmWillywillyatmailoodotorgcommit 671e5ee704165beccfd85e7dbb60740d0c703bc7
parent e91bc489c877001d81332b0f1d26c41a54c572d9
Author: Willy <willyatmailoodotorg>
Date: Fri, 26 Aug 2016 08:58:42 +0200
Provide an insight of the algorithm
e91bc489c877001d81332b0f1d26c41a54c572d92016-08-26T06:25:42Z2016-08-26T06:25:42ZClean peer list after processingWillywillyatmailoodotorgcommit e91bc489c877001d81332b0f1d26c41a54c572d9
parent 37a972d5c8dfb078d5e9ad89642a7de7faa84b3d
Author: Willy <willyatmailoodotorg>
Date: Fri, 26 Aug 2016 08:25:42 +0200
Clean peer list after processing
37a972d5c8dfb078d5e9ad89642a7de7faa84b3d2016-08-25T07:23:36Z2016-08-25T07:23:36ZGet the list of peers from the command lineWillywillyatmailoodotorgcommit 37a972d5c8dfb078d5e9ad89642a7de7faa84b3d
parent 52f63e2b5605b854bd5c82b14cfc588ce8530eca
Author: Willy <willyatmailoodotorg>
Date: Thu, 25 Aug 2016 09:23:36 +0200
Get the list of peers from the command line
By specifying the -h flag mutliple time, one can add multiple peer for
metadata comparison.
Each host will be loaded in the order specified. As the -p attributes
modifies the variable when it's evaluated, one can specify different
ports for each host by specifying the port BEFORE the host:
synk -p 1234 -h 10.0.0.1 -p 5678 -h 10.0.0.2 FILE
This will queue up the following hosts:
* 10.0.0.1:1234
* 10.0.0.2:5678
Regarding server mode, one will have to specify the -s flag BEFORE the
address to bind to in order to avoid creating a new node_t structure:
synk -s -h 0.0.0.0
52f63e2b5605b854bd5c82b14cfc588ce8530eca2016-08-25T06:11:15Z2016-08-25T06:11:15ZMove comparison logic out of getpeerinfo()Willywillyatmailoodotorgcommit 52f63e2b5605b854bd5c82b14cfc588ce8530eca
parent 613d8bc78a5d4230b4c6157ae1921d548569405b
Author: Willy <willyatmailoodotorg>
Date: Thu, 25 Aug 2016 08:11:15 +0200
Move comparison logic out of getpeerinfo()
613d8bc78a5d4230b4c6157ae1921d548569405b2016-08-24T13:13:36Z2016-08-24T13:13:36ZAdd SLIST for peers handlingWillywillyatmailoodotorgcommit 613d8bc78a5d4230b4c6157ae1921d548569405b
parent 23aed767285fc976c45fbb874cc11fef0ccb464d
Author: Willy <willyatmailoodotorg>
Date: Wed, 24 Aug 2016 15:13:36 +0200
Add SLIST for peers handling
23aed767285fc976c45fbb874cc11fef0ccb464d2016-08-24T06:45:54Z2016-08-24T06:45:54ZCreate one thread per clientWillywillyatmailoodotorgcommit 23aed767285fc976c45fbb874cc11fef0ccb464d
parent 061a8d1893ef222177f12dcd1d0f9ec84ca572c0
Author: Willy <willyatmailoodotorg>
Date: Wed, 24 Aug 2016 08:45:54 +0200
Create one thread per client
061a8d1893ef222177f12dcd1d0f9ec84ca572c02016-08-24T06:45:27Z2016-08-24T06:45:27ZMove sha512 functions to sha512.cWillywillyatmailoodotorgcommit 061a8d1893ef222177f12dcd1d0f9ec84ca572c0
parent 8c80e23c0813a078879f506afca68141a9c060a7
Author: Willy <willyatmailoodotorg>
Date: Wed, 24 Aug 2016 08:45:27 +0200
Move sha512 functions to sha512.c
8c80e23c0813a078879f506afca68141a9c060a72016-08-23T16:17:43Z2016-08-23T16:17:43ZUse structure for TCP communicationsWillywillyatmailoodotorgcommit 8c80e23c0813a078879f506afca68141a9c060a7
parent 8426dc6f82ed4939a3702ff9c2c0e51cfa3d76fd
Author: Willy <willyatmailoodotorg>
Date: Tue, 23 Aug 2016 18:17:43 +0200
Use structure for TCP communications
8426dc6f82ed4939a3702ff9c2c0e51cfa3d76fd2016-08-22T12:19:33Z2016-08-22T12:19:33ZFucking shell globsWillywillyatmailoodotorgcommit 8426dc6f82ed4939a3702ff9c2c0e51cfa3d76fd
parent c775ea906f42095dd1fb1e0ed70f318b8b6486b7
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 14:19:33 +0200
Fucking shell globs
c775ea906f42095dd1fb1e0ed70f318b8b6486b72016-08-22T12:18:37Z2016-08-22T12:18:37ZPut path,sha512 and timestamp in a buffer for sendingWillywillyatmailoodotorgcommit c775ea906f42095dd1fb1e0ed70f318b8b6486b7
parent b2f3ca3bc98416b32e22a2c5737f1e40bf94b707
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 14:18:37 +0200
Put path,sha512 and timestamp in a buffer for sending
b2f3ca3bc98416b32e22a2c5737f1e40bf94b7072016-08-22T12:17:22Z2016-08-22T12:17:22ZLoop infinitely in server modeWillywillyatmailoodotorgcommit b2f3ca3bc98416b32e22a2c5737f1e40bf94b707
parent 1eb5f4be1f3e0da4bd419889f40a99dc67cd2ac6
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 14:17:22 +0200
Loop infinitely in server mode
1eb5f4be1f3e0da4bd419889f40a99dc67cd2ac62016-08-22T12:16:15Z2016-08-22T12:16:15ZAdd function to format a sha512 hash as a base16 stringWillywillyatmailoodotorgcommit 1eb5f4be1f3e0da4bd419889f40a99dc67cd2ac6
parent 52315a137481905a33e482df08128ee85f90b6b5
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 14:16:15 +0200
Add function to format a sha512 hash as a base16 string
52315a137481905a33e482df08128ee85f90b6b52016-08-22T06:42:36Z2016-08-22T06:42:36ZMake client/server send sha512 digests for comparisonWillywillyatmailoodotorgcommit 52315a137481905a33e482df08128ee85f90b6b5
parent 8e9a6f6cd8321f42ac8d55456b1092ef7a61f191
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 08:42:36 +0200
Make client/server send sha512 digests for comparison
8e9a6f6cd8321f42ac8d55456b1092ef7a61f1912016-08-22T06:41:20Z2016-08-22T06:41:20ZFunction to compare hashesWillywillyatmailoodotorgcommit 8e9a6f6cd8321f42ac8d55456b1092ef7a61f191
parent e107f99cfc32c18f5c8902f461b70336973de2d5
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 08:41:20 +0200
Function to compare hashes
e107f99cfc32c18f5c8902f461b70336973de2d52016-08-22T06:24:00Z2016-08-22T06:24:56ZNew function to generate a stream's hashWillywillyatmailoodotorgcommit e107f99cfc32c18f5c8902f461b70336973de2d5
parent fcee4829b1e08b2e87a49f3c64a15108eceeba3a
Author: Willy <willyatmailoodotorg>
Date: Mon, 22 Aug 2016 08:24:00 +0200
New function to generate a stream's hash
fcee4829b1e08b2e87a49f3c64a15108eceeba3a2016-08-19T18:35:21Z2016-08-19T18:35:21ZFix up sha512 function for standalone useWillywillyatmailoodotorgcommit fcee4829b1e08b2e87a49f3c64a15108eceeba3a
parent 8aad91fb1540045a248744041212c426a34b589d
Author: Willy <willyatmailoodotorg>
Date: Fri, 19 Aug 2016 20:35:21 +0200
Fix up sha512 function for standalone use
8aad91fb1540045a248744041212c426a34b589d2016-08-18T21:15:22Z2016-08-18T21:15:44ZAdd sha512 functions from libtom.netWillywillyatmailoodotorgcommit 8aad91fb1540045a248744041212c426a34b589d
parent dcf66f769d632628259c687de8ad059e2a4ac2e6
Author: Willy <willyatmailoodotorg>
Date: Thu, 18 Aug 2016 23:15:22 +0200
Add sha512 functions from libtom.net
dcf66f769d632628259c687de8ad059e2a4ac2e62016-08-17T06:39:02Z2016-08-17T06:39:02ZCode cleanup/refactoringWillywillyatmailoodotorgcommit dcf66f769d632628259c687de8ad059e2a4ac2e6
parent 4c40d8e0cfbe7589ccd89c8e97f1cbf11a5844cf
Author: Willy <willyatmailoodotorg>
Date: Wed, 17 Aug 2016 08:39:02 +0200
Code cleanup/refactoring
4c40d8e0cfbe7589ccd89c8e97f1cbf11a5844cf2016-08-16T18:37:36Z2016-08-16T18:37:36ZFactorize timestamps retrievalWillywillyatmailoodotorgcommit 4c40d8e0cfbe7589ccd89c8e97f1cbf11a5844cf
parent b3dca9f5dc37c9e6190b5f6532ce9099b49ad2e7
Author: Willy <willyatmailoodotorg>
Date: Tue, 16 Aug 2016 20:37:36 +0200
Factorize timestamps retrieval
b3dca9f5dc37c9e6190b5f6532ce9099b49ad2e72016-08-16T18:36:27Z2016-08-16T18:36:27ZRemove dependency to pthreadsWillywillyatmailoodotorgcommit b3dca9f5dc37c9e6190b5f6532ce9099b49ad2e7
parent 01aea7ee2faa01002207932529972d3c491dfca1
Author: Willy <willyatmailoodotorg>
Date: Tue, 16 Aug 2016 20:36:27 +0200
Remove dependency to pthreads
01aea7ee2faa01002207932529972d3c491dfca12016-08-16T12:02:00Z2016-08-16T12:02:00ZMove client/server part into a single programWillywillyatmailoodotorgcommit 01aea7ee2faa01002207932529972d3c491dfca1
parent 78511ee61482c9fbf336fa601f841113a5544d1e
Author: Willy <willyatmailoodotorg>
Date: Tue, 16 Aug 2016 14:02:00 +0200
Move client/server part into a single program
78511ee61482c9fbf336fa601f841113a5544d1e2016-08-16T12:00:33Z2016-08-16T12:00:33Zsynkd: move server part into a functionWillywillyatmailoodotorgcommit 78511ee61482c9fbf336fa601f841113a5544d1e
parent e355d45e1f7b7db572874e8e0a5770470a42a0a6
Author: Willy <willyatmailoodotorg>
Date: Tue, 16 Aug 2016 14:00:33 +0200
synkd: move server part into a function
e355d45e1f7b7db572874e8e0a5770470a42a0a62016-08-16T06:48:11Z2016-08-16T06:48:11ZMoving client/server part into functionsWillywillyatmailoodotorgcommit e355d45e1f7b7db572874e8e0a5770470a42a0a6
parent d19f7b2d444e65f4d780ac3132968e432110ede9
Author: Willy <willyatmailoodotorg>
Date: Tue, 16 Aug 2016 08:48:11 +0200
Moving client/server part into functions