From 6cd65dddb118419f3dbb01d71de69ae9d84edc21 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 9 Oct 2004 20:02:01 +0000 Subject: [PATCH] . original commit: 266a43bafffc8738446b98dcf7c9b29f145922c8 --- collects/net/imap-unit.ss | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/collects/net/imap-unit.ss b/collects/net/imap-unit.ss index dd6e3f1..ca1e6f6 100644 --- a/collects/net/imap-unit.ss +++ b/collects/net/imap-unit.ss @@ -272,7 +272,16 @@ expunges fetches new?)) (define (imap-connection? v) (imap? v)) - (define imap-port-number (make-parameter 143)) + (define imap-port-number (make-parameter 143 + (lambda (v) + (unless (and (number? v) + (exact? v) + (integer? v) + (<= 1 v 65535)) + (raise-type-error 'imap-port-number + "exact integer in [1,65535]" + v)) + v))) (define (imap-connect* r w username password inbox) (with-handlers ([void