Use identical User Agents for csync and the Qt parts

Also, use the mirall version for ocsync.

Currently, the csync engine part and the Qt part have different UAs,
and this makes debugging (i.e. reading access logs) difficult. On
top, we haven't increased the ocsync version number in ages. So
as a consequence, I think it would be the best to have ocsync
and the rest share the same version number, and make them identify
with the same user agent.

To ease debugging for our side, we'll still append "(csyncoC)"
for calls made by csync.
This commit is contained in:
Daniel Molkentin 2015-04-16 20:56:00 +02:00
parent c3dca7a288
commit d8275cd4e1
4 changed files with 6 additions and 27 deletions

View file

@ -3,13 +3,7 @@
# global needed variables # global needed variables
set(APPLICATION_NAME "ocsync") set(APPLICATION_NAME "ocsync")
set(APPLICATION_VERSION_MAJOR "0") set(LIBRARY_VERSION ${MIRALL_VERSION})
set(APPLICATION_VERSION_MINOR "91")
set(APPLICATION_VERSION_PATCH "5")
set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}")
set(LIBRARY_VERSION "0.2.1")
set(LIBRARY_SOVERSION "0") set(LIBRARY_SOVERSION "0")
# add definitions # add definitions

View file

@ -40,8 +40,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <config_csync.h> #include <config_csync.h>
#include "csync_version.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View file

@ -26,6 +26,8 @@
#include "csync_private.h" #include "csync_private.h"
#include "csync_version.h"
/* /*
* helper method to build up a user text for SSL problems, called from the * helper method to build up a user text for SSL problems, called from the
@ -437,8 +439,8 @@ int dav_connect(CSYNC *csyncCtx, const char *base_url) {
// Should never take more than some seconds, 30 is really a max. // Should never take more than some seconds, 30 is really a max.
ne_set_connect_timeout(ctx->dav_session.ctx, 30); ne_set_connect_timeout(ctx->dav_session.ctx, 30);
snprintf( uaBuf, sizeof(uaBuf), "Mozilla/5.0 (%s) csyncoC/%s", snprintf( uaBuf, sizeof(uaBuf), "Mozilla/5.0 (%s) mirall/%s (csyncoC)",
csync_owncloud_get_platform(), CSYNC_STRINGIFY( LIBCSYNC_VERSION )); CSYNC_STRINGIFY( MIRALL_VERSION ), csync_owncloud_get_platform() );
ne_set_useragent( ctx->dav_session.ctx, uaBuf); ne_set_useragent( ctx->dav_session.ctx, uaBuf);
ne_set_server_auth(ctx->dav_session.ctx, authentication_callback_by_neon, ctx); ne_set_server_auth(ctx->dav_session.ctx, authentication_callback_by_neon, ctx);

View file

@ -28,22 +28,7 @@ extern "C" {
#define CSYNC_STRINGIFY(s) CSYNC_TOSTRING(s) #define CSYNC_STRINGIFY(s) CSYNC_TOSTRING(s)
#define CSYNC_TOSTRING(s) #s #define CSYNC_TOSTRING(s) #s
/* csync version macros */ #define MIRALL_VERSION @MIRALL_VERSION@
#define CSYNC_VERSION_INT(a, b, c) ((a) << 16 | (b) << 8 | (c))
#define CSYNC_VERSION_DOT(a, b, c) a ##.## b ##.## c
#define CSYNC_VERSION(a, b, c) CSYNC_VERSION_DOT(a, b, c)
/* csync version */
#define LIBCSYNC_VERSION_MAJOR @APPLICATION_VERSION_MAJOR@
#define LIBCSYNC_VERSION_MINOR @APPLICATION_VERSION_MINOR@
#define LIBCSYNC_VERSION_MICRO @APPLICATION_VERSION_PATCH@
#define LIBCSYNC_VERSION_INT CSYNC_VERSION_INT(LIBCSYNC_VERSION_MAJOR, \
LIBCSYNC_VERSION_MINOR, \
LIBCSYNC_VERSION_MICRO)
#define LIBCSYNC_VERSION CSYNC_VERSION(LIBCSYNC_VERSION_MAJOR, \
LIBCSYNC_VERSION_MINOR, \
LIBCSYNC_VERSION_MICRO)
#ifdef __cplusplus #ifdef __cplusplus
} }