diff --git a/collects/net/cgi.ss b/collects/net/cgi.rkt similarity index 100% rename from collects/net/cgi.ss rename to collects/net/cgi.rkt diff --git a/collects/net/cookie.ss b/collects/net/cookie.rkt similarity index 100% rename from collects/net/cookie.ss rename to collects/net/cookie.rkt diff --git a/collects/net/dns.ss b/collects/net/dns.rkt similarity index 100% rename from collects/net/dns.ss rename to collects/net/dns.rkt diff --git a/collects/net/ftp.ss b/collects/net/ftp.rkt similarity index 100% rename from collects/net/ftp.ss rename to collects/net/ftp.rkt diff --git a/collects/net/imap.ss b/collects/net/imap.rkt similarity index 100% rename from collects/net/imap.ss rename to collects/net/imap.rkt diff --git a/collects/net/mime-util.ss b/collects/net/mime-util.rkt similarity index 100% rename from collects/net/mime-util.ss rename to collects/net/mime-util.rkt diff --git a/collects/net/mime.ss b/collects/net/mime.rkt similarity index 100% rename from collects/net/mime.ss rename to collects/net/mime.rkt diff --git a/collects/net/nntp.ss b/collects/net/nntp.rkt similarity index 100% rename from collects/net/nntp.ss rename to collects/net/nntp.rkt diff --git a/collects/net/pop3.ss b/collects/net/pop3.rkt similarity index 100% rename from collects/net/pop3.ss rename to collects/net/pop3.rkt diff --git a/collects/net/private/rbtree.ss b/collects/net/private/rbtree.rkt similarity index 100% rename from collects/net/private/rbtree.ss rename to collects/net/private/rbtree.rkt diff --git a/collects/net/qp.ss b/collects/net/qp.rkt similarity index 100% rename from collects/net/qp.ss rename to collects/net/qp.rkt diff --git a/collects/net/scribblings/common.ss b/collects/net/scribblings/common.rkt similarity index 100% rename from collects/net/scribblings/common.ss rename to collects/net/scribblings/common.rkt diff --git a/collects/net/scribblings/info.ss b/collects/net/scribblings/info.rkt similarity index 100% rename from collects/net/scribblings/info.ss rename to collects/net/scribblings/info.rkt diff --git a/collects/net/scribblings/net.scrbl b/collects/net/scribblings/net.scrbl index ca20926846..23128e0fda 100644 --- a/collects/net/scribblings/net.scrbl +++ b/collects/net/scribblings/net.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.ss") -@title{@bold{Net}: PLT Networking Libraries} +@title{@bold{Net}: Racket Networking Libraries} @table-of-contents[] diff --git a/collects/net/scribblings/sendurl.scrbl b/collects/net/scribblings/sendurl.scrbl index 96317df1fb..fc479dac3f 100644 --- a/collects/net/scribblings/sendurl.scrbl +++ b/collects/net/scribblings/sendurl.scrbl @@ -29,16 +29,18 @@ use an intermediate redirecting file due to a bug in IE7.) Under Mac OS X, @scheme[send-url] runs @exec{osascript} to start the user's chosen browser. -Under Unix, @scheme[send-url] uses the value of the -@scheme[external-browser] parameter to select a browser. +Under Unix, @scheme[send-url] uses a user-preference, or when none is +set, it will look for a known browser. See the description of +@scheme[external-browser] for details. The @scheme[url] string is usually escaped to avoid dangerous shell -characters (quotations, dollar signs, backslashes, and non-ASCII). -Note that it is a good idea to encode URLs before passing them to this -function. Also note that the encoding is meant to make the URL work -in shell quotes: URLs can still hold characters like @litchar{#}, -@litchar{?}, and @litchar{&}, so the @scheme[external-browser] should -use quotations.} +characters (quotations, dollar signs, backslashes, and non-ASCII). Note +that it is a good idea to encode URLs before passing them to this +function. + +On all platforms, @scheme[external-browser] parameter can be set to a +procedure to override the above behavior --- the procedure will be +called with the @scheme[url] string.} @defproc[(send-url/file [path path-string?] [separate-window? any/c #t] [#:fragment fragment (or/c string? false/c) #f] @@ -71,20 +73,24 @@ old temporary files are still deleted as described above.} @defparam[external-browser cmd browser-preference?]{ -A parameter that, under Unix, determines the browser started -@scheme[send-url]. +A parameter that can hold a procedure to override how a browser is +started, or @scheme[#f] to use the default platform-dependent command. -The parameter is initialized to the value of the -@scheme['external-browser] preference. +Under Unix, the command that is used depends on the +@scheme['external-browser] preference. If the preference is unset, +@scheme[send-url] uses the first of the browsers from +@scheme[unix-browser-list] for which the executable is found. +Otherwise, the preference should hold a symbol indicating a known +browser (from the @scheme[unix-browser-list]), or it a pair of a prefix +and a suffix string that are concatenated around the @scheme[url] string +to make up a shell command to run. In addition, the +@scheme[external-browser] paremeter can be set to one of these values, +and @scheme[send-url] will use it instead of the preference value. -The parameter value can be any of the symbols in -@scheme[unix-browser-list], @scheme[#f] to indicate that the -preference is unset, or a pair of strings. If the preference is -unset, @scheme[send-url] uses the first of the browsers from -@scheme[unix-browser-list] for which the executable is found. If the -parameter is a pair of strings, then a command line is constructed by -concatenating in order the first string, the URL string, and the -second string. +Note that the URL is encoded to make it work inside shell double-quotes: +URLs can still hold characters like @litchar{#}, @litchar{?}, and +@litchar{&}, so if the @scheme[external-browser] is set to a pair of +prefix/suffix strings, they should use double quotes around the url. If the preferred or default browser can't be launched, @scheme[send-url] fails. See @scheme[get-preference] and diff --git a/collects/net/scribblings/url.scrbl b/collects/net/scribblings/url.scrbl index 56f6e2af0c..bbdcbb90f9 100644 --- a/collects/net/scribblings/url.scrbl +++ b/collects/net/scribblings/url.scrbl @@ -69,9 +69,9 @@ adjusts the behavior. An empty string at the end of the @scheme[path] list corresponds to a URL that ends in a slash. For example, the result of -@scheme[(string->url "http://www.drscheme.org/a/")] has a +@scheme[(string->url "http://racket-lang.org/a/")] has a @scheme[path] field with strings @scheme["a"] and @scheme[""], while -the result of @scheme[(string->url "http://www.drscheme.org/a")] has a +the result of @scheme[(string->url "http://racket-lang.org/a")] has a @scheme[path] field with only the string @scheme["a"]. When a @scheme["file"] URL is represented by a @scheme[url] structure, diff --git a/collects/net/sendmail.ss b/collects/net/sendmail.rkt similarity index 100% rename from collects/net/sendmail.ss rename to collects/net/sendmail.rkt diff --git a/collects/net/sendurl.ss b/collects/net/sendurl.rkt similarity index 100% rename from collects/net/sendurl.ss rename to collects/net/sendurl.rkt diff --git a/collects/net/smtp.ss b/collects/net/smtp.rkt similarity index 100% rename from collects/net/smtp.ss rename to collects/net/smtp.rkt diff --git a/collects/net/ssl-tcp-unit.ss b/collects/net/ssl-tcp-unit.rkt similarity index 100% rename from collects/net/ssl-tcp-unit.ss rename to collects/net/ssl-tcp-unit.rkt diff --git a/collects/net/tcp-redirect.ss b/collects/net/tcp-redirect.rkt similarity index 100% rename from collects/net/tcp-redirect.ss rename to collects/net/tcp-redirect.rkt diff --git a/collects/net/tcp-sig.ss b/collects/net/tcp-sig.rkt similarity index 100% rename from collects/net/tcp-sig.ss rename to collects/net/tcp-sig.rkt diff --git a/collects/net/tcp-unit.ss b/collects/net/tcp-unit.rkt similarity index 100% rename from collects/net/tcp-unit.ss rename to collects/net/tcp-unit.rkt diff --git a/collects/net/unihead.ss b/collects/net/unihead.rkt similarity index 100% rename from collects/net/unihead.ss rename to collects/net/unihead.rkt diff --git a/collects/tests/net/cgi.ss b/collects/tests/net/cgi.rkt similarity index 100% rename from collects/tests/net/cgi.ss rename to collects/tests/net/cgi.rkt diff --git a/collects/tests/net/cookie.ss b/collects/tests/net/cookie.rkt similarity index 92% rename from collects/tests/net/cookie.ss rename to collects/tests/net/cookie.rkt index 601eb3d71f..57200a5927 100644 --- a/collects/tests/net/cookie.ss +++ b/collects/tests/net/cookie.rkt @@ -19,12 +19,12 @@ (syntax-rules () [(o/* x) x] [(o/* x f g ...) (f (o/* x g ...))])) - + (define (tests) - + ;; test the most basic functionality (cookie-test (λ (x) x) "a=b; Version=1") - + ;; test each modifier individually (cookie-test (RC cookie:add-comment "set+a+to+b") "a=b; Comment=set+a+to+b; Version=1") @@ -54,7 +54,7 @@ "a=b; Version=1") (cookie-test (RC cookie:version 12) "a=b; Version=12") - + ;; test combinations (cookie-test (o (RC cookie:add-comment "set+a+to+b") (RC cookie:add-domain ".example.net")) @@ -66,7 +66,7 @@ (RC cookie:version 10) (RC cookie:add-max-age 20)) "a=b; Max-Age=20; Path=\"/whatever/wherever/\"; Version=10") - + ;; test error cases (let () (define-syntax cookie-error-test @@ -78,7 +78,18 @@ (cookie-error-test (RC cookie:add-domain "doesntstartwithadot.example.com")) (cookie-error-test (RC cookie:add-domain "bad domain.com")) (cookie-error-test (RC cookie:add-domain ".bad-domain;com"))) - + + ; cookie value + (test + (cookie-value? "value") + (cookie-value? "(") + (cookie-value? "!") + (cookie-value? ")") + (cookie-value? ")!") + (cookie-value? "(!") + (cookie-value? "(!)") + (cookie-value? "!)")) + ) - + (test do (tests))) diff --git a/collects/tests/net/encoders.ss b/collects/tests/net/encoders.rkt similarity index 95% rename from collects/tests/net/encoders.ss rename to collects/tests/net/encoders.rkt index 3d06130db2..43f77399d7 100644 --- a/collects/tests/net/encoders.ss +++ b/collects/tests/net/encoders.rkt @@ -2,7 +2,7 @@ (require net/base64 net/qp tests/eli-tester) (define tricky-strings - (let ([dir (collection-path "tests" "mzscheme")]) + (let ([dir (collection-path "tests" "racket")]) (list (make-bytes 200 32) (make-bytes 200 9) (make-bytes 200 (char->integer #\x)) @@ -12,12 +12,12 @@ (make-bytes 204 (char->integer #\x)) (list->bytes (for/list ([i (in-range 256)]) i)) ;; Something that doesn't end with a LF: - (bytes-append (with-input-from-file (build-path dir "net.ss") + (bytes-append (with-input-from-file (build-path dir "net.rktl") (lambda () (read-bytes 500))) #"xxx") ;; CRLF: (regexp-replace #rx#"\r?\n" - (with-input-from-file (build-path dir "net.ss") + (with-input-from-file (build-path dir "net.rktl") (lambda () (read-bytes 500))) #"\r\n")))) @@ -55,13 +55,13 @@ (open-input-bytes tricky-string) line-rx max-w)) tricky-strings) - (let* ([dir (collection-path "tests" "mzscheme")] + (let* ([dir (collection-path "tests" "racket")] [files (filter-map (lambda (f) ;; check 1/4 of the files, randomly (let ([p (build-path dir f)]) (and (zero? (random 4)) - (not (regexp-match #rx"^flat.*\\.ss$" + (not (regexp-match #rx"^flat.*\\.rktl$" (path-element->string f))) (file-exists? p) p))) diff --git a/collects/tests/net/head.ss b/collects/tests/net/head.rkt similarity index 100% rename from collects/tests/net/head.ss rename to collects/tests/net/head.rkt diff --git a/collects/tests/net/main.ss b/collects/tests/net/main.rkt similarity index 100% rename from collects/tests/net/main.ss rename to collects/tests/net/main.rkt diff --git a/collects/tests/net/uri-codec.ss b/collects/tests/net/uri-codec.rkt similarity index 100% rename from collects/tests/net/uri-codec.ss rename to collects/tests/net/uri-codec.rkt diff --git a/collects/tests/net/url.ss b/collects/tests/net/url.rkt similarity index 99% rename from collects/tests/net/url.ss rename to collects/tests/net/url.rkt index e6b52ef462..1817082d4b 100644 --- a/collects/tests/net/url.ss +++ b/collects/tests/net/url.rkt @@ -228,8 +228,8 @@ "HTTP://ROBBY@WWW.DRSCHEME.ORG:80/INDEX.HTML;XXX?T=P#YYY") => #("http" "ROBBY" "www.drscheme.org" 80 #t (#("INDEX.HTML" "XXX")) ((T . "P")) "YYY")) - (test-s->u #("mailto" #f #f #f #f (#("robby@plt-scheme.org")) () #f) - "mailto:robby@plt-scheme.org") + (test-s->u #("mailto" #f #f #f #f (#("robby@racket-lang.org")) () #f) + "mailto:robby@racket-lang.org") (test (string->url/vec "http://www.drscheme.org?bar=馨慧") #("http" #f "www.drscheme.org" #f #f () ((bar . "馨慧")) #f)) diff --git a/collects/tests/mzscheme/net.ss b/collects/tests/racket/net.rktl similarity index 84% rename from collects/tests/mzscheme/net.ss rename to collects/tests/racket/net.rktl index 5d804c56e0..9b86f927f5 100644 --- a/collects/tests/mzscheme/net.ss +++ b/collects/tests/racket/net.rktl @@ -1,5 +1,5 @@ -(load-relative "loadtest.ss") +(load-relative "loadtest.rktl") (Section 'net)