Skip to content

Commit

Permalink
Fixed some compilation problems with release mode.
Browse files Browse the repository at this point in the history
Compile all in-one library (which should be faster), temporally disabled.
  • Loading branch information
davidmoreno committed Mar 23, 2012
1 parent ffa6098 commit 0e91344
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/ofileserver/fileserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion examples/userver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
11 changes: 5 additions & 6 deletions src/onion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions src/onion/onion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

/**
Expand Down
4 changes: 4 additions & 0 deletions src/onion/types_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/onion/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0e91344

Please sign in to comment.