about summary refs log tree commit diff stats
path: root/src/loader/connecterror.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-30 02:51:13 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-30 03:07:15 +0200
commit8048a943706ee32f5970e461dda0a01aeb55c27f (patch)
treea9456532629274491e7ccfdc0b7773da247e58a1 /src/loader/connecterror.nim
parentef8124638b6b056a4721918b47fc00a349ab0da1 (diff)
downloadchawan-8048a943706ee32f5970e461dda0a01aeb55c27f.tar.gz
loader: add local-cgi
Add w3m-style local CGI support.

It is not quite as powerful as w3m's local CGI, because it lacks an
equivalent to W3m-control. Not sure if it's worth adding; we certainly
shouldn't allow passing JS in headers, but a custom language for
headers does not sound like a great idea either...

eh, idk. also, TODO add multipart
Diffstat (limited to 'src/loader/connecterror.nim')
-rw-r--r--src/loader/connecterror.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/loader/connecterror.nim b/src/loader/connecterror.nim
index 5fce5287..f10285d2 100644
--- a/src/loader/connecterror.nim
+++ b/src/loader/connecterror.nim
@@ -1,13 +1,17 @@
 import bindings/curl
 
 type ConnectErrorCode* = enum
+  ERROR_CGI_FILE_NOT_FOUND = (-12, "CGI file not found")
+  ERROR_INVALID_CGI_PATH = (-11, "invalid CGI path")
+  ERROR_FAIL_SETUP_CGI = (-10, "failed to set up CGI script")
+  ERROR_NO_CGI_DIR = (-9, "no local-CGI directory configured")
   ERROR_INVALID_METHOD = (-8, "invalid method")
   ERROR_INVALID_DATA_URL = (-7, "invalid data URL")
   ERROR_ABOUT_PAGE_NOT_FOUND = (-6, "about page not found")
   ERROR_FILE_NOT_FOUND = (-5, "file not found")
-  ERROR_SOURCE_NOT_FOUND = (-4, "clone source could not be found"),
-  ERROR_LOADER_KILLED = (-3, "loader killed during transfer"),
-  ERROR_DISALLOWED_URL = (-2, "url not allowed by filter"),
+  ERROR_SOURCE_NOT_FOUND = (-4, "clone source could not be found")
+  ERROR_LOADER_KILLED = (-3, "loader killed during transfer")
+  ERROR_DISALLOWED_URL = (-2, "url not allowed by filter")
   ERROR_UNKNOWN_SCHEME = (-1, "unknown scheme")
 
 converter toInt*(code: ConnectErrorCode): int =