diff --git a/docs/README.md b/docs/README.md index eeb9cc8f..4bcb9bc8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3890,7 +3890,7 @@ mg_iobuf_add(&io, 0, "hi", 2); // io->len is 2, io->size is 512 mg_iobuf_del(&io, 0, "hi", 2); // io->len is 0, io->size is still 512 ``` -Function mg_iobuf_del() +Function mg_iobuf_del() ## URL diff --git a/docs/images/mg_commalist.svg b/docs/images/mg_commalist.svg index 3b2a50c1..9ea9fa44 100644 --- a/docs/images/mg_commalist.svg +++ b/docs/images/mg_commalist.svg @@ -1,11 +1,11 @@ - + + viewBox="0 0 1034 239" style="enable-background:new 0 0 1034 239;" xml:space="preserve"> - + - struct mg_str k,v,s = mg_str(”a=333, b=777”); + + struct mg_str k,v,s = mg_str(”a=333, b=777”); + + + + + mg_commalist(&s, &k, &v); + + + + + mg_commalist(&s, &k, &v); + + + + + // 1st call + // 2nd call + + - mg_commalist(&s, &k, &v); + + + + + + + - mg_commalist(&s, &k, &v); + + + + + + + - // 1st call - // 2nd call + + + + + + - - - - + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/images/mg_http_get_request_len.png b/docs/images/mg_http_get_request_len.png deleted file mode 100644 index 8a1ef931..00000000 Binary files a/docs/images/mg_http_get_request_len.png and /dev/null differ diff --git a/docs/images/mg_http_get_request_len.svg b/docs/images/mg_http_get_request_len.svg index dd8aec62..62d9abef 100644 --- a/docs/images/mg_http_get_request_len.svg +++ b/docs/images/mg_http_get_request_len.svg @@ -1,46 +1,48 @@ - + + viewBox="0 0 1034 158.07" style="enable-background:new 0 0 1034 158.07;" xml:space="preserve"> - -GET /test \n\nGET /test \n\nGET test \n\n - - - - - - 1st request + + GET /test \n\nGET /test \n\nGET test \n\n - - + + + - - - 2nd request - - + 1st request + + + + - - - 3rd request - - + 2nd request + + + + + + + 3rd request + + + + diff --git a/docs/images/mg_http_message.png b/docs/images/mg_http_message.png deleted file mode 100644 index 11ffdda7..00000000 Binary files a/docs/images/mg_http_message.png and /dev/null differ diff --git a/docs/images/mg_http_message.svg b/docs/images/mg_http_message.svg index 3207617c..e3db9f5b 100644 --- a/docs/images/mg_http_message.svg +++ b/docs/images/mg_http_message.svg @@ -1,5 +1,5 @@ - + - - - + + - + - - + + + + + + - - -struct mg_http_message { -struct mg_str method; uri, query, proto; struct mg_http_header headers[MG_MAX_HTTP_HEADERS];struct mg_str body;struct mg_str message; - - - - - - - - - - - - - - - -POST /foo/bar/baz?aa=b&cc=ddd HTTP/1.1Content-Type: application/jsonContent-Length: 19Host: reqbin.com - + struct mg_http_message { + struct mg_str method; uri, query, proto; + struct mg_http_header headers[MG_MAX_HTTP_HEADERS]; + struct mg_str body; + struct mg_str message; - - + + - + - - - + + + + + + + + + POST /foo/bar/baz?aa=b&cc=ddd HTTP/1.1 + Content-Type: application/json + Content-Length: 19 + Host: reqbin.com - - + + + + + - + - - -{"success": "true"} - -Source Code -HTTP message -}; - - - - + + + + + + + + + + {"success": "true"} + + Source Code + HTTP message + }; + + + + + + + - diff --git a/docs/images/mg_http_next_multipart.svg b/docs/images/mg_http_next_multipart.svg index f3481f34..ca7c301c 100644 --- a/docs/images/mg_http_next_multipart.svg +++ b/docs/images/mg_http_next_multipart.svg @@ -1,98 +1,109 @@ - + + viewBox="0 0 1034 663.54" style="enable-background:new 0 0 1034 663.54;" xml:space="preserve"> - - - - - - - - - - - + + - struct mg_http_part part;size_t pos = 0;pos = mg_http_next_multipart(&hm->body, pos, &part);pos = mg_http_next_multipart(&hm->body, pos, &part); + - - Source Code - - - - - - - - - HTTP message + - POST /upload HTTP/1.1 Content-Type: multipart/form-data; boundary="--xyz"--xyzContent-Disposition: form-data; name="foo"; filename="a.txt"Content-Type: text/plainhello world--xyz---Content-Disposition: form-data; name="bar"; filename="b.txt"Content-Type: text/plainhello world again--xyz-- - - - - - + - - - + + struct mg_http_part part; + size_t pos = 0; + pos = mg_http_next_multipart(&hm->body, pos, &part); + pos = mg_http_next_multipart(&hm->body, pos, &part); + - + Source Code - - - - - - - - - + + + + + + HTTP message + + + POST /upload HTTP/1.1 + Content-Type: multipart/form-data; boundary="--xyz" + --xyz + Content-Disposition: form-data; name="foo"; filename="a.txt" + Content-Type: text/plain + hello world + --xyz--- + Content-Disposition: form-data; name="bar"; filename="b.txt" + Content-Type: text/plain + hello world again + --xyz-- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Part 1 + Part 2 -Part 1 -Part 2 diff --git a/docs/images/mg_http_part.svg b/docs/images/mg_http_part.svg index 296b6ed8..711d2b93 100644 --- a/docs/images/mg_http_part.svg +++ b/docs/images/mg_http_part.svg @@ -1,83 +1,94 @@ - + + viewBox="0 0 1034 480.6" style="enable-background:new 0 0 1034 480.6;" xml:space="preserve"> - - - POST /upload HTTP/1.1 Content-Type: multipart/form-data: boundary="--xyz"--xyzContent-Disposition: form-data; name="foo"; filename="a.txt"Content-Type: text/plainhello world--xyz--- - - -HTTP part -HTTP message - - - - struct mg_http_part { - struct mg_str name;strucy mg_str filename;struct mg_str body; - - - - - - + - - + + POST /upload HTTP/1.1 + Content-Type: multipart/form-data: boundary="--xyz" + --xyz + Content-Disposition: form-data; name="foo"; filename="a.txt" + Content-Type: text/plain + hello world + --xyz--- - - - - - + HTTP part + HTTP message + - - + struct mg_http_part { + struct mg_str name; + strucy mg_str filename; + struct mg_str body; - - - -Source Code -}; - + + + + + + + + + + + + + - - + + + + + - + + + Source Code + }; + + + + + + + + + - diff --git a/docs/images/mg_http_reply.svg b/docs/images/mg_http_reply.svg index 44dadde2..c9241d3f 100644 --- a/docs/images/mg_http_reply.svg +++ b/docs/images/mg_http_reply.svg @@ -1,14 +1,14 @@ - + + viewBox="0 0 1034 331.2" style="enable-background:new 0 0 1034 331.2;" xml:space="preserve"> - - + - HTTP/1.1 200 OK - Content-Length; 13 - X-Header-1: additional value 1 - X-Header-2: additional value 2 - Hello, world! - - -HTTP message - - - mg_http_reply(c, 200 - "X-Header-1: additional value 1\r\n" - "X-Header-2: additional value 2\r\n", - "Hello, %s!", "world"); - - - - - - + - - + HTTP/1.1 200 OK + Content-Length; 13 + X-Header-1: additional value 1 + X-Header-2: additional value 2 + Hello, world! - - - + HTTP message - - + mg_http_reply(c, 200 + "X-Header-1: additional value 1\r\n" + "X-Header-2: additional value 2\r\n", + "Hello, %s!", "world"); - - - -Source Code - - - - - - + + + + + + + + + + + + + + + + + + + + Source Code + + + + + + + + + + + - - diff --git a/docs/images/mg_iobuf.svg b/docs/images/mg_iobuf.svg index ebbf9435..859d4c92 100644 --- a/docs/images/mg_iobuf.svg +++ b/docs/images/mg_iobuf.svg @@ -1,112 +1,120 @@ - + + viewBox="0 0 869.6 185.67" style="enable-background:new 0 0 869.6 185.67;" xml:space="preserve"> -Memory - + Memory + - - - - - - - - - - - - - - - - - buf - - - - - - - - - len - - - - - - - - - - - size - - - - - - - - - - - - data + + + + + + + + + + + + - free space + buf - + - - - - - - - - - - + - + len + + + + + - + - + size + + + + + - + + + + + + + data + + + + free space + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/mg_iobuf_add1.svg b/docs/images/mg_iobuf_add1.svg index 00486268..b408b7a3 100644 --- a/docs/images/mg_iobuf_add1.svg +++ b/docs/images/mg_iobuf_add1.svg @@ -1,51 +1,51 @@ - + + viewBox="0 0 869 124.66" style="enable-background:new 0 0 869 124.66;" xml:space="preserve"> - - - - - - - - - - + + + + + + + + + + - buf=NULL, len=0, size=0 + buf=NULL, len=0, size=0 - 0 + 0 - + - + - - - - + + + + diff --git a/docs/images/mg_iobuf_add2.svg b/docs/images/mg_iobuf_add2.svg index 9d26e8d3..e93fe8b2 100644 --- a/docs/images/mg_iobuf_add2.svg +++ b/docs/images/mg_iobuf_add2.svg @@ -1,16 +1,16 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - buf - - - - - - - - - len=5 - - - - - - - - - - - size=16 - - - - - - - - - - - - - - - - - - - - - - - data + + + + + + + + + + + + + + + + + + + + + + + + + + + - free space + buf - + - + + + + + len=5 + + + + - + + + + + + size=16 + + + + + + + + + + + + + + + + + + + + + + + data + + + free space + + + + + + + + + + + + + + + + + + + + + + + + + non-allocated space + + + + + + + + + + + + + + + - - - - - - - - - - - non-allocated space - - - - - - - + h - - - - + e - - - h + + l + - - - e + + l + - - - l - - - - - l - - - - - o + + o + + + 0 + + - - 0 - - diff --git a/docs/images/mg_iobuf_del.svg b/docs/images/mg_iobuf_del.svg new file mode 100644 index 00000000..997f719e --- /dev/null +++ b/docs/images/mg_iobuf_del.svg @@ -0,0 +1,347 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + buf + + + + + + + + + + + len=5 + + + + + + + + + + + size=16 + + + + + + + + + + + + + + + + + + + + + + + data + + + free space + + + + + + + + + + + + + + + + + + + + + + + + + non-allocated space + + + + + + + + + + + + + + + + + + + + + h + + + + + + e + + + + + + + l + + + + + + + l + + + + + + o + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + buf + + + + + + + + + + + len=2 + + + + + + + + + + + size=16 + + + + + + + + + + + + + + + + + + + + + + + data + + + free space + + + + + + + + + + + + + + + + + + + + + + + + + non-allocated space + + + + + + + + + + + + + + + + + + + + + h + + + + + o + + + + + + + 0 + + + + diff --git a/docs/images/mg_iobug_del.png b/docs/images/mg_iobug_del.png deleted file mode 100644 index 52b8e154..00000000 Binary files a/docs/images/mg_iobug_del.png and /dev/null differ diff --git a/docs/images/packed2.png b/docs/images/packed2.png deleted file mode 100644 index ada6a024..00000000 Binary files a/docs/images/packed2.png and /dev/null differ