diff --git a/runtime/include/sandbox_functions.h b/runtime/include/sandbox_functions.h index 95ceafd..2cd35cb 100644 --- a/runtime/include/sandbox_functions.h +++ b/runtime/include/sandbox_functions.h @@ -145,15 +145,13 @@ sandbox_open_http(struct sandbox *sandbox) /* Set the sandbox as the data the http-parser has access to */ sandbox->http_parser.data = sandbox; //assign data to sandbox in case to operator it when a callback happended - if (sandbox->module->next_module == NULL) { - /* Freshly allocated sandbox going runnable for first time, so register client socket with epoll */ - struct epoll_event accept_evt; - accept_evt.data.ptr = (void *)sandbox; - accept_evt.events = EPOLLIN | EPOLLOUT | EPOLLET; - int rc = epoll_ctl(worker_thread_epoll_file_descriptor, EPOLL_CTL_ADD, sandbox->client_socket_descriptor, + /* Freshly allocated sandbox going runnable for first time, so register client socket with epoll */ + struct epoll_event accept_evt; + accept_evt.data.ptr = (void *)sandbox; + accept_evt.events = EPOLLIN | EPOLLOUT | EPOLLET; + int rc = epoll_ctl(worker_thread_epoll_file_descriptor, EPOLL_CTL_ADD, sandbox->client_socket_descriptor, &accept_evt); - if (unlikely(rc < 0)) panic_err(); - } + if (unlikely(rc < 0)) panic_err(); } /** diff --git a/runtime/src/current_sandbox.c b/runtime/src/current_sandbox.c index d2a2a43..28666bb 100644 --- a/runtime/src/current_sandbox.c +++ b/runtime/src/current_sandbox.c @@ -116,6 +116,7 @@ current_sandbox_start(void) sandbox->request_arrival_timestamp, true, pre_func_output, output_length); /* Add to the Global Sandbox Request Scheduler */ global_request_scheduler_add(sandbox_request); + sandbox_remove_from_epoll(sandbox); sandbox_set_as_returned(sandbox, SANDBOX_RUNNING); } else { /* Retrieve the result, construct the HTTP response, and send to client */