diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3d72576..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -.idea \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1350dd7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "deps/oi"] + path = deps/oi + url = git://github.com/ry/liboi.git +[submodule "deps/ebb"] + path = deps/ebb + url = git://github.com/ry/libebb.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..80dae8e --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +EVDIR=$(HOME)/local/libev +V8INC = $(HOME)/src/v8/include +V8LIB = $(HOME)/src/v8/libv8.a + +CFLAGS = -g -I$(V8INC) -Ideps/oi -DHAVE_GNUTLS=0 -Ideps/ebb +LDFLAGS = -lev #-lefence + +ifdef EVDIR + CFLAGS += -I$(EVDIR)/include + LDFLAGS += -L$(EVDIR)/lib +endif + +server: server.o deps/oi/oi_socket.o deps/ebb/ebb_request_parser.o + g++ $(CFLAGS) $(LDFLAGS) $(V8LIB) -o server $^ + +server.o: server.cc + g++ $(CFLAGS) -c $@ $< + +ebb_request_parser.o: ebb_request_parser.c deps/ebb/ebb_request_parser.h + gcc $(CFLAGS) -c $@ $< + +ebb_request_parser.c: deps/ebb/ebb_request_parser.rl + ragel -s -G2 $< -o $@ + +oi_socket.o: deps/oi/oi_socket.c deps/oi/oi_socket.h + gcc $(CFLAGS) -c $@ $< + +clean: + rm -f *.o + rm -f server + +.PHONY: clean test diff --git a/README b/README new file mode 100644 index 0000000..b177f94 --- /dev/null +++ b/README @@ -0,0 +1,4 @@ + +git submodule init +git submodule update +make diff --git a/README.md b/README.md deleted file mode 100644 index fe6e78e..0000000 --- a/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Initial Commits - -This repository is a curated collection of initial commits from classic open-source projects including Golang, Python, PHP, and more. It serves as a tribute to these foundational projects and provides developers with the opportunity to start their own repositories from the same humble beginnings as these legendary codebases. - -## Purpose - -Many great open-source projects started with a simple, clean initial commit. This repository preserves those historical first steps, allowing developers to: - -- Learn from the foundational architecture of classic projects -- Start new projects with the same clean slate as industry-standard software -- Pay homage to the open-source pioneers -- Study the evolution of software development through these initial codebases - -## Available Projects - -The initial commits of classic projects are organized in separate branches: - -- **Hello World**: The first commit of `hello, world` - - Branch: [`hello-world`](https://github.com/aahl/initial-commit/tree/hello-world) -- **Golang**: The first commit of the Go programming language - - Branch: [`golang`](https://github.com/aahl/initial-commit/tree/golang) -- **Python**: The initial commit of the Python programming language - - Branch: [`python`](https://github.com/aahl/initial-commit/tree/python) -- **NodeJS**: The first commit of the NodeJS programming language - - Branch: [`nodejs`](https://github.com/aahl/initial-commit/tree/nodejs) -- **PHP**: The first commit of the PHP programming language - - Branch: [`php`](https://github.com/aahl/initial-commit/tree/php) - -## How to Use - -### Starting a New Project from a Classic Initial Commit - -1. **Clone the specific branch** of your desired classic project: - ```bash - git clone -b golang https://github.com/aahl/initial-commit.git my-go-project - cd my-go-project - ``` - -2. **Remove git remote**: - ```bash - git remote remove origin - git remote add origin - ``` - -3. **Initialize your new project**: - ```bash - git checkout -b main - git add . - git commit -m "Your initial commit" - ``` - -### Browsing Historical Initial Commits - -Switch between branches to explore different starting points: -```bash -git checkout golang -git checkout python -git checkout nodejs -git checkout php -``` - -## Acknowledgments - -This project is a tribute to the countless developers who contributed to these foundational open-source projects. Their work has shaped the software development landscape and continues to inspire new generations of programmers. diff --git a/deps/ebb b/deps/ebb new file mode 160000 index 0000000..6460653 --- /dev/null +++ b/deps/ebb @@ -0,0 +1 @@ +Subproject commit 646065359957956c9a0a611aa91ee79fb4928e6d diff --git a/deps/oi b/deps/oi new file mode 160000 index 0000000..988d979 --- /dev/null +++ b/deps/oi @@ -0,0 +1 @@ +Subproject commit 988d97948634359cf2a6740dd5228c69a27015ae diff --git a/js_http_request_processor.cc b/js_http_request_processor.cc new file mode 100644 index 0000000..5c76f4b --- /dev/null +++ b/js_http_request_processor.cc @@ -0,0 +1,606 @@ +// Copyright 2008 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +// To avoid warnings from