-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1105 from hioa-cs/dev
v0.10.0-rc.2
- Loading branch information
Showing
76 changed files
with
1,262 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// This file is a part of the IncludeOS unikernel - www.includeos.org | ||
// | ||
// Copyright 2016-2017 Oslo and Akershus University College of Applied Sciences | ||
// and Alfred Bratterud | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
#ifndef HTTP_CLIENT_CONNECTION_HPP | ||
#define HTTP_CLIENT_CONNECTION_HPP | ||
|
||
// http | ||
#include "common.hpp" | ||
#include "connection.hpp" | ||
#include "error.hpp" | ||
|
||
#include <util/timer.hpp> | ||
|
||
namespace http { | ||
|
||
class Client; | ||
|
||
class Client_connection : public Connection { | ||
public: | ||
using timeout_duration = std::chrono::milliseconds; | ||
|
||
public: | ||
explicit Client_connection(Client&, TCP_conn); | ||
|
||
bool available() const | ||
{ return on_response_ == nullptr && keep_alive_; } | ||
|
||
bool occupied() const | ||
{ return !available(); } | ||
|
||
void send(Request_ptr, Response_handler, const size_t bufsize, timeout_duration = timeout_duration::zero()); | ||
|
||
private: | ||
Client& client_; | ||
Response_handler on_response_; | ||
Timer timer_; | ||
timeout_duration timeout_dur_; | ||
|
||
void send_request(const size_t bufsize); | ||
|
||
void recv_response(buffer_t buf, size_t len); | ||
|
||
void end_response(Error err = Error::NONE); | ||
|
||
void timeout_request() | ||
{ end_response(Error::TIMEOUT); } | ||
|
||
void close(); | ||
|
||
}; // < class Client_connection | ||
|
||
} // < namespace http | ||
|
||
#endif // < HTTP_CLIENT_CONNECTION_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# IncludeOS POSIX extensions | ||
|
||
IncludeOS intends to provide a POSIX interface suffucient for linking and running many conventional C libraries and programs. A lot of the POSIX functionality will be header-only stubs and some of it is provided externally by e.g. the compiler or standard library. | ||
|
||
### Other providers of POSIX content | ||
* *newlib*: is our current C library which also provides many POSIX features (indeed the C standard itself overlaps with POSIX). Newlib provides most of the C standard library, including `stdlib.h`, `stdio.h`, `math.h` etc., but is mising some C11 extensions. Those are rarely used and provided here as stubs. | ||
* *clang*: Clang provides a few POSIX headers such as `stddef.h`, `stdarg.h` and `limits.h`. It also provides compiler intrinsics such as `x86intrin.h`. When building IncludeOS we use the `-nostdlibinc` flag to allow inclusion of these headers, without including the standard library headers from the host. | ||
|
||
### Guidelines for this folder | ||
* Only actually standardized POSIX content should live here, and only content not allready provided by alternative sources above. | ||
* Extensions to POSIX headers that IncludeOS needs, but which isn't present on one of the supportet platforms (e.g. macOS or Linux) should not live here, since we'd like to be able to build directly on those platforms with their respective POSIX implementations. As an example, our syslog implementation defines `LOG_INTERNAL` in addition to `LOG_MAIL` etc. While defining this symbol in the `syslog.h` POSIX header is allowed by the standard it introduces an implicit expectation in IncludeOS application code making it less portable. Such extensions can be placed in the IncludeOS API instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// This file is a part of the IncludeOS unikernel - www.includeos.org | ||
// | ||
// Copyright 2017 Oslo and Akershus University College of Applied Sciences | ||
// and Alfred Bratterud | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef POSIX_DLFCN_H | ||
#define POSIX_DLFCN_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define RTLD_LAZY 1 // Relocations are performed at an implementation-dependent time. | ||
#define RTLD_NOW 2 // Relocations are performed when the object is loaded. | ||
#define RTLD_GLOBAL 3 // All symbols are available for relocation processing of other modules. | ||
#define RTLD_LOCAL 4 // All symbols are not made available for relocation processing by other modules. | ||
|
||
void *dlopen(const char *, int); | ||
void *dlsym(void *, const char *); | ||
int dlclose(void *); | ||
char *dlerror(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // < POSIX_DLFCN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.