Browse Source

cosmetical changes

Vaclav Kubart 19 years ago
parent
commit
607ef9964c
3 changed files with 13 additions and 4 deletions
  1. 2 0
      lib/cds/sstr.h
  2. 2 1
      lib/presence/notifier_domain.c
  3. 9 3
      lib/xcap/xcap_client.c

+ 2 - 0
lib/cds/sstr.h

@@ -45,6 +45,8 @@ typedef struct {
 	int len;
 } str_t;
 
+#define STR_STATIC_INIT(v) {(v), sizeof(v) - 1}
+
 #endif
 
 #define FMT_STR(str)	(str).len,((str).s ? (str).s : "")	

+ 2 - 1
lib/presence/notifier_domain.c

@@ -32,6 +32,7 @@
 #include <presence/subscriber.h>
 #include <cds/list.h>
 #include <cds/cds.h>
+#include <string.h>
 
 /*#define lock_subscription_data(s) if (s->mutex) cds_mutex_lock(s->mutex);
 #define unlock_subscription_data(s) if (s->mutex) cds_mutex_unlock(s->mutex);*/
@@ -552,7 +553,7 @@ void free_client_notify_info_content(client_notify_info_t *info)
 	if (info->content_type) {
 		if (info->data) info->content_type->destroy_func(info->data);
 	}
-	else ERR("BUG: content-type not given! Possible memory leaks!\n");
+	else ERROR_LOG("BUG: content-type not given! Possible memory leaks!\n");
 }
 
 /* this can be called in notifier and the returned value is valid

+ 9 - 3
lib/xcap/xcap_client.c

@@ -200,7 +200,7 @@ static size_t write_data_func(void *ptr, size_t size, size_t nmemb, void *stream
 }
 
 
-int xcap_query(const str_t *uri, xcap_query_params_t *params, char **buf, int *bsize)
+int xcap_query(const char *uri, xcap_query_params_t *params, char **buf, int *bsize)
 {
 	CURLcode res = -1;
 	static CURL *handle = NULL;
@@ -209,8 +209,14 @@ int xcap_query(const str_t *uri, xcap_query_params_t *params, char **buf, int *b
 	int i;
 	long auth_methods;
 	
-	if (!uri) return -1;
-	if (!buf) return -1;
+	if (!uri) {
+		ERROR_LOG("BUG: no uri given\n");
+		return -1;
+	}
+	if (!buf) {
+		ERROR_LOG("BUG: no buf given\n");
+		return -1;
+	}
 
 	i = 0;
 	if (params) {