diff --git a/common.gypi b/common.gypi index 61172ef238441b..877464af3e8e17 100644 --- a/common.gypi +++ b/common.gypi @@ -55,7 +55,6 @@ 'msvs_configuration_platform': 'x64', }], ['OS=="solaris"', { - 'cflags': [ '-fno-omit-frame-pointer' ], # pull in V8's postmortem metadata 'ldflags': [ '-Wl,-z,allextract' ] }, { @@ -68,6 +67,9 @@ ['clang == 0 and gcc_version <= 44', { 'cflags': [ '-fno-tree-sink' ], # Work around compiler bug. }], + ['OS!="mac" and OS!="win"', { + 'cflags': [ '-fno-omit-frame-pointer' ], + }], ], 'msvs_settings': { 'VCCLCompilerTool': { diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 80c3a509346ef0..182711af613028 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -259,6 +259,17 @@ The response implements the [Writable Stream][] interface. This is an Indicates that the underlying connection was terminated before [response.end()][] was called or able to flush. +### Event: 'finish' + +`function () { }` + +Emitted when the response has been sent. More specifically, this event is +emitted when the last segment of the response headers and body have been +handed off to the operating system for transmission over the network. It +does not imply that the client has received anything yet. + +After this event, no more events will be emitted on the response object. + ### response.writeContinue() Sends a HTTP/1.1 100 Continue message to the client, indicating that @@ -433,7 +444,7 @@ If `data` is specified, it is equivalent to calling `response.write(data, encodi followed by `response.end()`. -## http.request(options, callback) +## http.request(options, [callback]) Node maintains several connections per server to make HTTP requests. This function allows one to transparently issue requests. @@ -469,6 +480,9 @@ Options: send TCP KeepAlive packets over sockets being kept alive. Default = `1000`. Only relevant if `keepAlive` is set to `true`. +The optional `callback` parameter will be added as a one time listener for +the ['response'][] event. + `http.request()` returns an instance of the [http.ClientRequest][] class. The `ClientRequest` instance is a writable stream. If one needs to upload a file with a POST request, then write to the `ClientRequest` object. @@ -523,7 +537,7 @@ There are a few special headers that should be noted. * Sending an Authorization header will override using the `auth` option to compute basic authentication. -## http.get(options, callback) +## http.get(options, [callback]) Since most requests are GET requests without bodies, Node provides this convenience method. The only difference between this method and `http.request()` @@ -1008,6 +1022,7 @@ authentication details. ['checkContinue']: #http_event_checkcontinue ['listening']: net.html#net_event_listening +['response']: #http_event_response [Agent]: #http_class_http_agent [Buffer]: buffer.html#buffer_buffer [EventEmitter]: events.html#events_class_events_eventemitter diff --git a/doc/api/net.markdown b/doc/api/net.markdown index 0f0808d2e2df55..38aad16ac260e9 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -98,7 +98,7 @@ Here is an example of a client of echo server as described previously: To connect on the socket `/tmp/echo.sock` the second line would just be changed to - var client = net.connect({path: '/tmp/echo.sock'}, + var client = net.connect({path: '/tmp/echo.sock'}); ## net.connect(port, [host], [connectListener]) ## net.createConnection(port, [host], [connectListener]) diff --git a/node.gyp b/node.gyp index 095ba84fdb745a..a0a1774a434fc0 100644 --- a/node.gyp +++ b/node.gyp @@ -319,6 +319,12 @@ 'PLATFORM="sunos"', ], }], + [ + 'OS=="linux"', { + 'ldflags': [ + '-Wl,--whole-archive <(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.<(target_arch).a -Wl,--no-whole-archive', + ], + }], ], 'msvs_settings': { 'VCLinkerTool': { diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 77797621d08186..3b361f7a059b56 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -299,7 +299,7 @@ void StreamWrap::WriteStringImpl(const FunctionCallbackInfo& args) { req_wrap->Dispatched(); req_wrap->object()->Set(env->bytes_string(), - Number::New(node_isolate, data_size)); + Integer::NewFromUnsigned(data_size, node_isolate)); if (err) { req_wrap->~WriteWrap();