curlftpfs: add Fedora patches for some bugfixes.

This commit is contained in:
Juan RP 2013-09-23 23:27:45 +02:00
parent 6886290c8c
commit ae03e33ce8
5 changed files with 115 additions and 1 deletions

View File

@ -0,0 +1,32 @@
--- ftpfs.c 2013-05-12 14:31:57.000000000 +0400
+++ ftpfs.c 2013-05-12 14:29:00.906721322 +0400
@@ -759,13 +759,13 @@
err = -ENOTSUP;
}
- if ((fi->flags & O_EXCL))
- {
- DEBUG(1, "opening %s with O_EXCL - testing existence\n", path);
- int exists_r = test_exists(path);
- if (exists_r != -ENOENT)
- err = -EACCES;
- }
+// if ((fi->flags & O_EXCL))
+// {
+// DEBUG(1, "opening %s with O_EXCL - testing existence\n", path);
+// int exists_r = test_exists(path);
+// if (exists_r != -ENOENT)
+// err = -EACCES;
+// }
if (!err)
{
@@ -816,6 +816,8 @@
#if FUSE_VERSION >= 25
static int ftpfs_create(const char* path, mode_t mode,
struct fuse_file_info* fi) {
+// return ftpfs_open_common(path, mode, fi);
+ ftpfs_mknod(path, mode, NULL);
return ftpfs_open_common(path, mode, fi);
}
#endif

View File

@ -0,0 +1,11 @@
--- ftpfs.c
+++ ftpfs.c
@@ -615,6 +615,8 @@ static void free_ftpfs_file(struct ftpfs
sem_destroy(&fh->data_need);
sem_destroy(&fh->data_written);
sem_destroy(&fh->ready);
+ if (fh->buf.size) { buf_free(&fh->buf); }
+ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); }
free(fh);
}

View File

@ -0,0 +1,53 @@
--- cache.c
+++ cache.c
@@ -25,7 +25,7 @@ struct cache {
time_t last_cleaned;
};
-static struct cache cache;
+struct cache cache;
struct node {
struct stat stat;
--- ftpfs-ls.c
+++ ftpfs-ls.c
@@ -25,6 +25,13 @@
#include "charset_utils.h"
#include "ftpfs-ls.h"
+struct cache {
+ int on;
+ char incomplete[];
+};
+
+extern struct cache cache;
+
static int parse_dir_unix(const char *line,
struct stat *sbuf,
char *file,
@@ -243,8 +250,10 @@ int parse_dir(const char* list, const ch
reallink = g_strdup(link);
}
int linksize = strlen(reallink);
- cache_add_link(full_path, reallink, linksize+1);
- DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ if (cache.on) {
+ cache_add_link(full_path, reallink, linksize+1);
+ DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
+ }
if (linkbuf && linklen) {
if (linksize > linklen) linksize = linklen - 1;
strncpy(linkbuf, reallink, linksize);
@@ -257,8 +266,10 @@ int parse_dir(const char* list, const ch
DEBUG(1, "filler: %s\n", file);
filler(h, file, &stat_buf);
} else {
- DEBUG(1, "cache_add_attr: %s\n", full_path);
- cache_add_attr(full_path, &stat_buf);
+ if (cache.on) {
+ DEBUG(1, "cache_add_attr: %s\n", full_path);
+ cache_add_attr(full_path, &stat_buf);
+ }
}
DEBUG(2, "comparing %s %s\n", name, file);

View File

@ -0,0 +1,18 @@
--- ftpfs.c
+++ ftpfs.c
@@ -503,7 +503,6 @@ static void *ftpfs_write_thread(void *da
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1);
- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READDATA, fh);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_LOW_SPEED_LIMIT, 1);
@@ -645,7 +645,6 @@ static int create_empty_file(const char
pthread_mutex_lock(&ftpfs.lock);
cancel_previous_multi();
curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_INFILESIZE, 0);
curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_UPLOAD, 1);
curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_READDATA, NULL);
CURLcode curl_res = curl_easy_perform(ftpfs.connection);

View File

@ -1,7 +1,7 @@
# Template file for 'curlftpfs'
pkgname=curlftpfs
version=0.9.2
revision=2
revision=3
build_style=gnu-configure
configure_args="ac_cv_func_working_mktime=yes ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes ac_cv_func_chown_works=yes"