Merge
This commit is contained in:
6
Rakefile
6
Rakefile
@@ -1,6 +1,9 @@
|
||||
require 'rake_utils/debian'
|
||||
include RakeUtils::DSL
|
||||
|
||||
DEBUG = ENV.has_key?('DEBUG') &&
|
||||
%w|yes y ok 1 true t|.include?(ENV['DEBUG'])
|
||||
|
||||
ALL_SOURCES =FileList['src/*']
|
||||
SOURCES = ALL_SOURCES.select { |c| c =~ /\.c$/ }
|
||||
OBJECTS = SOURCES.pathmap( "%{^src,build}X.o" )
|
||||
@@ -12,7 +15,7 @@ LIBCHECK = "/usr/lib/libcheck.a"
|
||||
|
||||
TEST_MODULES = Dir["tests/check_*.c"].map { |n| n[12..-3] }
|
||||
|
||||
if ENV['DEBUG']
|
||||
if DEBUG
|
||||
LDFLAGS << ["-g"]
|
||||
CCFLAGS << ["-g -DDEBUG"]
|
||||
end
|
||||
@@ -87,3 +90,4 @@ namespace :pkg do
|
||||
t.generate_changelog!
|
||||
end
|
||||
end
|
||||
|
||||
|
10
src/serve.c
10
src/serve.c
@@ -15,6 +15,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/tcp.h>
|
||||
|
||||
static const int block_allocation_resolution = 4096;//128<<10;
|
||||
|
||||
static inline void dirty(struct mode_serve_params *serve, off64_t from, int len)
|
||||
@@ -384,7 +387,12 @@ void serve_open_server_socket(struct mode_serve_params* params)
|
||||
);
|
||||
|
||||
SERVER_ERROR_ON_FAILURE(
|
||||
bind(params->server, ¶ms->bind_to.generic,
|
||||
setsockopt(params->server, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(optval)),
|
||||
"Couldn't set TCP_NODELAY"
|
||||
);
|
||||
|
||||
SERVER_ERROR_ON_FAILURE(
|
||||
bind(params->server, ¶ms->bind_to.generic,
|
||||
sizeof(params->bind_to)),
|
||||
"Couldn't bind server to IP address"
|
||||
);
|
||||
|
Reference in New Issue
Block a user