Browse Source

server: better names for arguments to Server.

Dmitry Chestnykh 14 years ago
parent
commit
a7f7c63988
2 changed files with 6 additions and 4 deletions
  1. 2 2
      README.md
  2. 4 2
      server.go

+ 2 - 2
README.md

@@ -118,7 +118,7 @@ will write the new one).
 
 ### func Server
 
-	func Server(w, h int) http.Handler
+	func Server(imgWidth, imgHeight int) http.Handler
 	
 Server returns a handler that serves HTTP requests with image or
 audio representations of captchas. Image dimensions are accepted as
@@ -131,7 +131,7 @@ with id "B9QTvDV1RXbVJ3Ac", and for "B9QTvDV1RXbVJ3Ac.wav" it serves the
 same captcha in audio format.
 
 To serve a captcha as a downloadable file, the URL must be constructed in
-such a way as if the file to serve is in "download" subdirectory:
+such a way as if the file to serve is in the "download" subdirectory:
 "/download/B9QTvDV1RXbVJ3Ac.wav".
 
 To reload captcha (get a different solution for the same captcha id), append

+ 4 - 2
server.go

@@ -23,14 +23,16 @@ type captchaHandler struct {
 // same captcha in audio format.
 //
 // To serve a captcha as a downloadable file, the URL must be constructed in
-// such a way as if the file to serve is in "download" subdirectory:
+// such a way as if the file to serve is in the "download" subdirectory:
 // "/download/B9QTvDV1RXbVJ3Ac.wav".
 //
 // To reload captcha (get a different solution for the same captcha id), append
 // "?reload=x" to URL, where x may be anything (for example, current time or a
 // random number to make browsers refetch an image instead of loading it from
 // cache).
-func Server(w, h int) http.Handler { return &captchaHandler{w, h} }
+func Server(imgWidth, imgHeight int) http.Handler { 
+	return &captchaHandler{imgWidth, imgHeight}
+}
 
 func (h *captchaHandler) serve(w http.ResponseWriter, id, ext string, download bool) os.Error {
 	if download {