Add epoll and do more release readiness changes
This change also pays off some of the remaining technical debt with stdio, file descriptors, and memory managemnt polyfills.
This commit is contained in:
1293
tool/net/greenbean.c
Normal file
1293
tool/net/greenbean.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -73,6 +73,18 @@ o/$(MODE)/tool/net/redbean.com.dbg: \
|
||||
$(APE)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/tool/net/greenbean.com.dbg: \
|
||||
$(TOOL_NET_DEPS) \
|
||||
o/$(MODE)/tool/net/greenbean.o \
|
||||
o/$(MODE)/tool/net/redbean.ico.zip.o \
|
||||
o/$(MODE)/tool/net/redbean.png.zip.o \
|
||||
o/$(MODE)/tool/net/redbean.css.zip.o \
|
||||
o/$(MODE)/tool/net/redbean.html.zip.o \
|
||||
o/$(MODE)/tool/net/net.pkg \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
@$(APELINK)
|
||||
|
||||
# ifeq (,$(MODE))
|
||||
# $(TOOL_NET_OBJS): \
|
||||
# OVERRIDE_CFLAGS += \
|
||||
|
||||
@@ -68,13 +68,12 @@
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "libc/zip.h"
|
||||
#include "libc/zipos/zipos.h"
|
||||
#include "libc/zipos/zipos.internal.h"
|
||||
#include "net/http/http.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "third_party/zlib/zlib.h"
|
||||
|
||||
/* TODO(jart): Implement more lenient message framing */
|
||||
/* TODO(jart): Windows IOCP fiber system call support */
|
||||
|
||||
#define USAGE \
|
||||
" [-hvdsm] [-p PORT]\n\
|
||||
@@ -1116,7 +1115,7 @@ void ProcessRequests(void) {
|
||||
void ProcessConnection(void) {
|
||||
int pid;
|
||||
clientaddrsize = sizeof(clientaddr);
|
||||
client = accept4(server, &clientaddr, &clientaddrsize, 0 /* SOCK_CLOEXEC */);
|
||||
client = accept(server, &clientaddr, &clientaddrsize);
|
||||
if (client != -1) {
|
||||
startconnection = nowl();
|
||||
if ((pid = uniprocess ? -1 : fork()) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user