Skip to content

Commit

Permalink
OS X: Yosemite fix for neon
Browse files Browse the repository at this point in the history
For #2627
  • Loading branch information
guruz committed Jan 9, 2015
1 parent f9b98d6 commit faf5c2c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions csync/src/csync_owncloud.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

#include "csync_private.h"

#ifdef __APPLE__
#include <dlfcn.h>
#endif

/*
* helper method to build up a user text for SSL problems, called from the
Expand Down Expand Up @@ -420,7 +423,24 @@ static int dav_connect(csync_owncloud_ctx_t *ctx, const char *base_url) {
port = ne_uri_defaultport(protocol);
}

#ifdef __APPLE__
/* See #2627 */
DEBUG_WEBDAV("* ne_session=%p", ne_session_create);
void *l = dlopen("libneon.27.dylib", RTLD_NOLOAD);
DEBUG_WEBDAV("* libneon.27.dylib=%p", l);
ne_session* (*p)(char*, char*, int) = dlsym(l, "ne_session_create");
DEBUG_WEBDAV("* p=%p", p);
if (!p) {
DEBUG_WEBDAV("* Cannot find ne_session_create or libneon.27.dylib! FAILURE");
rc = -1;
goto out;
}
ctx->dav_session.ctx = p( protocol, host, port);
dlclose(l);
#else
ctx->dav_session.ctx = ne_session_create( protocol, host, port);
#endif


if (ctx->dav_session.ctx == NULL) {
DEBUG_WEBDAV("Session create with protocol %s failed", protocol );
Expand Down

0 comments on commit faf5c2c

Please sign in to comment.