Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) Igor Sysoev
*/
#include <stddef.h> /* offsetof() */
#ifndef _NGX_QUEUE_H_INCLUDED_
#define _NGX_QUEUE_H_INCLUDED_
We couldn’t find that file to show.
// Answer to http://github.com/ry/http-parser/issues/#issue/1
// UNTESTED
struct line {
char *field;
size_t field_len;
char *value;
size_t value_len;
};
@ry
ry / gcrypt.h
Created October 12, 2009 12:09
/* gcrypt.h - GNU Cryptographic Library Interface -*- c -*-
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of Libgcrypt.
Libgcrypt is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
/* Copyright (c) 2009 Ryan Dahl <ry@tinyclouds.org>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
@ry
ry / gist:249750
Created December 5, 2009 16:33 — forked from felixge/gist:249748
db.query('SELECT 1')
('result1', function(result1) {
return db.query('SELECT 2');
})
('result2', function(result2) {
return db.query('SELECT 3');
})
('result3')
.addCallback(function(results) {
p(results); // == {result1: result1, result2: result2, result3: result}
cloth 0 ~/projects/node > git diff --stat $(git rev-list -1 --until="5 hours ago" HEAD) -- **/*.js
lib/dns.js | 48 +++++-
lib/sys.js | 8 +-
src/node.js | 331 ++++++++++++++++++++++++++++++-------
test/mjsunit/disabled/test-dns.js | 29 ++++
4 files changed, 350 insertions(+), 66 deletions(-)
cloth 0 ~/projects/node > git diff --stat $(git rev-list -1 --until="5 hours ago" HEAD) -- **/*.{cc,h}
src/node.cc | 1 -
src/node_dns.cc | 94 ++++++++++----
src/node_events.cc | 138 --------------------
diff --git a/src/node.js b/src/node.js
index c8f55c6..c0cd5db 100644
--- a/src/node.js
+++ b/src/node.js
@@ -536,6 +536,7 @@ var posixModule = createInternalModule("posix", function (exports) {
exports.read = function (fd, length, position, encoding) {
var promise = new process.Promise()
+ encoding = encoding | "binary";
process.fs.read(fd, length, position, encoding, callback(promise));
@ry
ry / net.js
Created December 18, 2009 20:39
var debugLevel = 0;
if ('NODE_DEBUG' in process.ENV) debugLevel = 1;
function debug (x) {
if (debugLevel > 0) {
process.stdio.writeError(x + '\n');
}
}
var assert = process.assert;
diff --git a/src/node.js b/src/node.js
index 69416d0..4ba4432 100644
--- a/src/node.js
+++ b/src/node.js
@@ -71,6 +71,8 @@ node.inherits = function () {
};
+var childProcesses = [];
+