Permalink
Browse files

http: make http2 the default, legacy backend is available with --use-…

…http1
  • Loading branch information...
bnoordhuis committed Aug 2, 2011
1 parent 48dcb90 commit a4b6b66aa51f01fa82e94d24be283bb594b48b3b
Showing with 15 additions and 15 deletions.
  1. +4 −4 Makefile
  2. +5 −5 src/node.cc
  3. +3 −3 src/node.js
  4. +3 −3 tools/test.py
View
@@ -35,17 +35,17 @@ uninstall:
test: all
python tools/test.py --mode=release simple message
-test-http2: all
- python tools/test.py --mode=release --use-http2 simple message
+test-http1: all
+ python tools/test.py --mode=release --use-http1 simple message
test-valgrind: all
python tools/test.py --mode=release --valgrind simple message
test-all: all
python tools/test.py --mode=debug,release
-test-all-http2: all
- python tools/test.py --mode=debug,release --use-http2
+test-all-http1: all
+ python tools/test.py --mode=debug,release --use-http1
test-all-valgrind: all
python tools/test.py --mode=debug,release --valgrind
View
@@ -139,7 +139,7 @@ static bool use_uv = true;
#endif
// disabled by default for now
-static bool use_http2 = false;
+static bool use_http1 = false;
#ifdef OPENSSL_NPN_NEGOTIATED
static bool use_npn = true;
@@ -2040,7 +2040,7 @@ static Handle<Object> GetFeatures() {
Local<Object> obj = Object::New();
obj->Set(String::NewSymbol("uv"), Boolean::New(use_uv));
- obj->Set(String::NewSymbol("http2"), Boolean::New(use_http2));
+ obj->Set(String::NewSymbol("http1"), Boolean::New(use_http1));
obj->Set(String::NewSymbol("ipv6"), True()); // TODO ping libuv
obj->Set(String::NewSymbol("tls_npn"), Boolean::New(use_npn));
obj->Set(String::NewSymbol("tls_sni"), Boolean::New(use_sni));
@@ -2285,7 +2285,7 @@ static void PrintHelp() {
" --vars print various compiled-in variables\n"
" --max-stack-size=val set max v8 stack size (bytes)\n"
" --use-uv use the libuv backend\n"
- " --use-http2 use the new and improved http library\n"
+ " --use-http1 use the legacy http library\n"
"\n"
"Enviromental variables:\n"
"NODE_PATH ':'-separated list of directories\n"
@@ -2310,8 +2310,8 @@ static void ParseArgs(int argc, char **argv) {
} else if (!strcmp(arg, "--use-uv")) {
use_uv = true;
argv[i] = const_cast<char*>("");
- } else if (!strcmp(arg, "--use-http2")) {
- use_http2 = true;
+ } else if (!strcmp(arg, "--use-http1")) {
+ use_http1 = true;
argv[i] = const_cast<char*>("");
} else if (strcmp(arg, "--version") == 0 || strcmp(arg, "-v") == 0) {
printf("%s\n", NODE_VERSION);
View
@@ -32,7 +32,7 @@
function startup() {
if (process.env.NODE_USE_UV == '1') process.features.uv = true;
- if (process.env.NODE_USE_HTTP2 == '1') process.features.http2 = true;
+ if (process.env.NODE_USE_HTTP1 == '1') process.features.http1 = true;
EventEmitter = NativeModule.require('events').EventEmitter;
process.__proto__ = EventEmitter.prototype;
@@ -403,10 +403,10 @@
function translateId(id) {
switch (id) {
case 'http':
- return process.features.http2 ? 'http2' : 'http';
+ return process.features.http1 ? 'http' : 'http2';
case 'https':
- return process.features.http2 ? 'https2' : 'https';
+ return process.features.http1 ? 'https' : 'https2';
case 'net':
return process.features.uv ? 'net_uv' : 'net_legacy';
View
@@ -1148,7 +1148,7 @@ def BuildOptions():
result.add_option("--simulator", help="Run tests with architecture simulator",
default='none')
result.add_option("--special-command", default=None)
- result.add_option("--use-http2", help="Pass --use-http2 switch to node",
+ result.add_option("--use-http1", help="Pass --use-http1 switch to node",
default=False, action="store_true")
result.add_option("--valgrind", help="Run tests through valgrind",
default=False, action="store_true")
@@ -1309,9 +1309,9 @@ def Main():
buildspace = dirname(shell)
processor = GetSpecialCommandProcessor(options.special_command)
- if options.use_http2:
+ if options.use_http1:
def wrap(processor):
- return lambda args: processor(args[:1] + ['--use-http2'] + args[1:])
+ return lambda args: processor(args[:1] + ['--use-http1'] + args[1:])
processor = wrap(processor)
context = Context(workspace,

0 comments on commit a4b6b66

Please sign in to comment.