maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Functions | Variables
http_server.c File Reference
`#include <libusockets.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
Include dependency graph for http_server.c:

Go to the source code of this file.

## Classes
struct | http_socket
struct | http_context

## Functions
void | on_wakeup (struct us_loop_t *loop)
void | on_pre (struct us_loop_t *loop)
void | on_post (struct us_loop_t *loop)
struct us_socket_t * | on_http_socket_writable (struct us_socket_t *s)
struct us_socket_t * | on_http_socket_close (struct us_socket_t *s, int code, void *reason)
struct us_socket_t * | on_http_socket_end (struct us_socket_t *s)
struct us_socket_t * | on_http_socket_data (struct us_socket_t *s, char *data, int length)
struct us_socket_t * | on_http_socket_open (struct us_socket_t *s, int is_client, char *ip, int ip_length)
struct us_socket_t * | on_http_socket_timeout (struct us_socket_t *s)
int | main ()

## Variables
const int | SSL = 1

## Class Documentation

## ◆ http_socket

struct http_socket

Definition at line 10 of file http_server.c.

Collaboration diagram for http_socket:

Class Members
int | offset |

## ◆ http_context

struct http_context

Definition at line 15 of file http_server.c.

Collaboration diagram for http_context:

Class Members
int | length |
char * | response |

## Function Documentation

## ◆ main()

int main | ( |  | ) |

Definition at line 90 of file http_server.c.

References us_socket_context_options_t::cert_file_name, us_socket_context_options_t::key_file_name, http_context::length, us_socket_context_t::loop, on_http_socket_close(), on_http_socket_data(), on_http_socket_end(), on_http_socket_open(), on_http_socket_timeout(), on_http_socket_writable(), on_post(), on_pre(), on_wakeup(), us_socket_context_options_t::passphrase, http_context::response, SSL, us_create_loop(), us_create_socket_context(), us_loop_run(), us_socket_context_ext(), us_socket_context_listen(), us_socket_context_on_close(), us_socket_context_on_data(), us_socket_context_on_end(), us_socket_context_on_open(), us_socket_context_on_timeout(), and us_socket_context_on_writable().

Here is the call graph for this function:

## ◆ on_http_socket_close()

struct us_socket_t * on_http_socket_close | ( | struct us_socket_t * | s,
|  | int | code,
|  | void * | reason
| ) |  |

Definition at line 45 of file http_server.c.

Referenced by main().

Here is the caller graph for this function:

## ◆ on_http_socket_data()

struct us_socket_t * on_http_socket_data | ( | struct us_socket_t * | s,
|  | char * | data,
|  | int | length
| ) |  |

Definition at line 57 of file http_server.c.

References http_context::length, http_socket::offset, http_context::response, SSL, us_socket_context(), us_socket_context_ext(), us_socket_ext(), us_socket_timeout(), and us_socket_write().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_http_socket_end()

struct us_socket_t * on_http_socket_end | ( | struct us_socket_t * | s | ) |

Definition at line 51 of file http_server.c.

References SSL, us_socket_close(), and us_socket_shutdown().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_http_socket_open()

struct us_socket_t * on_http_socket_open | ( | struct us_socket_t * | s,
|  | int | is_client,
|  | char * | ip,
|  | int | ip_length
| ) |  |

Definition at line 71 of file http_server.c.

References http_socket::offset, SSL, us_socket_ext(), and us_socket_timeout().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_http_socket_timeout()

struct us_socket_t * on_http_socket_timeout | ( | struct us_socket_t * | s | ) |

Definition at line 85 of file http_server.c.

References SSL, and us_socket_close().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_http_socket_writable()

struct us_socket_t * on_http_socket_writable | ( | struct us_socket_t * | s | ) |

Definition at line 35 of file http_server.c.

References http_context::length, http_socket::offset, http_context::response, SSL, us_socket_context(), us_socket_context_ext(), us_socket_ext(), and us_socket_write().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ on_post()

void on_post | ( | struct us_loop_t * | loop | ) |

Definition at line 31 of file http_server.c.

Referenced by main().

Here is the caller graph for this function:

## ◆ on_pre()

void on_pre | ( | struct us_loop_t * | loop | ) |

Definition at line 26 of file http_server.c.

Referenced by main().

Here is the caller graph for this function:

## ◆ on_wakeup()

void on_wakeup | ( | struct us_loop_t * | loop | ) |

Definition at line 22 of file http_server.c.

Referenced by main().

Here is the caller graph for this function:

## Variable Documentation

## ◆ SSL

const int SSL = 1

Definition at line 4 of file http_server.c.

Referenced by main(), on_http_socket_data(), on_http_socket_end(), on_http_socket_open(), on_http_socket_timeout(), and on_http_socket_writable().