DAV backends: Limit server requests after getting online
The function eds/src/libedataserver/e-webdav-session.c:e_webdav_session_options_sync calls the OPTIONS method for an URL and extracts from the result the capabilities (=DAV) and ALLOW lines.
The function e_webdav_session_options_sync() is called from:
-
eds/src/addressbook/backends/carddav/e-book-backend-carddav.c:ebb_carddav_connect_sync() and uses ALLOW to extract the permissions, if e_webdav_session_get_current_user_privilege_set_sync() does not work. The capability result is used to extact whether the DAV: addressbook is present. My understanding is, that ebb_carddav_connet_sync() is called everytime evolution is started or goes online.
-
eds/src/calendar/backends/caldav/e-cal-backend-caldav.c:ecb_caldav_connect_sync(). The capability parametesr is used to check, whether the calendar-access and calendar-schedule are present in the DAV line. When e_webdav_session_get_current_user_privilege_set_sync() does not work, the ALLOWS line is used to determine the operations. My reading is, that this function is called anytime Evolutions is started or goes online.
-
eds/src/libedataserver/e-webdav-discover.c:e_webdav_discover_sources_full_sync() and checks the DAV line for calendar-auto-schedule. My reading is, that this called during account set up and the automatic refresh, which is anytime evolution goes online.
-
evolution/src/e-util/e-webdav-browser.c:webdav_browser_gather_href_resources_sync() called from webdav_browser_search_user_home_thread(), webdav_browser_search_children_thread() and webdav_browser_save_changes_thread().
What does DAV: calendar-schedule mean and who uses this?
Can the calls per URL for OPTIONS be limited to one? My server is overloaded, so I want to limit the aumont of calls.
E.g. if during discovery an URL is found to have DAV: calendar-auto-schedule, and the discovery (Refresh) is rerun any time Evolution goes online, then the calendar-access line can also be extracted during discovery and not rechecked every time evolution goes online. It is inconsistent, that some capabilities are checked in the dav/backends/ code and others in the discovery code.
ALLOWS does not depend on the authentication status, so there is rarely need to repeat inspecting it and there is no point to execute OPTIONS to extract the privileges, when these are obtained over e_webdav_session_get_current_user_privilege_set_sync().