Permalink
Browse files

Fixed some compilation problems with release mode.

Compile all in-one library (which should be faster), temporally disabled.
  • Loading branch information...
1 parent ffa6098 commit 0e9134405d137289e0d1196b151bdcf34a53e978 @davidmoreno committed Mar 23, 2012
@@ -113,7 +113,7 @@ int main(int argc, char **argv){
textdomain("C"); // Default language
// All is configured now, now in hands of dgettext(LANG, txt);
- o=onion_new(O_THREADED);
+ o=onion_new(O_POOL);
onion_set_root_handler(o, root);
onion_set_port(o, port);
@@ -1,4 +1,4 @@
include_directories (${CMAKE_SOURCE_DIR}/src/)
add_executable(userver userver.c)
-target_link_libraries(userver onion_handlers onion_static)
+target_link_libraries(userver onion_handlers_static onion_static)
@@ -7,10 +7,7 @@ endif(SYSTEMD_ENABLED)
set(SOURCES onion.c codecs.c dict.c request.c request_parser.c response.c handler.c
server.c log.c sessions.c shortcuts.c block.c mime.c url.c ${SYSTEMD_C} poller.c)
-IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
- add_library(onion SHARED ${SOURCES})
- add_library(onion_static STATIC ${SOURCES})
-ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+IF (${CMAKE_BUILD_TYPE} MATCHES "Fast")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/all-onion.c
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && cat ${SOURCES} > ${CMAKE_CURRENT_BINARY_DIR}/all-onion.c
@@ -19,8 +16,10 @@ ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(onion SHARED ${CMAKE_CURRENT_BINARY_DIR}/all-onion.c)
add_library(onion_static STATIC ${CMAKE_CURRENT_BINARY_DIR}/all-onion.c)
-
-ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+ELSE (${CMAKE_BUILD_TYPE} MATCHES "Fast")
+ add_library(onion SHARED ${SOURCES})
+ add_library(onion_static STATIC ${SOURCES})
+ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Fast")
# library dependencies
if (GNUTLS_ENABLED)
View
@@ -679,7 +679,6 @@ static int onion_accept_request(onion *o){
char address[64];
int clientfd=accept4(o->listenfd, (struct sockaddr *) &cli_addr, &clilen, SOCK_CLOEXEC);
-
if (clientfd<0){
ONION_ERROR("Error accepting connection: %s",strerror(errno));
return -1;
@@ -981,8 +980,6 @@ void onion_set_user(onion *server, const char *username){
server->username=strdup(username);
}
-struct onion_url_data_t;
-typedef struct onion_url_data_t onion_url_data;
void onion_url_free_data(onion_url_data **d);
/**
@@ -143,6 +143,10 @@ typedef struct onion_block_t{
int maxsize;
}block;
+/// Opaque type used at onion_url internally
+struct onion_url_data_t;
+typedef struct onion_url_data_t onion_url_data;
+
#ifdef __cplusplus
}
View
@@ -55,7 +55,7 @@ struct onion_url_data_t{
struct onion_url_data_t *next;
};
-typedef struct onion_url_data_t onion_url_data;
+//typedef struct onion_url_data_t onion_url_data; // already at types-internal.h
/**
* @short Performs the real request: checks if its for me, and then calls the inside level.

0 comments on commit 0e91344

Please sign in to comment.