Re: [nodejs] How to end node js execution in case of a API usage error

2012-07-02 Thread Ben Noordhuis
On Mon, Jul 2, 2012 at 4:17 PM, Benjamin Schneider wrote: > I am currently writing a node js library. Now I came up with the question > what would be the best approach to indicate a usage error by the programmer. > > For example if I got the following function in my public API: > > function do

Re: [nodejs] WARNING: don't use IOWatcher, it'll be removed in v0.9

2012-07-02 Thread Ben Noordhuis
On Mon, Jul 2, 2012 at 11:53 PM, Marc wrote: > Hi, > > I'm using the https://github.com/JustinTulloss/zeromq.node module. I already > forked the module (https://github.com/snrmwg/zeromq.node) to migrate to > libuv for node >= 0.7.11. > Everything works fine. Since node 0.8 I get following message

Re: [nodejs] Sandboxing using 'vm' module & wrapping require()/process.binding()

2012-07-02 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 4:27 AM, Will Riley wrote: > Hi, > > Right now I'm working on a sandbox library for node.js. I'd most likely be > using vm.runInNewContext to prevent any unwanted methods (eg process.kill) > from becoming accessible, and the untrusted code would run in a different > node pro

Re: [nodejs] Running Node JS 0.8.0 FreeBSD 9

2012-07-03 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 2:02 PM, Ben Short wrote: > Hi, > > Is it possible to run Node JS 0.8.0 on FreeBSD? > > I ask because libuv doesn't start that FreeBSD is a supported operating > system and Node JS no uses libuv. > > Thanks > > Ben Hi, namesake. FreeBSD is not an officially supported platf

Re: [nodejs] newbie question iso-8859-15

2012-07-03 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 11:32 AM, KLRUMPF wrote: > Hi all, > > I am new to this list. I have larger 4GL applications running with a > mysql in iso and would like to avoid switching the whole system > (debian) to unicode. Also have lots of Spanish and French and > German umlaut in the application an

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-03 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 6:02 PM, chusi wrote: > I updated nodejs on a ubuntu server (10.04.3 LTS) from v0.6.17 to v0.8.1. > The applications consists of a bunch of scripts that all connect together > over socket.io. I'm monitoring the memory usage i receive from > process.memoryUsage().rss and grap

Re: [nodejs] Re: Running Node JS 0.8.0 FreeBSD 9

2012-07-03 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 8:08 PM, Nathan Rajlich wrote: > It looks like gyp is recognizing your OS as linux instead of FreeBSD. > Possibly a gyp bug. It is but it's fixed upstream. I'll upgrade gyp before the next release. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.

Re: [nodejs] Running Node JS 0.8.0 FreeBSD 9

2012-07-03 Thread Ben Noordhuis
On Tue, Jul 3, 2012 at 3:02 PM, Ben Noordhuis wrote: > On Tue, Jul 3, 2012 at 2:02 PM, Ben Short wrote: >> Hi, >> >> Is it possible to run Node JS 0.8.0 on FreeBSD? >> >> I ask because libuv doesn't start that FreeBSD is a supported operating >> sy

Re: [nodejs] Re: bus error building nodejs 0.8.0 / 0.8.1

2012-07-04 Thread Ben Noordhuis
On Wed, Jul 4, 2012 at 6:09 AM, Ryan Schmidt wrote: > On Jun 29, 2012, at 07:23, Ben Noordhuis wrote: >> On Fri, Jun 29, 2012 at 11:10 AM, mscdex wrote: >>> On Jun 29, 4:34 am, Ryan Schmidt wrote: >>>> Finally, the build fails with: >>>> >>

Re: [nodejs] WARNING: don't use IOWatcher, it'll be removed in v0.9

2012-07-04 Thread Ben Noordhuis
On Wed, Jul 4, 2012 at 9:29 AM, Oleg Efimov (Sannis) wrote: > According to docs [1], you can use require('fs').FSWatcher for watch a > file. > > If it is available only as file descriptor and you can't change this, i > think it is possible to implement FSWatcher with fd argument. > Ben or Bert sh

Re: [nodejs] node v0.8.1 - higher memory consumption?

2012-07-04 Thread Ben Noordhuis
On Wed, Jul 4, 2012 at 11:39 AM, chusi wrote: > On Tuesday, July 3, 2012 7:53:26 PM UTC+2, Ben Noordhuis wrote: >> Sanity check - what do `file /path/to/old/node` and `file >> /path/to/new/node` print? > > old 0.6.17: > ELF 64-bit LSB executable, x86-64, version 1 (S

Re: [nodejs] Tap/Tun devices on Mac?

2012-07-04 Thread Ben Noordhuis
On Thu, Jul 5, 2012 at 2:19 AM, Benni Graf wrote: > Hi everyone! > > I'm trying to read from and write to Tap/Tun devices on Mac OS X Leopard > (http://tuntaposx.sourceforge.net/). Did anyone ever do this? ;-) > > Basically I thought they're just sockets, so I should be able to use them as > descr

Re: [nodejs] Installing mysql module - wrong architecture

2012-07-04 Thread Ben Noordhuis
On Thu, Jul 5, 2012 at 2:18 AM, Tim Johnson wrote: > I've installed the mysql module, but it is the wrong architecture: > here is a dump of the installation (no debug file was built) > > bash-3.2# npm install db-mysql > npm http GET http

Re: [nodejs] Killing child processes (semi-undocumented feature)

2012-07-05 Thread Ben Noordhuis
On Thu, Jul 5, 2012 at 4:06 PM, Gijs Kunze wrote: > To isolate potentially crashy code (code that spawns binaries via the > child_process module) from a long-running server process I've been spawning > a node process which executes the code from the server process which in turn > executes all the

Re: [nodejs] createReadStream and readDir

2012-07-06 Thread Ben Noordhuis
On Fri, Jul 6, 2012 at 2:28 PM, Julian Gruber wrote: > Is it possible to create a readStream from readDir? I tried > createReadStream('.') but directories are not supported there. > > Generally, is it possible to build on streams completely for control flow, > having as few callbacks as possible?

Re: [nodejs] Segmentation fault

2012-07-06 Thread Ben Noordhuis
On Fri, Jul 6, 2012 at 6:06 PM, jdeighan wrote: > I'm getting a segmentation fault trying to "make" Node v0.8.1 from > source. OS is Slackware linux 13.37. I simply downloaded the tar.gz > file, expanded it, cd'd to the node directory, ran ./configure, then > make as instructed in the book "Hands-

Re: [nodejs] nodejs v0.8.1 - cross compilation ?

2012-07-08 Thread Ben Noordhuis
On Sat, Jul 7, 2012 at 5:35 AM, Dau Do wrote: > Hi, > > I'm building the nodejs for my embedded system. I'm not sure if this is the > right forum to post the question or not. You're in the right place. :-) > Does anyone know how to configure the cross-compiler and other options such > as library

Re: [nodejs] newbie question- what is node.js

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 5:17 AM, jshrek wrote: > ok, this is really a serious question... just trying to wrap my head > around exactly what node.js is and what it is not. > > So from what I gather, node.js is a web server written in JavaScript? > Am I on track so far? Somewhat. node.js is not excl

Re: [nodejs] Exposing child_process.js: createPipe() via API, best approach?

2012-07-08 Thread Ben Noordhuis
On Sat, Jul 7, 2012 at 2:38 AM, Damian Kaczmarek wrote: > I would be willing to make any changes to child_process.js to make it > happen. My use case would be to dynamically create new communication > channels to forked/spawned processes. > > Do you think there would be acceptance for exposing suc

Re: [nodejs] opening external editor from node

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 11:54 AM, Antoine van Wel wrote: > Hi, > > I'm programming a small command-line application and want to open up > an external editor, and hand back control to node after the user exits > the editor. Tried opening up vi with child_process.exec and .spawn but > that did not qu

Re: [nodejs] new exclusive modes for fs.open

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 12:08 AM, Mark Volkmann wrote: > The fs documentation says "Exclusive mode (O_EXCL) ensures that path > is newly created." > Does that make sense for "ax" and "ax+" that append to an existing file? No. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://git

Re: [nodejs] `close` event is emitted only when `server.connections === 0`

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 2:12 AM, Kilian C. wrote: > As I can see here: https://github.com/joyent/node/issues/1383 > The `close` event is emitted only when `server.connections === 0` > > While I can not understand motivations behind this, it would be great if > someone could answer to this: > How so

Re: [nodejs] new exclusive modes for fs.open

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 3:28 PM, Mark Volkmann wrote: > On Sun, Jul 8, 2012 at 8:00 AM, Ben Noordhuis wrote: >> On Sun, Jul 8, 2012 at 12:08 AM, Mark Volkmann >> wrote: >>> The fs documentation says "Exclusive mode (O_EXCL) ensures that path >>> is newly

Re: [nodejs] opening external editor from node

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 3:18 PM, José F. Romaniello wrote: > I was wondering what if you call exec and the result of the call, which has > stdout, stdin, stderr.. you pipe to the current process stdout, stdin and > stderr: > > var vi = exec("vi... > vi.stdout.pipe(process.stdout) > process.stdin.pi

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 4:35 PM, Rick Waldron wrote: > > On Sunday, July 8, 2012 at 9:15 AM, Vyacheslav Egorov wrote: > > Apparently we define 'stable' differently. > > Probably not, but I think you've misunderstood the --harmony flag and while > doing so, you've decided to argue with me about it.

Re: [nodejs] `close` event is emitted only when `server.connections === 0`

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 6:22 PM, Kilian C. wrote: > I mean connections to my server. > Socket instances representing clients connected to my server. > How socket clients have to notice a server.close() call? They don't, the 'close' event isn't emitted until the last client connection closes. --

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 7:54 PM, Rick Waldron wrote: > I'm absolutely not being passive aggressive and I don't appreciate the > accusation. > > I responded to every point that I felt needed a response, in some cases > agreeing, others disagreeing and offering more explanation where it felt > right

Re: [nodejs] new exclusive modes for fs.open

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 9:09 PM, Mark Volkmann wrote: > I just tried it and "ax" does not report an error when the file > exists. It overwrites the existing contents just like "w" does. I > haven't detected any differences between these modes. With what OS is that? (I'll make a guess and say it's

Re: [nodejs] Re: Connection dies with ECONNREFUSED

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 10:00 PM, Frederik Berg wrote: > I got the same error with node.js 0.8 (on windows 7 64 bit if it matters) > > And... I wrote some small script that does not fail to throw the error: > >>> var net = require('net'); >>> >>> var connection; >>> >>> >>> try{ >>> >>> connection

Re: [nodejs] v0.8.1: zlib memory leak?

2012-07-08 Thread Ben Noordhuis
On Sun, Jul 8, 2012 at 6:50 PM, Matt Gollob wrote: > I'm experiencing ever-increasing memory usage in my application and I think > I've isolated at least part of it to node's zlib module. > > This gist (https://gist.github.com/3071680#file_zlibtest.js) attempts to > illustrate the issue. Also inc

Re: [nodejs] new exclusive modes for fs.open

2012-07-09 Thread Ben Noordhuis
On Mon, Jul 9, 2012 at 4:03 AM, Mark Volkmann wrote: > On Jul 8, 2012, at 5:18 PM, Ben Noordhuis wrote: >> On Sun, Jul 8, 2012 at 9:09 PM, Mark Volkmann >> wrote: >>> I just tried it and "ax" does not report an error when the file >>> exists. It ov

Re: [nodejs] `close` event is emitted only when `server.connections === 0`

2012-07-09 Thread Ben Noordhuis
On Mon, Jul 9, 2012 at 4:36 AM, Kilian C. wrote: > This means that is up to me (us) close all the connections from our side, > right? Yep, that's correct. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received

Re: [nodejs] Re: Version 0.8.2 (stable)

2012-07-09 Thread Ben Noordhuis
On Mon, Jul 9, 2012 at 7:49 PM, Domenic Denicola wrote: > Could someone expand on the busy loop fixes? Are they "OMG I'd better deploy > this" or are they very rare edge cases? Somewhere in between. They're not very critical bugs, though. Worst case is that your node binary sometimes uses 100% CP

Re: [nodejs] Re: Version 0.8.2 (stable)

2012-07-09 Thread Ben Noordhuis
On Tue, Jul 10, 2012 at 12:42 AM, James Gosnell wrote: > Hi Ben, > > I'm curious to which commit you did the FreeBSD fixes. Do you have the > commit hash or link for that? I did a quick search in the commit msg's for > "freebsd" and didn't find anything. If you don't have it quickly on hand, > don

[nodejs] Re: [node-dev] How to create an ObjectWrap factory?

2012-07-10 Thread Ben Noordhuis
Moving this to nodejs, nodejs-dev is for core node development. On Tue, Jul 10, 2012 at 3:52 PM, aludin wrote: > Hi, > > I am trying to return "wrapped objects" from a single object playing the > role an object factory. I ve tried something like this but it does nt seem > to work: > > // the Obje

Re: [nodejs] Re: bus error building nodejs 0.8.2

2012-07-10 Thread Ben Noordhuis
On Tue, Jul 10, 2012 at 7:40 AM, Ryan Schmidt wrote: > > On Jul 4, 2012, at 05:22, Ben Noordhuis wrote: > >>>> Also, if you have the time and the inclination, it'd be interesting to >>>> track down the cause of the bus error. >>> >>> I'

Re: [nodejs] Embedding Node.js in the Chromium render process

2012-07-10 Thread Ben Noordhuis
On Tue, Jul 10, 2012 at 8:31 PM, Nathan Sobo wrote: > I'm interested in embedding Node.js into the Chromium renderer process for > an internal tool I'm building for GitHub. This is a situation where running > Node as a subprocess won't suffice, so I'm curious what the barriers are do > doing this

Re: [nodejs] child_process.spawn issue in 0.8.x

2012-07-10 Thread Ben Noordhuis
On Tue, Jul 10, 2012 at 3:58 PM, wavded wrote: > The following code worked fine in 0.6.19, but fails in 0.8.x: > > https://github.com/applieddataconsultants/pdfsnag/blob/master/pdfsnag.js#L108-110 > > I know spawn changed a bit in how it handles stdio in 0.8.x. The issue is > that wkhtmltopdf is

Re: [nodejs] child_process.spawn issue in 0.8.x

2012-07-10 Thread Ben Noordhuis
On Tue, Jul 10, 2012 at 10:37 PM, wavded wrote: > Thanks Ben for your response: > > Your cat example fixed the problem with wkhtmltopdf but .pipe() doesn't > close properly so the response never finishes. > > ``` > wkhtmltopdf.stdout.pipe(res) > ``` > > This starts a download in the browser but ne

Re: [nodejs] Embedding Node.js in the Chromium render process

2012-07-10 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 12:56 AM, Nathan Sobo wrote: > I'm glad to hear you're thinking about this. What's the mutual exclusion > situation look like? When I call functions that modify the uv_loop_t struct > from another thread, will I need to synchronize that access, or would that > synchronizati

Re: [nodejs] Buffer memory allocation

2012-07-10 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 1:14 AM, David Björklund wrote: > Yo! > > If I allocate a Buffer of size 1gb - 1 byte (maximum size of a Buffer) the > memory usage of the process doesn't increase by 1 gb but far less - how and > where are a Buffer's memory allocated? > > - David Björklund Google for 'mem

Re: [nodejs] Re: bus error building nodejs 0.8.2

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 7:00 AM, JWagner wrote: > I am having the same issue. > mac osx 10.5.8 gcc 4.0.2 > I tried > ./configure --without-snapshot > make CFLAGS+=-O0 CXXFLAGS+=-O0 > make install// failed with 'make: *** [install] Bus error' Do you have the possibility to upgrade your

Re: [nodejs] Error linking v8 while cross-compiling for Drobo FS

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 5:24 AM, Jason Schmidt wrote: > I have a 32-bit Ubuntu virtual machine following the instructions from > > http://www.droboports.com/setting-up-a-vm > > Everything seems to build successfully up until the end of v8 > > CXX(target) > /home/zannalov/code/node-v0.8.2/out/Rel

Re: [nodejs] Re: bus error building nodejs 0.8.2

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 3:05 PM, Ryan Schmidt wrote: > > On Jul 11, 2012, at 07:20, Ben Noordhuis wrote: > >> On Wed, Jul 11, 2012 at 7:00 AM, JWagner wrote: >>> I am having the same issue. >>> mac osx 10.5.8 gcc 4.0.2 >>> I tried >>> ./configu

Re: [nodejs] Error linking v8 while cross-compiling for Drobo FS

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 5:46 PM, Jason Schmidt wrote: > An additional bit of information: I hunted down and captured the exact > command being run which is producing the errors. Maybe something is missing > from it? > > flock /home/zannalov/code/node-v0.8.2/out/Release/linker.lock > /usr/local/arm

Re: [nodejs] Re: v0.8.* make failed under Linux x64

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 10:05 PM, Michael Smith wrote: > Hi there! > > So, I'm not Mindon Feng, but I'm running into the same problem. I'm running > an antiquated version of SLES with python 2.7.3 compiled from gzipped > tarball. Below is the results of my running make distclean followed by > ./co

Re: [nodejs] Re: v0.8.* make failed under Linux x64

2012-07-11 Thread Ben Noordhuis
On Wed, Jul 11, 2012 at 11:08 PM, Michael Smith wrote: > So I did as you asked and got a somewhat different error. Now it seems to be > missing snapshot.cc. (note: this is still 0.8.2) > > ./configure && make > { 'target_defaults': { 'cflags': [], >'default_configuration':

Re: [nodejs] Re: v0.8.* make failed under Linux x64

2012-07-11 Thread Ben Noordhuis
On Thu, Jul 12, 2012 at 12:46 AM, Michael Smith wrote: > On Wednesday, July 11, 2012 2:48:05 PM UTC-7, Ben Noordhuis wrote: >> >> It seems the overarching theme with your machine is that generating >> code or post-processing object files somehow doesn't work (b

Re: [nodejs] Error linking v8 while cross-compiling for Drobo FS

2012-07-11 Thread Ben Noordhuis
On Thu, Jul 12, 2012 at 2:40 AM, Jason Schmidt wrote: > It was set to "arm-none-linux-gnueabi". I've tried both "armv5t" and > "armv5te" (still getting the original linking error in both cases). When I > tried to set it to just "arm", however, I got an error message at configure > time: Yes, it n

Re: [nodejs] Error linking v8 while cross-compiling for Drobo FS

2012-07-11 Thread Ben Noordhuis
On Thu, Jul 12, 2012 at 2:53 AM, Jason Schmidt wrote: > Should I use -march=armv5te or just -march=arm on the make line? Sorry, I'm being unclear. :-) Use -march=armv5te on the command line, that tells gcc what arch to compile for. Set target_arch to "arm", that's for general bookkeeping of the

Re: [nodejs] assertion failure in node

2012-07-12 Thread Ben Noordhuis
On Thu, Jul 12, 2012 at 7:40 PM, Mark Hahn wrote: > A node process in production died abruptly and this appeared on the > console... > > node: /root/.nvm/v0.6.12/include/node/node_object_wrap.h:62: void > node::ObjectWrap::Wrap(v8::Handle): Assertion > `handle->InternalFieldCount() > 0' failed. >

Re: [nodejs] assertion failure in node

2012-07-12 Thread Ben Noordhuis
On Thu, Jul 12, 2012 at 9:22 PM, Addison Higham wrote: > I believe Mr. Noordhuis misread your nvm output and thought you were running > 0.6.18 (the other version you seem to have installed) > > I would say try 0.8.2 and if that fails, then file an issue. That's indeed what I meant. :-) -- Job B

Re: [nodejs] Node.js memory, GC and performance

2012-07-12 Thread Ben Noordhuis
On Fri, Jul 13, 2012 at 3:10 AM, Alexey Petrushin wrote: > There are rumors that current Node.js (or, more exactly V8 GC) performs > badly when there are lots of JS objects and memory used. > > Can You please explain what exatly is the problem - lots of objects or lots > of properties on one objec

Re: [nodejs] Module writing

2012-07-13 Thread Ben Noordhuis
On Fri, Jul 13, 2012 at 12:36 PM, jas wrote: > I have been doing some research, reviewing existing material etc. Following > the gtknotify module creation process found @ > http://syskall.com/how-to-write-your-own-native-nodejs-extension has allowed > me to create my own module which compiles and

Re: [nodejs] Re: bus error building nodejs 0.8.2

2012-07-13 Thread Ben Noordhuis
On Fri, Jul 13, 2012 at 2:17 PM, Eric Vander Weele wrote: > I have tried with clang-3.2 and have gotten nodejs to build under OS X 10.5 > , however when I run node I get the following: >> Assertion failed: (!!(events & UV__IO_READ) ^ !!(events & UV__IO_WRITE)), >> function uv__stream_io, file ../d

Re: [nodejs] Re: bus error building nodejs 0.8.2

2012-07-13 Thread Ben Noordhuis
On Fri, Jul 13, 2012 at 3:08 PM, Eric Vander Weele wrote: > (gdb) bt full > > #0 0x932afd52 in __kill () No symbol table info available. > > #1 0x932afd44 in kill$UNIX2003 () No symbol table info available. > > #2 0x93322242 in raise () No symbol table info available. > > #3 0x9332e6

Re: [nodejs] how to release nodejs projbect in a binary executable format?

2012-07-16 Thread Ben Noordhuis
On Mon, Jul 16, 2012 at 8:54 AM, 李白字一日 wrote: > I have a nodejs project, > and i want to release it in a binary executable format. > > can this idea be done? You can drop a _third_party_main.js script in the lib/ directory. It's not something we really encourage or support but it's a stepping sto

Re: [nodejs] Use cases for some net.Socket constructor options

2012-07-17 Thread Ben Noordhuis
On Tue, Jul 17, 2012 at 10:07 AM, Santiago Gimeno wrote: > Hello, > > In the documentation of the Socket constructor there are two options: fd and > type that I've been trying to use with no luck. > What I was trying to do was: > > 1 - Create a Unix stream socket by calling a JS function bound to

Re: [nodejs] How to pass SO_REUSE_ADDR in lib_uv: too many sockets in TIME_WAIT state

2012-07-17 Thread Ben Noordhuis
On Tue, Jul 17, 2012 at 6:07 PM, Romain wrote: > Hi, > > I have a script in node-js that do a lot of http requests. > > After 30s, I did 30 000 requests, and I start having errors : `connect > EHOSTUNREACH` and `getaddrinfo ENOENT` > > The command `netstat -putone` tell me that there are a lot of

Re: [nodejs] Re: v0.8.* make failed under Linux x64

2012-07-17 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 12:24 AM, Denis wrote: > Hi Ben, > > I have the same issue - it builds on newer linux, but fails on the older > one. Here is the info: > > This fails: > > make -v: > GNU Make 3.80 > > g++ -v > gcc version 3.4.6 20060404 (Red Hat 3.4.6-11) > > > This works: > > GNU Make 3.81

Re: [nodejs] Re: Should node.js be using this much memory?

2012-07-17 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 3:35 AM, wavded wrote: > mscdex, question about that, I have a process running at 370 some MB in RES > (in TOP) but the output from process.memoryUsage() is 51 MB. Any clues on > that? I know Linux memory management is weird but I have been relying on > process.memoryUsag

Re: [nodejs] Re: Should node.js be using this much memory?

2012-07-18 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 4:01 AM, wavded wrote: > Thanks for clarification Ben. That makes sense and the 51 MB I was > referring to was the heapUsed value which was just one part of the picture > as I just learned. What typically takes up the most memory outside of the > V8 heap? Open file descr

Re: [nodejs] Re: installing libxmljs in centos 5.x

2012-07-18 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 11:31 AM, Angelo Chen wrote: > looks error started from these lines: > cc1plus: warnings being treated as errors > /usr/local/include/node/ev-emul.h: In function ‘void > __ev_timer_start(__ev_timer*)’: > /usr/local/include/node/ev-emul.h:203: warning: passing ‘double’ for >

Re: [nodejs] Re: installing libxmljs in centos 5.x

2012-07-18 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 2:24 PM, Angelo Chen wrote: > cool, how to check out this version? Clone the repo and check out the v0.8 branch or download the v0.8 tarball from github. The changes may land in tonight's release (then again, they may not). -- Job Board: http://jobs.nodejs.org/ Posting g

Re: [nodejs] Re: installing libxmljs in centos 5.x

2012-07-18 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 3:31 PM, Angelo Chen wrote: > I did and built it, i got v0.8.3-pre. > the compile error with libxmljs go away, but still get errors: > > 151 info postuninstall libxmljs@0.5.4 > 152 error libxmljs@0.5.4 install: `node-waf configure build` > 152 error `sh "-c" "node-waf confi

Re: [nodejs] Outgoing HTTP Requests via a proxy / firewall with authentication

2012-07-18 Thread Ben Noordhuis
On Wed, Jul 18, 2012 at 6:47 PM, santa wrote: > Hello All, > > Is there a way that I can make all http requests from node.js application > pass through a proxy with authentication? > > Thank you. You probably want request[1]. http://user:p...@example.com/ style proxy requests won't work however,

Re: [nodejs] Node 0.8: --libdir switch gone

2012-07-18 Thread Ben Noordhuis
On Thu, Jul 19, 2012 at 1:42 AM, Jan Engelhardt wrote: > In nodejs-0.6.19, it was possible to specify ./configure > --libdir=/usr/lib64. In node-0.8.2, this is no longer possible, likely as a > result of switching from waf to gyp. That's correct. Just pass the linker flags you want to make, e.g.

Re: [nodejs] undefined symbol: ev_default_loop_ptr When use LDAP@1.0.4

2012-07-20 Thread Ben Noordhuis
On Fri, Jul 20, 2012 at 6:44 PM, 文冰华佗 wrote: > I find nodejs module LDAP@1.0.4, use it, works great. > > but my prod env need static complie node, so...I compile nodejs --static > > ldd /usr/local/bin/node > not a dynamic executable > > run server... > Error: /home/mars/node_modules/LDAP/build

Re: [nodejs] undefined symbol: ev_default_loop_ptr When use LDAP@1.0.4

2012-07-24 Thread Ben Noordhuis
On Sun, Jul 22, 2012 at 2:22 PM, 文冰华佗 wrote: > change -static into -rdynamic does works well, BUT my server in prod, only > could use static executable node, no dynamic lib need. > that is the point... Are you trying to build: a) a monolithic executable that contains both node and ldap, or b) a

Re: [nodejs] Re: [libuv] multiple calls order of on_alloc and on_read

2012-07-24 Thread Ben Noordhuis
On Tue, Jul 24, 2012 at 11:29 AM, Felix Halim wrote: > From what I see in the ./src/unix/stream.c, on_read is called > immediately after on_alloc. > Is it guaranteed that it will always be the case? or it may change in > the future? It may change if the need arises. > Since libuv is single threa

Re: [nodejs] Re: uv_write() for dynamic response

2012-07-24 Thread Ben Noordhuis
On Mon, Jul 23, 2012 at 1:22 PM, Felix Halim wrote: > On Mon, Jul 23, 2012 at 6:02 PM, Bert Belder wrote: >> Node calls uv_write many times. > > Node calls uv_write many times to response a single request? > > How exactly is this performed? There are at least 2 ways to do it: > 1. Does it wait th

Re: [nodejs] configure syntax error

2012-07-24 Thread Ben Noordhuis
On Sat, Jul 21, 2012 at 7:28 PM, shane wrote: > Hi all, > > I'm attempting to build an updated node.js (0.8.2) on a Joyent SmartMachine > but am unable to run the configure script (output is below). I've previously > been using 0.5.7. On some experimentation, I've found that I can build the > 0.6

Re: [nodejs] configure syntax error

2012-07-25 Thread Ben Noordhuis
On Tue, Jul 24, 2012 at 8:30 PM, Shane Iseminger wrote: > Thanks, that was my initial thinking, but I'm using gmake 3.81. Is your shell bash? In theory, any Bourne-compliant shell should work but in practice it (probably) won't. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https:/

Re: [nodejs] Re: V8 profiler output question

2012-07-25 Thread Ben Noordhuis
On Wed, Jul 25, 2012 at 9:53 PM, Jesse wrote: > Did anything ever come of this? I am also not seeing the v8.log when using > the --prof_lazy option. As stated here: > > https://github.com/bnoordhuis/node-profiler It turns out I forgot to document that you must add --log to the command line now. B

Re: [nodejs] uv_queue_work break

2012-07-26 Thread Ben Noordhuis
On Thu, Jul 26, 2012 at 5:38 PM, Denis Davydov wrote: > sorry for my english > > I have blocking function from other C library and i use she in > uv_queue_work. Example source code: > http://pastebin.com/3cnyWLZb > My problem - breaking work function in any time. I try use uv_close and give > segf

Re: [nodejs] [libuv] crashed on POST request, libuv bugs?

2012-07-26 Thread Ben Noordhuis
On Thu, Jul 26, 2012 at 7:39 PM, Felix Halim wrote: > Ah yes, you are right. > > The problem seems to be the connection is closed while the http-parser > keeps on reading. > I think libuv can improve the error message (rather than assertion error). > Assertion error is like something FATAL is viol

Re: [nodejs] Resources on libuv, c++, v8

2012-07-26 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 12:24 AM, wavded wrote: > Does anyone have a list of good resources on learning libuv / c++ / v8 > stuff? > > I'm a JS guy, dynamic languages, and not very good node addon stuff (or C or > C++) but want to get better. Have went through the node.js docs but it only > helps

Re: [nodejs] HAProxy and nodeJs server using SocketIO

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 9:36 AM, Arnout Kazemier wrote: > Nginx will probably not work because it doesn't support HTTP 1.1 for > upstream proxies. That's no longer true as of nginx 1.2.0. Websocket support is targeted for 1.4.0. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https:/

Re: [nodejs] uv_queue_work break

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 6:09 AM, Denis Davydov wrote: > ok > How break uv_work_t request? Or this impossible? What do you mean by 'break'? Abort, interrupt, clean up? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines Y

Re: [nodejs] [libuv] uv_write and uv_close

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 9:38 AM, Felix Halim wrote: > Is it mandatory to call uv_close in the callback of uv_write? > > Or we can just write it like this (3 uv_writes, followed by one uv_close): > > uv_write(&write_req, (uv_stream_t*)&handle, &resbuf, 1, 0); > uv_write(&write_req, (uv_stream_t*)&h

Re: [nodejs] [libuv] uv_write and uv_close

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 2:19 PM, Felix Halim wrote: > So, the only way to correctly call uv_close() is to wait until all > uv_write's callbacks have been called? > > Why don't it get queued just like multiple_calls to uv_write() ? > > (I am asking why it is designed that way) > > Felix Halim You

Re: [nodejs] [libuv] uv_write and uv_close

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 6:42 PM, Bry wrote: > Why don't you guys open up the Wiki section on the uv github so we can get > some tuts rolling? Done. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this me

Re: [nodejs] [libuv] how to exit from uv_loop?

2012-07-27 Thread Ben Noordhuis
On Fri, Jul 27, 2012 at 4:52 PM, Felix Halim wrote: > When we call: > > uv_run(uv_loop); > > The lines after that will never get called, unless we exit from uv_loop. > > What is the function to call for that? > > Felix Halim There isn't one. Call uv_run_once() repeatedly instead. -- Job Board

Re: [nodejs] uv_queue_work break

2012-07-28 Thread Ben Noordhuis
On Sat, Jul 28, 2012 at 10:26 AM, Denis Davydov wrote: > Stop work work_cb function (call pthread_cancel). You can't. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscrib

Re: [nodejs] bus error building nodejs 0.8.2

2012-07-28 Thread Ben Noordhuis
On Sat, Jul 28, 2012 at 7:35 PM, Ryan Schmidt wrote: > Now that OS X 10.8 Mountain Lion has been released, 10.5 Leopard is three > releases old, and there's really no excuse whatsoever for Intel Mac users not > to upgrade to at least 10.6 Snow Leopard (all Intel Macs support it and it is > a fa

Re: [nodejs] [libuv] uv_timer_start(), the repeat parameter

2012-07-31 Thread Ben Noordhuis
On Tue, Jul 31, 2012 at 5:38 AM, Felix Halim wrote: > UV_EXTERN int uv_timer_start(uv_timer_t* timer, uv_timer_cb cb, > int64_t timeout, int64_t repeat); > > Please add comments to the intended value for the "repeat" parameter > to the uv.h. > The repeat params here means call the uv_timer_cb(

Re: [nodejs] [libuv] the number of thread pool for uv_queue_work, sleep() and uv_timer

2012-07-31 Thread Ben Noordhuis
On Tue, Jul 31, 2012 at 9:14 PM, Felix Halim wrote: > I tested calling as many uv_queue_work and it only executes at most 4 > of them concurrently. > Is there a way to change this number? Not in libuv. libeio lets you set a min and max[1] but don't count on that staying around forever. The threa

Re: [nodejs] node 8.x real slow compile times

2012-07-31 Thread Ben Noordhuis
On Tue, Jul 31, 2012 at 11:53 PM, john.tiger wrote: > any reason for this ? does it need any special configure settings ? > running on both debian testing and sid `export JOBS=` or pass -j to make. Replace with the number of CPUs your machine has. -- Job Board: http://jobs.nodejs.org/ Postin

Re: [nodejs] Poor cluster accept() distribution

2012-08-01 Thread Ben Noordhuis
On Wed, Aug 1, 2012 at 8:55 AM, Rusty wrote: > I am seeing really poor distribution of connections across a "cluster". > > For example (count of connections served on left, PID on right): > $ node test.js | awk '/connection/{print$2}' | sort | uniq -c > 438 4687 > 300 4688 >1008 4690 >

Re: [nodejs] https, GoDaddy SSL cert, node.js under Microsoft Azure

2012-08-02 Thread Ben Noordhuis
On Thu, Aug 2, 2012 at 5:27 PM, thstart wrote: > Install GoDaddy SSL certificate with Node.js > > I want to use https for my web app which is running on Microsoft > Azure. > > I used IIS to generate certificate for GoDaddy then downloaded two files: > .crt > gd_iis_intermediates.p7b > Then I follo

Re: [nodejs] NodeJS ReadStream not reading bufferSize bytes at a time

2012-08-02 Thread Ben Noordhuis
On Thu, Aug 2, 2012 at 9:21 PM, Gill wrote: > I have a code where the NodeJS server reads a file and streams it to > response, it looks like: > > var fStream = fs.createReadStream(filePath, {'bufferSize': 128 * 1024}); > fStream.pipe(response); > > The issue is, Node reads the file exactly 40960 b

Re: [nodejs] Memory usage, how to garbage collect

2012-08-02 Thread Ben Noordhuis
On Thu, Aug 2, 2012 at 8:37 PM, Ben Buckman wrote: > Suppose I have a very large array in memory and want to clear it after it's > no longer needed. This snippet replicates the scenario: > > console.log("Memory usage initial:", process.memoryUsage()); > > var hugeStack = [], i, obj; > > function l

Re: [nodejs] --max-old-space-size v8 options not working with sizes>1900 in v0.8.x

2012-08-03 Thread Ben Noordhuis
On Fri, Aug 3, 2012 at 4:36 PM, Thomas Fritz wrote: > Hi, > > I just tried to increase the heap size of v8. > > > node --max-old-space-size=4096 script.js > > > Every size above about 1900 is ignored. > I am definately on a x86_64 machine. So higher limits should work. > Has this behaviour maybe

Re: [nodejs] Re: libuv exits event loop too early

2012-08-05 Thread Ben Noordhuis
On Sat, Aug 4, 2012 at 9:54 PM, mscdex wrote: > On Aug 4, 3:36 pm, mscdex wrote: >> I have tried manually adding a call to uv_ref() on the uv_poll_t >> handle at different points (e.g. after each call to uv_poll_start), >> but it does not prevent the event loop from exiting early, no matter >> ho

[nodejs] Re: [libuv] silent crash on large response + closing connection from client

2012-08-06 Thread Ben Noordhuis
On Mon, Aug 6, 2012 at 8:05 PM, Felix Halim wrote: > On Tue, Aug 7, 2012 at 1:28 AM, Felix Halim wrote: >> I am using (the updated) Ryan Dahl's simple webserver: >> >> https://gist.github.com/1249783 >> >> I modify the webserver.c so that instead of responding with a simple >> "hello world", it s

[nodejs] Re: [libuv] silent crash on large response + closing connection from client

2012-08-07 Thread Ben Noordhuis
On Tue, Aug 7, 2012 at 6:05 AM, Felix Halim wrote: > On Tue, Aug 7, 2012 at 3:47 AM, Ben Noordhuis wrote: >> No, libuv (and node.js) handles that fine. Chances are high that the >> bug is in your application. > > After further investigation, valgrind says that it got a

Re: [node-dev] Re: [nodejs] Version 0.8.6 (Stable)

2012-08-07 Thread Ben Noordhuis
On Tue, Aug 7, 2012 at 9:10 PM, Matt wrote: > Did the libuv fix to not accept all incoming connections make it into this > one (the one to improve cluster load balancing)? No, it only exists in master. It's commit 9f7cdb2[1] in case you want to back-port it. [1] https://github.com/joyent/libuv/c

Re: [nodejs] Node.js-net socket - Sending frame

2012-08-08 Thread Ben Noordhuis
On Wed, Aug 8, 2012 at 11:43 PM, trembl wrote: > Hello, > > I have a problem concerning the implementation of a communication between a > node server and a device. I use the library net in node that provides a > communication port type TCP client . > > code: > > var net = require('net'); > > var H

Re: [nodejs] Re: Node.js-net socket - Sending frame

2012-08-09 Thread Ben Noordhuis
On Thu, Aug 9, 2012 at 4:44 AM, trembl wrote: > Tanks for the answer mr. Noordhuis, > > it is effectively as string that i send wich is at the base an array of hex > values eg: > > //= > var mCmd = new Array(34); > mCmd[0] = 0x46; > mCmd[1] = 0x49; >

Re: [nodejs] how to set worker v8 options in cluster module?

2012-08-09 Thread Ben Noordhuis
On Thu, Aug 9, 2012 at 8:44 AM, darcy wrote: > if start program by "node --trace_gc mynode.js",, and use cluster module to > start worker process, the options is not passed to the worker. > > I learned the api docs, but no api for this popurse. Try this: var argv = process.execArgv.concat(['--

<    1   2   3   4   5   6   7   8   9   10   >