aboutsummaryrefslogtreecommitdiffstats
path: root/server.go
diff options
context:
space:
mode:
authorLibravatarLibravatar Drew DeVault <[email protected]> 2020-10-29 15:18:36 -0400
committerLibravatarLibravatar Drew DeVault <[email protected]> 2020-10-29 15:18:36 -0400
commita393429f01e63aa37f58f8cbe4a810e59852fa61 (patch)
treece24cbc869e3cdda0b13e9fa3d9e34ff192c868a /server.go
parent490420726952bb3834e6a1cdda7a26c90ba9a7cb (diff)
downloadalps-a393429f01e63aa37f58f8cbe4a810e59852fa61.tar.gz
alps-a393429f01e63aa37f58f8cbe4a810e59852fa61.tar.bz2
alps-a393429f01e63aa37f58f8cbe4a810e59852fa61.zip
Implement JavaScript UI for attachments
This one is a bit of a doozy. A summary of the changes: - Session has grown storage for attachments which have been uploaded but not yet sent. - The list of attachments on a message is refcounted so that we can clean up the temporary files only after it's done with - i.e. after copying to Sent and after all of the SMTP attempts are done. - Abandoned attachments are cleared out on process shutdown. Future work: - Add a limit to the maximum number of pending attachments the user can have in the session. - Periodically clean out abandoned attachments?
Diffstat (limited to 'server.go')
-rw-r--r--server.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/server.go b/server.go
index dc2708e..7a82d35 100644
--- a/server.go
+++ b/server.go
@@ -73,6 +73,10 @@ func newServer(e *echo.Echo, options *Options) (*Server, error) {
return s, nil
}
+func (s *Server) Close() {
+ s.Sessions.Close()
+}
+
func parseUpstream(s string) (*url.URL, error) {
if !strings.ContainsAny(s, ":/") {
// This is a raw domain name, make it an URL with an empty scheme