catalinux / rgfs (public) (License: GPLv3) (since 2020-11-11) (hash sha1)
Allows mapping of RocketGit storage area into a local directory
List of commits:
Subject Hash Author Date (UTC)
More debugging 44259f8be40bc2aa8220ed1f76d51e3f54ea5595 Catalin(ux) M. BOIE 2021-10-24 08:30:33
spec: replaced usrbindir with bindir c34fbb313f831714894e528a483db700cdac4e5b Catalin(ux) M. BOIE 2021-10-21 16:38:26
Removed Changelog file from spec because it will not be generated when the rpm is 9dcc332cc2c2c737ec75a86ea620bdcc057c8087 Catalin(ux) M. BOIE 2021-10-21 16:34:15
duilder fixes 6cd9e85084a5989a13fcda3c4d18677df997d423 Catalin(ux) M. BOIE 2021-10-21 15:57:44
Cosmetic 720c239954a7b4bb69dee90993aac588f0e6436a Catalin(ux) M. BOIE 2021-10-21 15:16:35
Sometimes we incorrectly returned 0 instead of the error 8bab245be8f6e2026162d9f7fccf27053f47626e Catalin(ux) M. BOIE 2021-03-29 06:27:54
Do not reconnect if server closed the connection gracefully a06c7349c2bdcedf01e5c54d8e05d3a08c8164b1 Catalin(ux) M. BOIE 2021-02-26 07:51:33
Raised the buffer for readdir 8e9eca1d99e23588c6912db1e122e1846d2f6d29 Catalin(ux) M. BOIE 2021-02-08 05:33:16
Simplify a little bit how code looks (mostly cosmetic) 39a144be4687167a8fbd876b874b276fd079cccd Catalin(ux) M. BOIE 2021-02-02 16:43:40
Do not send not useful variables bf2db44bf15cca4570440ee2eb551d9da7ef8290 Catalin(ux) M. BOIE 2021-02-02 16:35:00
Use RGFS_* environemnt to pass variables to the server 34fad328e3b424d4e50549dd30060e2150a05b07 Catalin(ux) M. BOIE 2021-02-02 16:08:39
Send env variable ce941b5564cb7601d6930b32688f083e22bbb67c Catalin(ux) M. BOIE 2021-01-30 10:51:31
Prevent a fd leak e439ecaf5fde8a53c969eadc3b32ec4558e16406 Catalin(ux) M. BOIE 2021-01-19 06:40:17
More debug b95edceb2abff793c9d2a19d62b6c1de8aa328bb Catalin(ux) M. BOIE 2021-01-16 11:53:51
Send first the name and after that the version b68e3cb967aa6a3edf5b64ac9b66c6fa67a1f990 Catalin(ux) M. BOIE 2021-01-16 10:21:57
Simplified variables sent 0f37c2cd6342c8be0f4615c8fe8979d1bb9cce8d Catalin(ux) M. BOIE 2021-01-14 04:48:11
Added job_id variable 9ab34e796d0f5494d97d1b9f9fff52e6a9f27e8c Catalin(ux) M. BOIE 2020-12-04 17:30:10
Create a function to send generic vars and use it 97fa7f7a9f4af7c9e7bf3579d1437dfc59c29825 Catalin(ux) M. BOIE 2020-11-30 17:45:17
Wrong lenght passed c642d9387496543f4fb824fad6cd2590328d83b4 Catalin(ux) M. BOIE 2020-11-30 17:33:08
Allow sending repo_id 160f9d2f3957ba5639377e8d5bdc15744dac78a2 Catalin(ux) M. BOIE 2020-11-30 13:36:55
Commit 44259f8be40bc2aa8220ed1f76d51e3f54ea5595 - More debugging
Author: Catalin(ux) M. BOIE
Author date (UTC): 2021-10-24 08:30
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2021-10-24 08:30
Parent(s): c34fbb313f831714894e528a483db700cdac4e5b
Signer:
Signing key:
Signing status: N
Tree: 0737c382b6c7db51235fbe49172c99de669465f4
File Lines added Lines deleted
rgfs.c 14 12
File rgfs.c changed (mode: 100644) (index 065c688..b93d051)
... ... static int rgfs_recv_hl(const char *op, void *buf, size_t buf_size)
425 425 return off; return off;
426 426
427 427 off += r; off += r;
428 if (off >= 4) {
428 if ((to_read == 0) && (off >= 4)) {
429 429 to_read = be32toh(*(uint32_t *) buf); to_read = be32toh(*(uint32_t *) buf);
430 430 xlog("to_read=%u\n", to_read); xlog("to_read=%u\n", to_read);
431 431 } }
432 432
433 433 if (rgfs_debug > 10) { if (rgfs_debug > 10) {
434 434 char debug[4096 * 2 + 1]; char debug[4096 * 2 + 1];
435 uint16_t max = off > 4096 ? 4096 : off;
435 uint16_t max = r > 4096 ? 4096 : r;
436 436 for (uint16_t i = 0; i < max; i++) for (uint16_t i = 0; i < max; i++)
437 sprintf(debug + i * 2, "%02hhx", * (unsigned char *) (buf + i));
438 xlog(" %s: RECV %u: %s\n", op, off, debug);
437 sprintf(debug + i * 2, "%02hhx",
438 * (unsigned char *) (buf + off - r + i));
439 xlog(" %s: RECV now=%d total=%u: now: %s\n",
440 op, r, off, debug);
439 441 } }
440 442
441 443 if (off == 4 + to_read) { if (off == 4 + to_read) {
442 xlog(" Readed 4 + %u\n", to_read);
444 xlog(" Readed 4 + %u; return %lu\n", to_read, off);
443 445 return off; return off;
444 446 } }
445 447 } }
 
... ... static int rgfs_fuse_read(const char *path, char *out, size_t size,
597 599 off_t offset, struct fuse_file_info *fi) off_t offset, struct fuse_file_info *fi)
598 600 { {
599 601 int r, err = 0, i; int r, err = 0, i;
600 unsigned char buf[16 * 4096], cmd;
602 unsigned char buf[16 * 4096], cmd; // TODO: size is 65536, so, just use size + 1 + 4
601 603 uint16_t path_len, len; uint16_t path_len, len;
602 604 uint64_t u64; uint64_t u64;
603 605
 
... ... static int rgfs_fuse_read(const char *path, char *out, size_t size,
606 608 path, size, offset); path, size, offset);
607 609
608 610 // Limit how much data we request to the server // Limit how much data we request to the server
609 // 1 + 4 + 8 is the answer's header.
610 if (size > sizeof(buf) - 1 - 4)
611 size = sizeof(buf) - 1 - 4;
611 // 4 + 1 is the answer's header.
612 if (size > sizeof(buf) - 4 - 1) {
613 size = sizeof(buf) - 4 - 1;
614 xlog(" truncated size to %zu\n", size);
615 }
612 616
613 617 path_len = strlen(path); path_len = strlen(path);
614 618 len = 1 + 2 + 8 + 8; len = 1 + 2 + 8 + 8;
 
... ... static int rgfs_fuse_read(const char *path, char *out, size_t size,
634 638 switch (cmd) { switch (cmd) {
635 639 case 0x00: err = - be32toh(*(uint32_t *) (buf + i)); break; case 0x00: err = - be32toh(*(uint32_t *) (buf + i)); break;
636 640 case 0x01: /* block */ case 0x01: /* block */
637 xlog(" received %llu bytes block\n", r - i);
638 641 memcpy(out, buf + i, r - i); memcpy(out, buf + i, r - i);
639 642 err = r - i; err = r - i;
640 643 break; break;
 
... ... static int rgfs_fuse_read(const char *path, char *out, size_t size,
642 645 } }
643 646 } }
644 647
645 if (err < 0)
646 xlog(" server returned error %d!\n", err);
648 xlog(" returning %d\n", err);
647 649
648 650 return err; return err;
649 651 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rgfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rgfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rgfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main