Skip to content

Commit

Permalink
Merge pull request #1 from iojs/v1.x
Browse files Browse the repository at this point in the history
Merge upstream updates.
  • Loading branch information
curtiszimmerman committed Jan 15, 2015
2 parents 38a46b9 + 9e62ae4 commit ce61ea4
Show file tree
Hide file tree
Showing 60 changed files with 1,436 additions and 951 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ https://iojs.org/api/console.html

https://iojs.org/api/cluster.html

(**DETAILS TO BE ADDED HERE**)

- Updated `cluster` to use round-robin load balancing by default on non-Windows platforms. The scheduling policy is configurable however.
- `--debug` has been made cluster-aware.
- Many bug fixes.

### crypto

Expand Down
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ experience with the management of the io.js project. Membership is
expected to evolve over time according to the needs of the project.

For the current list of TC members, see the project
[README.md](./#current-project-team-members).
[README.md](./README.md#current-project-team-members).

## Collaborators

Expand Down Expand Up @@ -56,7 +56,7 @@ request or issue. The TC should serve as the final arbiter where
required.

For the current list of Collaborators, see the project
[README.md](./#current-project-team-members).
[README.md](./README.md#current-project-team-members).

A guide for Collaborators is maintained in
[COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md).
Expand Down
14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
io.js is licensed for use as follows:

====

"""
Copyright io.js contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -21,12 +20,12 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

===
"""

This license applies to parts of io.js originating from the
https://github.com/joyent/node repository:

"""
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
Expand All @@ -45,11 +44,12 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
"""

====
The io.js license applies to all parts of io.js that are not externally
maintained libraries.

This license applies to all parts of io.js that are not externally
maintained libraries. The externally maintained libraries used by io.js are:
The externally maintained libraries used by io.js are:

- V8, located at deps/v8. V8's license follows:
"""
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

website_files = \
out/doc/sh_main.js \
out/doc/sh_javascript.min.js

doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)
doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)

$(apidoc_dirs):
mkdir -p $@
Expand Down
8 changes: 4 additions & 4 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Node.js core benchmark tests
# io.js core benchmark tests

This folder contains benchmark tests to measure the performance for certain
Node.js APIs.
io.js APIs.

## How to run tests

Expand All @@ -10,7 +10,7 @@ There are two ways to run benchmark tests:
1. Run all tests of a given type, for example, buffers

```sh
node benchmark/common.js buffers
iojs benchmark/common.js buffers
```

The above command will find all scripts under `buffers` directory and require
Expand Down Expand Up @@ -70,7 +70,7 @@ buffers/buffer-read.js noAssert=false buffer=fast type=UInt16BE millions=1: 244.
2. Run an individual test, for example, buffer-slice.js

```sh
node benchmark/buffers/buffer-read.js
iojs benchmark/buffers/buffer-read.js
```
The output:
```
Expand Down
2 changes: 1 addition & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.PORT = process.env.PORT || 12346;
if (module === require.main) {
var type = process.argv[2];
if (!type) {
console.error('usage:\n ./node benchmark/common.js <type>');
console.error('usage:\n ./iojs benchmark/common.js <type>');
process.exit(1);
}

Expand Down
6 changes: 3 additions & 3 deletions benchmark/http-flamegraph.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
cd "$(dirname "$(dirname $0)")"

node=${NODE:-./node}
node=${NODE:-./iojs}

name=${NAME:-stacks}

Expand All @@ -22,7 +22,7 @@ fi
ulimit -n 100000
$node benchmark/http_simple.js &
nodepid=$!
echo "node pid = $nodepid"
echo "iojs pid = $nodepid"
sleep 1

# has to stay alive until dtrace exits
Expand Down Expand Up @@ -62,7 +62,7 @@ echo 'Turn the stacks into a svg'
stackvis dtrace flamegraph-svg < "$name".src > "$name".raw.svg

echo 'Prune tiny stacks out of the graph'
node -e '
iojs -e '
var infile = process.argv[1];
var outfile = process.argv[2];
var output = "";
Expand Down
2 changes: 1 addition & 1 deletion benchmark/http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ "$k" = "no" ]; then
else
k="-k"
fi
node=${NODE:-./node}
node=${NODE:-./iojs}

$node benchmark/http_simple.js &
npid=$!
Expand Down
2 changes: 1 addition & 1 deletion benchmark/http_simple_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ ! -d benchmark/ ]; then
fi

if [ $SERVER == "127.0.0.1" ]; then
./node benchmark/http_simple.js &
./iojs benchmark/http_simple.js &
node_pid=$!
sleep 1
fi
Expand Down
2 changes: 1 addition & 1 deletion benchmark/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ab.load <- function (filename, name) {


filename <- args[0:1]
data <- ab.load(filename, "node")
data <- ab.load(filename, "iojs")


# histogram
Expand Down
1 change: 1 addition & 0 deletions deps/http_parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags
test
test_g
test_fast
bench
url_parser
parsertrace
parsertrace_g
Expand Down
1 change: 1 addition & 0 deletions deps/http_parser/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Salman Haq <[email protected]>
Simon Zimmermann <[email protected]>
Thomas LE ROUX <[email protected]> LE ROUX Thomas <[email protected]>
Thomas LE ROUX <[email protected]> Thomas LE ROUX <[email protected]>
Fedor Indutny <[email protected]>
2 changes: 1 addition & 1 deletion deps/http_parser/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ script:
notifications:
email: false
irc:
- "irc.freenode.net#libuv"
- "irc.freenode.net#node-ci"
15 changes: 14 additions & 1 deletion deps/http_parser/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,25 @@ BogDan Vatra <[email protected]>
Peter Faiman <[email protected]>
Corey Richardson <[email protected]>
Tóth Tamás <[email protected]>
Patrik Stutz <[email protected]>
Cam Swords <[email protected]>
Chris Dickinson <[email protected]>
Uli Köhler <[email protected]>
Charlie Somerville <[email protected]>
Patrik Stutz <[email protected]>
Fedor Indutny <[email protected]>
runner <[email protected]>
Alexis Campailla <[email protected]>
David Wragg <[email protected]>
Vinnie Falco <[email protected]>
Alex Butum <[email protected]>
Rex Feng <[email protected]>
Alex Kocharin <[email protected]>
Mark Koopman <[email protected]>
Helge Heß <[email protected]>
Alexis La Goutte <[email protected]>
George Miroshnykov <[email protected]>
Maciej Małecki <[email protected]>
Marc O'Morain <[email protected]>
Jeff Pinner <[email protected]>
Timothy J Fontaine <[email protected]>
Akagi201 <[email protected]>
4 changes: 0 additions & 4 deletions deps/http_parser/CONTRIBUTIONS

This file was deleted.

13 changes: 12 additions & 1 deletion deps/http_parser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@
# IN THE SOFTWARE.

PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
SONAME ?= libhttp_parser.so.2.3
SONAME ?= libhttp_parser.so.2.4.1

CC?=gcc
AR?=ar

CPPFLAGS ?=
LDFLAGS ?=

CPPFLAGS += -I.
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1
CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA)
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0
CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA)
CPPFLAGS_BENCH = $(CPPFLAGS_FAST)

CFLAGS += -Wall -Wextra -Werror
CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC

LDFLAGS_LIB = $(LDFLAGS) -shared
Expand Down Expand Up @@ -61,6 +66,12 @@ test_fast: http_parser.o test.o http_parser.h
test.o: test.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@

bench: http_parser.o bench.o
$(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@

bench.o: bench.c http_parser.h Makefile
$(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@

http_parser.o: http_parser.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c

Expand Down
10 changes: 5 additions & 5 deletions deps/http_parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (recved < 0) {
}
/* Start up / continue the parser.
* Note we pass recved==0 to signal that EOF has been recieved.
* Note we pass recved==0 to signal that EOF has been received.
*/
nparsed = http_parser_execute(parser, &settings, buf, recved);
Expand All @@ -75,7 +75,7 @@ if (parser->upgrade) {
HTTP needs to know where the end of the stream is. For example, sometimes
servers send responses without Content-Length and expect the client to
consume input (for the body) until EOF. To tell http_parser about EOF, give
`0` as the forth parameter to `http_parser_execute()`. Callbacks and errors
`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors
can still be encountered during an EOF, so one must still be prepared
to receive them.

Expand Down Expand Up @@ -110,7 +110,7 @@ followed by non-HTTP data.
information the Web Socket protocol.)

To support this, the parser will treat this as a normal HTTP message without a
body. Issuing both on_headers_complete and on_message_complete callbacks. However
body, issuing both on_headers_complete and on_message_complete callbacks. However
http_parser_execute() will stop parsing at the end of the headers and return.

The user is expected to check if `parser->upgrade` has been set to 1 after
Expand All @@ -131,7 +131,7 @@ There are two types of callbacks:
* notification `typedef int (*http_cb) (http_parser*);`
Callbacks: on_message_begin, on_headers_complete, on_message_complete.
* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);`
Callbacks: (requests only) on_uri,
Callbacks: (requests only) on_url,
(common) on_header_field, on_header_value, on_body;

Callbacks must return 0 on success. Returning a non-zero value indicates
Expand All @@ -145,7 +145,7 @@ buffer to avoid copying memory around if this fits your application.

Reading headers may be a tricky task if you read/parse headers partially.
Basically, you need to remember whether last header callback was field or value
and apply following logic:
and apply the following logic:

(on_header_field and on_header_value shortened to on_h_*)
------------------------ ------------ --------------------------------------------
Expand Down
Loading

0 comments on commit ce61ea4

Please sign in to comment.