37 memcpy(resp, resp_in,
sizeof(*resp_in));
60 log(LOG_WEBSERVER_WRITE,
"Successful connection to fd %d closed",
62 log(LOG_WEBSERVER_WRITE,
"Wrote request: %s", resp->
body);
70 .
name =
"Webserver_write_MSU",
int msu_error(struct local_msu *msu, struct msu_msg_hdr *hdr, int broadcast)
int msu_remove_fd_monitor(int fd)
void * msu_get_state(struct local_msu *msu, struct msu_msg_key *key, size_t *size)
Gets the state allocated with the given key.
State storage that is tied to a specific MSU mesasge.
#define WS_INCOMPLETE_READ
Logging of status messages to the terminal.
int write_response(struct response_state *state)
struct msu_type WEBSERVER_WRITE_MSU_TYPE
#define WS_INCOMPLETE_WRITE
int close_connection(struct connection *conn)
void * msu_init_state(struct local_msu *msu, struct msu_msg_key *key, size_t size)
Initializes a new MSU state of the given size with the provided key.
For profiling the path of MSU messages through DeDOS.
Declares the structures and functions applicable to MSUs on the local machine.
#define PROFILE_EVENT(hdr, stat_id)
If the header is marked for profiling, profiles the given event.
The structure that represents an MSU located on the local machine.
#define RTN_TO_EVT(rtn__)
int msu_monitor_fd(int fd, uint32_t events, struct local_msu *destination, struct msu_msg_hdr *hdr)
#define log(level, fmt,...)
Log at a custom level.
A message that is to be delivered to an instance of an MSU.
#define WEBSERVER_WRITE_MSU_TYPE_ID
int msu_free_state(struct local_msu *msu, struct msu_msg_key *key)
Frees the state assocated with the given MSU and key.
char * name
Name for the msu type.
int route_to_origin_runtime(struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output)
Routes an MSU message to the runtime on which the message originated.
Declares strategies that MSUs can use for routing to endpoints.
struct msu_msg_key key
Routing/state key.
static int write_http_response(struct local_msu *self, struct msu_msg *msg)