aboutsummaryrefslogtreecommitdiff
path: root/comments/src
diff options
context:
space:
mode:
Diffstat (limited to 'comments/src')
-rw-r--r--comments/src/main.zig41
1 files changed, 21 insertions, 20 deletions
diff --git a/comments/src/main.zig b/comments/src/main.zig
index 8710d95..ac8193e 100644
--- a/comments/src/main.zig
+++ b/comments/src/main.zig
@@ -7,33 +7,34 @@ const smtp = @import("smtp");
const Params = zws.Params;
const Err = error{
- Unexpected,
AccessDenied,
- OutOfMemory,
- InputOutput,
- SystemResources,
- IsDir,
- OperationAborted,
BrokenPipe,
+ ColumnNotFound,
ConnectionResetByPeer,
ConnectionTimedOut,
- NotOpenForReading,
- NetNameDeleted,
- WouldBlock,
- StreamTooLong,
- Malformatted,
- InvalidLength,
- InvalidCharacter,
- NoSpaceLeft,
- PqError,
- ColumnNotFound,
+ DeviceBusy,
DiskQuota,
FileTooBig,
- DeviceBusy,
+ InputOutput,
InvalidArgument,
- NotOpenForWriting,
- LockViolation,
+ InvalidCharacter,
+ InvalidLength,
InvalidRequestMethod,
+ IsDir,
+ LockViolation,
+ Malformatted,
+ NetNameDeleted,
+ NoSpaceLeft,
+ NotOpenForReading,
+ NotOpenForWriting,
+ OperationAborted,
+ OutOfMemory,
+ PqError,
+ SocketNotConnected,
+ StreamTooLong,
+ SystemResources,
+ Unexpected,
+ WouldBlock,
};
const Ctx = struct {
db: pq.Db,
@@ -204,7 +205,7 @@ fn get_comment(res: *Response, ctx: Ctx, _: Params) Err!void {
fn post_comment(res: *Response, ctx: Ctx, _: Params) Err!void {
var body_aa = std.ArrayList(u8).init(res.allocator);
try res.reader().readAllArrayList(&body_aa, 1_000_000);
- var body = try body_aa.toOwnedSlice();
+ const body = try body_aa.toOwnedSlice();
var form = try zws.Form.parse(res.allocator, body);
const Form = struct {
url: []const u8,