Skip to content

Instantly share code, notes, and snippets.

@alexott
Created August 13, 2012 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexott/3340127 to your computer and use it in GitHub Desktop.
Save alexott/3340127 to your computer and use it in GitHub Desktop.
Example to reproduce thread leak in ring-core (when parsing multipart uploads)
(ns rtest.core
(:gen-class)
(:use [ring.middleware params multipart-params keyword-params]
ring.adapter.jetty
)
)
(defn handler [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body (str "File upload: "
(:multipart-params request))
})
(def app
(-> handler
wrap-params
wrap-keyword-params
wrap-multipart-params))
(defn -main [& args]
(run-jetty app {:port 3000}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment