aboutsummaryrefslogtreecommitdiff
path: root/comments/src
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2024-02-01 14:39:26 +0000
committerMartin Ashby <martin@ashbysoft.com>2024-02-01 14:39:26 +0000
commit8b47802e383dde95650f9d24e88c2f67f6596a98 (patch)
tree079ed8f37b793036812b8732b8625bc423e03572 /comments/src
parenta3ed80acdbd1b92e61fbe50b0e38e05e82583503 (diff)
downloadmfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.gz
mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.bz2
mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.xz
mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.zip
Update for zig master
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,