Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
03e73782
Commit
03e73782
authored
Dec 05, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made URI handler work
parent
95d88814
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
207 additions
and
233 deletions
+207
-233
core.c
build/src/core.c
+197
-227
core.h
build/src/core.h
+10
-6
No files found.
build/src/core.c
View file @
03e73782
This diff is collapsed.
Click to expand it.
build/src/core.h
View file @
03e73782
...
@@ -33,15 +33,19 @@ struct mg_connection {
...
@@ -33,15 +33,19 @@ struct mg_connection {
const
char
*
uri
;
// URL-decoded URI
const
char
*
uri
;
// URL-decoded URI
const
char
*
http_version
;
// E.g. "1.0", "1.1"
const
char
*
http_version
;
// E.g. "1.0", "1.1"
const
char
*
query_string
;
// URL part after '?', not including '?', or NULL
const
char
*
query_string
;
// URL part after '?', not including '?', or NULL
long
remote_ip
;
// Client's IP address
long
remote_ip
;
// Client's IP address
int
remote_port
;
// Client's port
int
remote_port
;
// Client's port
int
is_ssl
;
// 1 if SSL-ed, 0 if not
int
num_headers
;
// Number of HTTP headers
int
num_headers
;
// Number of HTTP headers
struct
mg_header
{
struct
mg_header
{
const
char
*
name
;
// HTTP header name
const
char
*
name
;
// HTTP header name
const
char
*
value
;
// HTTP header value
const
char
*
value
;
// HTTP header value
}
http_headers
[
64
];
// Maximum 64 headers
}
http_headers
[
64
];
// Maximum 64 headers
char
*
content
;
// POST (or websocket message) data, or NULL
int
content_len
;
// content length
void
*
server_param
;
// Parameter passed to mg_add_uri_handler()
void
*
server_param
;
// Parameter passed to mg_add_uri_handler()
void
*
connection_param
;
// Placeholder for connection-specific data
void
*
connection_param
;
// Placeholder for connection-specific data
};
};
...
@@ -64,16 +68,16 @@ const char **mg_get_valid_option_names(void);
...
@@ -64,16 +68,16 @@ const char **mg_get_valid_option_names(void);
const
char
*
mg_get_option
(
const
struct
mg_server
*
server
,
const
char
*
name
);
const
char
*
mg_get_option
(
const
struct
mg_server
*
server
,
const
char
*
name
);
// Websocket functions
// Websocket functions
void
mg_websocket_handshake
(
struct
mg_connection
*
);
//
void mg_websocket_handshake(struct mg_connection *);
int
mg_websocket_read
(
struct
mg_connection
*
,
int
*
bits
,
char
**
data
);
//
int mg_websocket_read(struct mg_connection *, int *bits, char **data);
int
mg_websocket_write
(
struct
mg_connection
*
conn
,
int
opcode
,
//
int mg_websocket_write(struct mg_connection* conn, int opcode,
const
char
*
data
,
size_t
data_len
);
//
const char *data, size_t data_len);
// Connection management functions
// Connection management functions
int
mg_write
(
struct
mg_connection
*
,
const
void
*
buf
,
int
len
);
int
mg_write
(
struct
mg_connection
*
,
const
void
*
buf
,
int
len
);
int
mg_printf
(
struct
mg_connection
*
,
const
char
*
fmt
,
...);
#if 0
#if 0
int mg_printf(struct mg_connection *, const char *fmt, ...);
void mg_send_file(struct mg_connection *, const char *path);
void mg_send_file(struct mg_connection *, const char *path);
int mg_read(struct mg_connection *, void *buf, int len);
int mg_read(struct mg_connection *, void *buf, int len);
const char *mg_get_header(const struct mg_connection *, const char *name);
const char *mg_get_header(const struct mg_connection *, const char *name);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment