msvc types tweaks.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1416 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
87152f99ed
commit
ead82d86fd
|
@ -184,7 +184,7 @@ SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *sea
|
|||
SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len);
|
||||
|
||||
#define SWITCH_READ_ACCEPTABLE(status) status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK
|
||||
SWITCH_DECLARE(int) switch_url_encode(char *url, char *buf, size_t len);
|
||||
SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
|
||||
SWITCH_DECLARE(char *) switch_url_decode(char *s);
|
||||
END_EXTERN_C
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
*/
|
||||
#include <switch.h>
|
||||
#include <xmlrpc-c/base.h>
|
||||
#ifdef ABYSS_WIN32
|
||||
#undef strcasecmp
|
||||
#endif
|
||||
#include <xmlrpc-c/abyss.h>
|
||||
#include <xmlrpc-c/server.h>
|
||||
#include <xmlrpc-c/server_abyss.h>
|
||||
|
@ -43,7 +46,7 @@ static const char modname[] = "mod_xml_rpc";
|
|||
|
||||
|
||||
static struct {
|
||||
int port;
|
||||
uint16_t port;
|
||||
uint8_t running;
|
||||
char *url;
|
||||
} globals;
|
||||
|
@ -78,7 +81,7 @@ static switch_xml_t xml_url_fetch(char *section,
|
|||
|
||||
snprintf(url, sizeof(url), "%s?section=%s&tag_name=%s&key_name=%s&key_value=%s%s%s\n",
|
||||
globals.url, section, tag_name, key_name, key_value, params ? "&" : "", params ? params : "");
|
||||
srand(time(NULL) + strlen(url));
|
||||
srand((unsigned int)(time(NULL) + strlen(url)));
|
||||
snprintf(filename, sizeof(filename), "%s%04x.tmp", SWITCH_GLOBAL_dirs.temp_dir, (rand() & 0xffff));
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl_handle = curl_easy_init();
|
||||
|
@ -142,7 +145,7 @@ static switch_status_t do_config(void)
|
|||
if (!strcasecmp(var, "gateway_url")) {
|
||||
set_global_url(val);
|
||||
} else if (!strcasecmp(var, "http_port")) {
|
||||
globals.port = atoi(val);
|
||||
globals.port = (uint16_t)atoi(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +196,7 @@ static switch_status_t http_stream_write(switch_stream_handle_t *handle, char *f
|
|||
|
||||
if (data) {
|
||||
ret = 0;
|
||||
HTTPWrite(r, data, strlen(data));
|
||||
HTTPWrite(r, data, (uint32_t)strlen(data));
|
||||
free(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle
|
|||
va_end(ap);
|
||||
|
||||
if (data) {
|
||||
uint32_t len = handle->data_size - handle->data_len;
|
||||
switch_size_t len = handle->data_size - handle->data_len;
|
||||
|
||||
if (len <= strlen(data)) {
|
||||
ret = -1;
|
||||
|
@ -65,7 +65,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle
|
|||
ret = 0;
|
||||
snprintf(end, len, data);
|
||||
handle->data_len = strlen(buf);
|
||||
handle->end = handle->data + handle->data_len;
|
||||
handle->end = (uint8_t *)(handle->data) + handle->data_len;
|
||||
}
|
||||
free(data);
|
||||
}
|
||||
|
|
|
@ -213,10 +213,10 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms)
|
|||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(int) switch_url_encode(char *url, char *buf, size_t len)
|
||||
SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len)
|
||||
{
|
||||
char *p;
|
||||
int x = 0;
|
||||
size_t x = 0;
|
||||
const char urlunsafe[] = " \"#%&+:;<=>?@[\\]^`{|}";
|
||||
const char hex[] = "0123456789ABCDEF";
|
||||
|
||||
|
@ -246,7 +246,7 @@ SWITCH_DECLARE(char *) switch_url_decode(char *s)
|
|||
|
||||
for (o = s; *s; s++, o++) {
|
||||
if (*s == '%' && strlen(s) > 2 && sscanf(s + 1, "%2x", &tmp) == 1) {
|
||||
*o = tmp;
|
||||
*o = (char)tmp;
|
||||
s += 2;
|
||||
} else {
|
||||
*o = *s;
|
||||
|
|
Loading…
Reference in New Issue