提交 acdf1d93 authored 作者: Shane Bryldt's avatar Shane Bryldt

FS-10167: Updates to make stuff compile under linux again

上级 5d682abd
...@@ -15,7 +15,7 @@ libblade_la_SOURCES = src/blade.c src/blade_stack.c ...@@ -15,7 +15,7 @@ libblade_la_SOURCES = src/blade.c src/blade_stack.c
libblade_la_SOURCES += src/blade_datastore.c libblade_la_SOURCES += src/blade_datastore.c
libblade_la_SOURCES += src/blade_identity.c src/blade_module.c src/blade_connection.c libblade_la_SOURCES += src/blade_identity.c src/blade_module.c src/blade_connection.c
libblade_la_SOURCES += src/blade_session.c src/blade_protocol.c src/blade_space.c src/blade_method.c libblade_la_SOURCES += src/blade_session.c src/blade_protocol.c src/blade_space.c src/blade_method.c
libblade_la_SOURCES += src/blade_module_wss.c src/blade_module_chat.c libblade_la_SOURCES += src/blade_module_wss.c
libblade_la_SOURCES += src/dht/ks_dht.c src/dht/ks_dht_datagram.c src/dht/ks_dht_endpoint.c src/dht/ks_dht_message.c src/dht/ks_dht_transaction.c libblade_la_SOURCES += src/dht/ks_dht.c src/dht/ks_dht_datagram.c src/dht/ks_dht_endpoint.c src/dht/ks_dht_message.c src/dht/ks_dht_transaction.c
libblade_la_SOURCES += src/dht/ks_dht_job.c src/dht/ks_dht_search.c src/dht/ks_dht_publish.c src/dht/ks_dht_distribute.c src/dht/ks_dht_storageitem.c libblade_la_SOURCES += src/dht/ks_dht_job.c src/dht/ks_dht_search.c src/dht/ks_dht_publish.c src/dht/ks_dht_distribute.c src/dht/ks_dht_storageitem.c
libblade_la_SOURCES += src/dht/ks_dht_bucket.c src/ks_bencode.c libblade_la_SOURCES += src/dht/ks_dht_bucket.c src/ks_bencode.c
...@@ -29,6 +29,7 @@ library_include_HEADERS = src/include/blade.h src/include/blade_types.h src/incl ...@@ -29,6 +29,7 @@ library_include_HEADERS = src/include/blade.h src/include/blade_types.h src/incl
library_include_HEADERS += src/include/blade_datastore.h library_include_HEADERS += src/include/blade_datastore.h
library_include_HEADERS += src/include/blade_identity.h src/include/blade_module.h src/include/blade_connection.h library_include_HEADERS += src/include/blade_identity.h src/include/blade_module.h src/include/blade_connection.h
library_include_HEADERS += src/include/blade_session.h src/include/blade_protocol.h src/include/blade_space.h src/include/blade_method.h library_include_HEADERS += src/include/blade_session.h src/include/blade_protocol.h src/include/blade_space.h src/include/blade_method.h
library_include_HEADERS += src/include/blade_module_wss.h
library_include_HEADERS += src/include/unqlite.h test/tap.h library_include_HEADERS += src/include/unqlite.h test/tap.h
library_include_HEADERS += src/include/ks_dht.h src/include/ks_bencode.h library_include_HEADERS += src/include/ks_dht.h src/include/ks_bencode.h
......
...@@ -36,8 +36,6 @@ int main(int argc, char **argv) ...@@ -36,8 +36,6 @@ int main(int argc, char **argv)
blade_handle_t *bh = NULL; blade_handle_t *bh = NULL;
config_t config; config_t config;
config_setting_t *config_blade = NULL; config_setting_t *config_blade = NULL;
blade_module_t *mod_wss = NULL;
blade_identity_t *id = NULL;
const char *cfgpath = "bladec.cfg"; const char *cfgpath = "bladec.cfg";
const char *session_state_callback_id = NULL; const char *session_state_callback_id = NULL;
......
...@@ -60,7 +60,6 @@ int main(int argc, char **argv) ...@@ -60,7 +60,6 @@ int main(int argc, char **argv)
blade_handle_t *bh = NULL; blade_handle_t *bh = NULL;
config_t config; config_t config;
config_setting_t *config_blade = NULL; config_setting_t *config_blade = NULL;
blade_module_t *mod_wss = NULL;
blade_module_t *mod_chat = NULL; blade_module_t *mod_chat = NULL;
//blade_identity_t *id = NULL; //blade_identity_t *id = NULL;
const char *cfgpath = "blades.cfg"; const char *cfgpath = "blades.cfg";
......
...@@ -11,7 +11,7 @@ int main(void) ...@@ -11,7 +11,7 @@ int main(void)
plan(1); plan(1);
status = blade_handle_create(&bh, NULL, NULL); status = blade_handle_create(&bh);
status = blade_handle_destroy(&bh); status = blade_handle_destroy(&bh);
ok(status == KS_STATUS_SUCCESS); ok(status == KS_STATUS_SUCCESS);
......
/* /*
* Copyright (c) 2007-2014, Anthony Minessale II * Copyright (c) 2007-2014, Anthony Minessale II
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* * Neither the name of the original author; nor the names of any contributors * * Neither the name of the original author; nor the names of any contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
...@@ -57,7 +57,7 @@ KS_DECLARE(void) ks_ssl_init_ssl_locks(void) ...@@ -57,7 +57,7 @@ KS_DECLARE(void) ks_ssl_init_ssl_locks(void)
{ {
int i, num; int i, num;
if (is_init) return; if (is_init) return;
is_init = 1; is_init = 1;
...@@ -66,7 +66,7 @@ KS_DECLARE(void) ks_ssl_init_ssl_locks(void) ...@@ -66,7 +66,7 @@ KS_DECLARE(void) ks_ssl_init_ssl_locks(void)
if (ssl_count == 0) { if (ssl_count == 0) {
num = CRYPTO_num_locks(); num = CRYPTO_num_locks();
ssl_mutexes = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(ks_mutex_t*)); ssl_mutexes = OPENSSL_malloc(CRYPTO_num_locks() * sizeof(ks_mutex_t*));
ks_assert(ssl_mutexes != NULL); ks_assert(ssl_mutexes != NULL);
...@@ -105,7 +105,9 @@ KS_DECLARE(void) ks_ssl_destroy_ssl_locks(void) ...@@ -105,7 +105,9 @@ KS_DECLARE(void) ks_ssl_destroy_ssl_locks(void)
if (ssl_pool) ks_pool_close(&ssl_pool); if (ssl_pool) ks_pool_close(&ssl_pool);
} }
#ifdef _WINDOWS
SSL_COMP_free_compression_methods(); SSL_COMP_free_compression_methods();
#endif
EVP_cleanup(); EVP_cleanup();
} }
...@@ -130,9 +132,9 @@ KS_DECLARE(int) ks_gen_cert(const char *dir, const char *file) ...@@ -130,9 +132,9 @@ KS_DECLARE(int) ks_gen_cert(const char *dir, const char *file)
} }
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
//bio_err=BIO_new_fp(stderr, BIO_NOCLOSE); //bio_err=BIO_new_fp(stderr, BIO_NOCLOSE);
mkcert(&x509, &pkey, 1024, 0, 36500); mkcert(&x509, &pkey, 1024, 0, 36500);
//RSA_print_fp(stdout, pkey->pkey.rsa, 0); //RSA_print_fp(stdout, pkey->pkey.rsa, 0);
...@@ -150,7 +152,7 @@ KS_DECLARE(int) ks_gen_cert(const char *dir, const char *file) ...@@ -150,7 +152,7 @@ KS_DECLARE(int) ks_gen_cert(const char *dir, const char *file)
PEM_write_PrivateKey(fp, pkey, NULL, NULL, 0, NULL, NULL); PEM_write_PrivateKey(fp, pkey, NULL, NULL, 0, NULL, NULL);
fclose(fp); fclose(fp);
} }
if (rsa && (fp = fopen(rsa, "w"))) { if (rsa && (fp = fopen(rsa, "w"))) {
PEM_write_X509(fp, x509); PEM_write_X509(fp, x509);
fclose(fp); fclose(fp);
...@@ -182,13 +184,13 @@ static int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days ...@@ -182,13 +184,13 @@ static int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days
EVP_PKEY *pk; EVP_PKEY *pk;
RSA *rsa; RSA *rsa;
X509_NAME *name=NULL; X509_NAME *name=NULL;
ks_assert(pkeyp); ks_assert(pkeyp);
ks_assert(x509p); ks_assert(x509p);
if (*pkeyp == NULL) { if (*pkeyp == NULL) {
if ((pk = EVP_PKEY_new()) == NULL) { if ((pk = EVP_PKEY_new()) == NULL) {
abort(); abort();
} }
} else { } else {
pk = *pkeyp; pk = *pkeyp;
...@@ -225,7 +227,7 @@ static int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days ...@@ -225,7 +227,7 @@ static int mkcert(X509 **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days
*/ */
X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, (unsigned char *)"US", -1, -1, 0); X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, (unsigned char *)"US", -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"FreeSWITCH-libKS", -1, -1, 0); X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"FreeSWITCH-libKS", -1, -1, 0);
/* Its self signed so set the issuer name to be the same as the /* Its self signed so set the issuer name to be the same as the
* subject. * subject.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论