authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-11 22:20:55-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:37:11-07:00
log00acf8a66dec78743d26d62e86391b8794a1c627
tree0f668c739a13f5ca9b7164177b17cf6d077edd49
parent50e2a5f673d880515caf3497bfb6eb0114149de1

std.http.Server: remove source code from doc comments

Documentation comments are not an appropriate place to put code samples.

1 files changed, 0 insertions(+), 37 deletions(-)

lib/std/http/Server.zig-37
...@@ -2,43 +2,6 @@...@@ -2,43 +2,6 @@
2//!2//!
3//! This server assumes clients are well behaved and standard compliant; it3//! This server assumes clients are well behaved and standard compliant; it
4//! deadlocks if a client holds a connection open without sending a request.4//! deadlocks if a client holds a connection open without sending a request.
5//!
6//! Example usage:
7//!
8//! ```zig
9//! var server = Server.init(.{ .reuse_address = true });
10//! defer server.deinit();
11//!
12//! try server.listen(bind_addr);
13//!
14//! while (true) {
15//! var res = try server.accept(.{ .allocator = gpa });
16//! defer res.deinit();
17//!
18//! while (res.reset() != .closing) {
19//! res.wait() catch |err| switch (err) {
20//! error.HttpHeadersInvalid => break,
21//! error.HttpHeadersOversize => {
22//! res.status = .request_header_fields_too_large;
23//! res.send() catch break;
24//! break;
25//! },
26//! else => {
27//! res.status = .bad_request;
28//! res.send() catch break;
29//! break;
30//! },
31//! }
32//!
33//! res.status = .ok;
34//! res.transfer_encoding = .chunked;
35//!
36//! try res.send();
37//! try res.writeAll("Hello, World!\n");
38//! try res.finish();
39//! }
40//! }
41//! ```
425
43const builtin = @import("builtin");6const builtin = @import("builtin");
44const std = @import("../std.zig");7const std = @import("../std.zig");