Add option sharepoint_href_bug

This commit is contained in:
wbaumann
2020-06-05 09:50:07 +00:00
parent 533efb2e8a
commit 97768ff55b
10 changed files with 260 additions and 220 deletions

View File

@ -208,6 +208,10 @@
May be overridden by system config file and user config file. */
#define DAV_MIN_PROPSET 0
/* Use Neon work around for SharePoint href-elements with characters
that are not allowed in href-elements. */
#define DAV_SHAREPOINT_HREF_BUG 0
/* Timeout in seconds used when libneon supports non blocking io
A value of zero means use the TCP default
May be overriden by system config file and user config file. */

View File

@ -1722,6 +1722,7 @@ new_args(void)
args->ignore_dav_header = DAV_IGNORE_DAV_HEADER;
args->use_compression = DAV_USE_COMPRESSION;
args->min_propset = DAV_MIN_PROPSET;
args->sharepoint_href_bug = DAV_SHAREPOINT_HREF_BUG;
args->connect_timeout = DAV_CONNECT_TIMEOUT;
args->read_timeout = DAV_READ_TIMEOUT;
args->retry = DAV_RETRY;
@ -2228,6 +2229,13 @@ read_config(dav_args *args, const char * filename, int system)
args->use_compression = arg_to_int(parmv[1], 10, parmv[0]);
} else if (strcmp(parmv[0], "min_propset") == 0) {
args->min_propset = arg_to_int(parmv[1], 10, parmv[0]);
} else if (strcmp(parmv[0], "sharepoint_href_bug") == 0) {
#if NE_VERSION_MAJOR > 0 || NE_VERSION_MINOR > 30
args->sharepoint_href_bug = arg_to_int(parmv[1], 10, parmv[0]);
#else
error(EXIT_FAILURE, 0, _("Option sharepoint_href_bug requires "
"Neon version 0.31 or newer"));
#endif
} else if (strcmp(parmv[0], "connect_timeout") == 0) {
args->connect_timeout = arg_to_int(parmv[1], 10, parmv[0]);
} else if (strcmp(parmv[0], "read_timeout") == 0) {

View File

@ -94,6 +94,7 @@ typedef struct {
int ignore_dav_header; /* User config file, system config file */
int use_compression; /* User config file, system config file */
int min_propset; /* User config file, system config file */
int sharepoint_href_bug; /* User config file, system config file */
time_t connect_timeout; /* User config file, system config file */
time_t read_timeout; /* User config file, system config file */
time_t retry; /* User config file, system config file */

View File

@ -379,6 +379,11 @@ dav_init_webdav(dav_args *args)
ne_set_useragent(session, useragent);
free(useragent);
#if NE_VERSION_MAJOR > 0 || NE_VERSION_MINOR > 30
if (args->sharepoint_href_bug)
ne_set_session_flag(session, NE_SESSFLAG_SHAREPOINT, 1);
#endif
if (args->username)
username = xstrdup(args->username);
if (args->password)