summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0c818c9)
raw | patch | inline | side by side (parent: 0c818c9)
author | Lennart Poettering <lennart@poettering.net> | |
Sun, 2 Apr 2006 15:42:49 +0000 (15:42 +0000) | ||
committer | Lennart Poettering <lennart@poettering.net> | |
Sun, 2 Apr 2006 15:42:49 +0000 (15:42 +0000) |
src/Makefile.am | patch | blob | history | |
src/fusedav.c | patch | blob | history | |
src/openssl-thread.c | [deleted file] | patch | blob | history |
src/openssl-thread.h | [deleted file] | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index b74d7c0bb20d99a0c64ab6927c5fc482adf31aa5..b91759d862d73e5cb51a16a660a394ab92fec3b4 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
fusedav_SOURCES=fusedav.c fusedav.h \
statcache.c statcache.h \
filecache.c filecache.h \
- session.c session.h \
- openssl-thread.c openssl-thread.h
+ session.c session.h
fusedav_CFLAGS = $(AM_CFLAGS) $(NEON_CFLAGS) $(FUSE_CFLAGS) -DFUSE_USE_VERSION=25
fusedav_LDADD = -lpthread $(NEON_LIBS) $(FUSE_LIBS)
diff --git a/src/fusedav.c b/src/fusedav.c
index 2d04c51ad779448e910416cbca68d0ba4205c604..a0723b17f8d2259742090eed4c9b8ed7333dda52 100644 (file)
--- a/src/fusedav.c
+++ b/src/fusedav.c
#include "statcache.h"
#include "filecache.h"
#include "session.h"
-#include "openssl-thread.h"
#include "fusedav.h"
const ne_propname query_properties[] = {
goto finish;
}
- openssl_thread_setup();
-
+ if (!ne_has_support(NE_FEATURE_SSL) ||
+ !ne_has_support(NE_FEATURE_TS_SSL) ||
+ !ne_has_support(NE_FEATURE_LFS)) {
+ fprintf(stderr, "fusedav requires libneon built with SSL, SSL thread safety and LFS enabled.\n");
+ goto finish;
+ }
+
mask = umask(0);
umask(mask);
file_cache_close_all();
cache_free();
session_free();
- openssl_thread_cleanup();
return ret;
}
diff --git a/src/openssl-thread.c b/src/openssl-thread.c
--- a/src/openssl-thread.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* $Id$ */
-
-/***
- This file is part of fusedav.
-
- fusedav is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- fusedav is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
-
- You should have received a copy of the GNU General Public License
- along with fusedav; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pthread.h>
-#include <openssl/crypto.h>
-
-#include "fusedav.h"
-#include "openssl-thread.h"
-
-static pthread_mutex_t *mutexes;
-
-static void pthreads_locking_callback(int mode, int n, __unused const char *file, __unused int line) {
- if (mode & CRYPTO_LOCK)
- pthread_mutex_lock(mutexes+n);
- else
- pthread_mutex_unlock(mutexes+n);
-}
-
-static unsigned long pthreads_thread_id(void) {
- return (unsigned long) pthread_self();
-}
-
-void openssl_thread_setup(void) {
- int i, l;
-
- mutexes = OPENSSL_malloc((l = CRYPTO_num_locks()) * sizeof(pthread_mutex_t));
-
- for (i = 0; i < l; i++)
- pthread_mutex_init(mutexes+i, NULL);
-
- CRYPTO_set_id_callback(pthreads_thread_id);
- CRYPTO_set_locking_callback(pthreads_locking_callback);
-}
-
-void openssl_thread_cleanup(void) {
- int i, l;
-
- CRYPTO_set_locking_callback(NULL);
-
- l = CRYPTO_num_locks();
- for (i = 0; i < l; i++)
- pthread_mutex_destroy(mutexes+i);
-
- OPENSSL_free(mutexes);
-}
-
diff --git a/src/openssl-thread.h b/src/openssl-thread.h
--- a/src/openssl-thread.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef fooopensslhfoo
-#define fooopensslhfoo
-
-/* $Id$ */
-
-/***
- This file is part of fusedav.
-
- fusedav is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- fusedav is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
-
- You should have received a copy of the GNU General Public License
- along with fusedav; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-***/
-
-void openssl_thread_setup(void);
-void openssl_thread_cleanup(void);
-
-#endif