Commit Graph

288 Commits

Author SHA1 Message Date
Jay McCarthy
191874f50f second attempt at removing reliance on tcp. available has been greatly simplified because it relied on the behavior the thread.rktl test is actually testing
original commit: f16e76ca32
2012-10-26 15:26:39 -06:00
Jay McCarthy
7d47105aac Test localhost tcp before running echo server test
original commit: 552fe0f755
2012-10-23 11:28:27 -06:00
Jay McCarthy
eeace01d3b changing tests for environments where listen fails
original commit: 09dd60789a
2012-10-19 15:24:20 -06:00
Jay McCarthy
d9f2ed0abc adding an optional argument to get-pure-port/headers
original commit: a1e855a035
2012-08-16 14:47:09 -06:00
Matthew Flatt
bf4ad3fdb6 move commented-out tests to `test' submodule
original commit: c747af21e3
2012-07-15 10:32:33 -06:00
Eli Barzilay
45ee870f98 Streamline more test suits.
original commit: 6260b4c239
2012-05-24 11:27:13 -04:00
Eli Barzilay
c33561e005 A bunch of fprintf' -> eprintf' conversions (and a few related things).
original commit: 17090fca4f
2012-05-06 12:06:00 -04:00
Robby Findler
51cf8696b3 adjust the contract on string->url so that it actually catches all of
the errors that would be signalled by the body. also, remove
url-regexp from the exports (it was only recently added)

I believe this eliminates two of Eli's concerns:

  - the contract is no longer so painful to read

  - the performance is more reasonable.

Specifically, for the performance, here are the times I see to call
string->url on "http://www.racket-lang.org":

no contract: any/c
cpu time: 564 real time: 566 gc time: 3

weak contract: (-> (or/c string? bytes?) url?)
cpu time: 590 real time: 590 gc time: 3

strong, regexp-based contract:
(-> (or/c (not/c #rx"^([^:/?#]*):") #rx"^[a-zA-Z][a-zA-Z0-9+.-]*:") url?)
cpu time: 632 real time: 633 gc time: 5

This appears to be about a 10% slowdown for the regexp-based contract
over the weaker contract.

related to PR 12652

original commit: 86572cc8c3
2012-03-29 19:31:32 -05:00
Robby Findler
1b243ce46b apply Andy's diff (and adjust the documentation correspondingly)
closes PR 12652

original commit: fdf3fa6492
2012-03-27 12:21:17 -05:00
Eli Barzilay
db82f0dd43 Remove no-longer used net/cgi exceptions.
original commit: 818e434c60
2012-03-16 02:55:35 -04:00
Matthew Flatt
51972b8036 net/imap: add TLS support
Based on a patch from Thomas Spurden

original commit: 537f194c4e
2012-03-10 10:47:22 -07:00
Matthew Flatt
43ad58579f net/smtp: fix auth encoding to not add extra CRLFs
Closes PR 12501

original commit: b656219f8a
2012-02-21 06:14:44 -07:00
Matthew Flatt
dbe90fa15e add optional newline argument to `base64-encode'
original commit: a12f9831a3
2012-02-21 06:14:44 -07:00
Matthew Flatt
e6d06d9bd5 net/mime: allow any subtype, exns as exn:fail subtypes; doc fixes
original commit: 7153fbd4d5
2012-01-08 12:14:51 -07:00
Eli Barzilay
6feb946842 Minor typo in recent new regexp.
original commit: 3fcd3c04d5
2011-12-28 21:07:25 -05:00
Jay McCarthy
83d3a6d984 Synchronizable events from Tom McNulty
original commit: ae31b19168
2011-12-26 14:33:07 -07:00
Eli Barzilay
97f880fb94 More fixes and improvements to `net/unihead'.
* In base64 encoding remove all newlines from the encoded result, avoids
  getting an invalid result.

* In qp encoding:
  - replace all spaces by underlines, not just the first (looks like a
    typo in the previous code)
  - encode "?"s and "_"s too, as required for this encoding
  - remove soft newlines (again, avoid an invalid result)

* Use `regexp-replace*' to encode the parts between the lines.  Besides
  making the code simpler, it fixes a bug in the previous code where
  multiple lines would each get encoded and the results concatenated
  without the newlines or any other whitespace.

* When the string to be encoded is longer than 70 characters, split and
  encode the sub-parts, then concatenate the encodings with a "\n "
  separator.  This is done as a poor attempt to follow the line length
  limits specified in rfc2047, or more concretely, to avoid sendmail's
  "!\n " splitting.

original commit: ed8e3367d4
2011-12-21 14:46:13 -05:00
Eli Barzilay
b232bb25ac Fixes and improvements to `net/unihead'.
* Use `re:non-ascii' to look for a non-ascii character => faster.

* Use either CR or LF for a newline, not just LF.

* Use `regexp-replace*' to encode the parts between the lines.  Besides
  making the code simpler, it fixes a bug in the previous code where
  multiple lines would each get encoded and the results concatenated
  without the newlines or any other whitespace.

original commit: 188c65661d
2011-12-21 14:46:13 -05:00
Eli Barzilay
42503882a8 Quote sender, subject, and recipients strings if needed.
There might be existing uses of `net/sendmail' that did this quoting
since this code didn't do so.  Such uses would continue to work fine,
since quoted strings would already be plain ASCII, so a second quoting
would leave it as is.

Note that the quoted strings are also used as command line arguments.
It seems that sendmail deals with these all fine when they appear as
command line arguments.  This means that any valid email address format
can be used, not just "raw" emails.  If there are some sendmails that
don't do this, then it would be better to add a `-t' flag to let
sendmail parse the text in the message.

One caveat (not a new one): since they're passed as is, it is possible
to use two emails in a single string, as in "a@b.com, c@d.com".  This
could lead to obvious problems if someone uses "Bar, Foo <foo@bar.org>"
instead of "\"Bar, Foo\" <foo@bar.org>".  (Using a `-t' to parse the
content won't help with that...)  The only way to avoid this would be to
parse the emails and quote the name part if needed.  But that's a much
hairier piece of code.

original commit: ddcab952f7
2011-12-20 16:13:13 -05:00
Eli Barzilay
609cd0e81b Revise `net/sendmail'.
* Move the `X-Mailer' header to the top, so that the interesting headers
  are all together at the bottom (the top gets littered by server
  headers anyway).

* Use `subprocess' directly (`process*' wasn't really doing anything
  more than that).

* Allow the sender to be `#f', leaving the header out.  This makes all
  sendmails that I've used use the username that is running the process.

* Just search for a sendmail program: don't barf on windows, so it can
  be used in case there is a sendmail.exe executable there.

* Remove `no-mail-recipients' to make it in-line with other racket code
  that doesn't raise super-specific exceptions.

* Use port counting instead of doing the counts manually, much simpler
  code.

original commit: f9d07d8400
2011-12-20 15:53:40 -05:00
Jay McCarthy
1d9be26746 Fixes PR9965 and a missing doc xref
original commit: 12580337f2
2011-12-07 06:23:25 -07:00
Jay McCarthy
cce647bd8f Revert "Forgot to include doc change"
This reverts commit ccd5061c87.

original commit: 37a7e0a2e1
2011-11-23 11:13:21 -07:00
Jay McCarthy
ad78dea87a Revert "This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it."
This reverts commit 7f9818bb3e.

original commit: 41e04b33da
2011-11-23 11:13:20 -07:00
Jay McCarthy
02759a74df Forgot to include doc change
original commit: ccd5061c87
2011-11-23 10:59:54 -07:00
Jay McCarthy
26326b6235 This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it.
original commit: 7f9818bb3e
2011-11-23 10:59:54 -07:00
Rodolfo Carvalho
7631e920bc Add missing word 'one', clarify behavior of the 'semi-or-amp mode.
original commit: f43405543a
2011-10-17 13:18:17 -04:00
Robby Findler
8f9006e82e add support for redirections to get-pure-port and add get-pure-port/headers
original commit: 11a3d9b0ac
2011-10-03 13:21:30 -05:00
Robby Findler
853e6d7827 adjust the "Transfer-Encoding: chunked" code to re-use bytes more
agressively

original commit: 1fa6129afc
2011-10-03 13:21:29 -05:00
Jon Zeppieri
1431714123 Moved `net/url' code from unit to module.
original commit: d44a7a480a
2011-09-05 15:22:39 -04:00
Jon Zeppieri
d0f1f6fa23 Moved `net/uri-codec' code from unit to module.
original commit: 3f69d4c8e8
2011-09-05 15:22:39 -04:00
Jon Zeppieri
e143a3af4f Moved `net/smtp' code from unit to module.
original commit: 647d3fb365
2011-09-05 15:22:39 -04:00
Jon Zeppieri
3e399465aa Moved `net/sendmail' code from unit to module.
original commit: 9ab674fd0c
2011-09-05 15:22:38 -04:00
Jon Zeppieri
eadd27b8d0 Moved `net/qp' code from unit to module.
original commit: d034297c76
2011-09-05 15:22:38 -04:00
Jon Zeppieri
185aa9c20a Moved `net/pop3' code from unit to module.
original commit: 54deaac318
2011-09-05 15:22:38 -04:00
Jon Zeppieri
6728cc4597 Moved `net/nntp' code from unit to module.
original commit: df5fef0c95
2011-09-05 15:22:38 -04:00
Jon Zeppieri
96dfe15d91 Moved `net/mime' code from unit to module.
original commit: 67ca846fd9
2011-09-05 15:22:38 -04:00
Jon Zeppieri
120ab7af22 Moved `net/imap' code from unit to module.
original commit: 9ae3840211
2011-09-05 15:22:38 -04:00
Jon Zeppieri
944338b0f6 Moved `net/head' code from unit to module.
original commit: 095ee4e007
2011-09-05 15:22:38 -04:00
Jon Zeppieri
1a0336d99b Moved `net/ftp' code from unit to module.
original commit: 03237c06f2
2011-09-05 15:22:38 -04:00
Jon Zeppieri
e16b530ded Moved `net/dns' code from unit to module.
original commit: a0eac7ac5c
2011-09-05 15:22:38 -04:00
Jon Zeppieri
2add6a09dc Moved `net/cgi' code from unit to module.
original commit: a5222b9481
2011-09-05 14:17:36 -04:00
Jon Zeppieri
932ab5feab Moved `net/base64' code from unit to module.
original commit: 0104198875
2011-09-05 14:13:04 -04:00
Matthew Flatt
55e9e0ddd7 trivial doc fix
original commit: 1b0abe85c7
2011-08-19 12:52:19 -06:00
Jay McCarthy
9dfe50c8cf De-unitizing cookies and making the serializable
original commit: b207f1051a
2011-08-15 10:06:21 -06:00
Eli Barzilay
c75da5fd97 Lots of documentation formatting.
Started as fixing misindented definitions, then more indentations, then
a bunch of similar things (square brackets, huge spaces at end-of-lines,
etc).

original commit: d61eb53686
2011-08-15 07:50:04 -04:00
Eli Barzilay
62e93cf2a4 Heavily revise this test.
- Simplify code
- Remove bogus leftover (tests) in the end
- Resolve deadlock that resulted from using `tcp-abandon-port' in
  `net/ftp'
- Actually there's no need for threads, probably because of small size
  of data, so keep it.
- Use scribble syntax instead of here-strings, and move the text out of
  the way.

original commit: f297c98c1a
2011-08-15 02:37:39 -04:00
Matthew Flatt
b342b9b044 fix doc typos
original commit: be0260792e
2011-08-10 08:28:13 -06:00
Eli Barzilay
c2e489dc78 Add an optional path argument to `ftp-directory-list'.
original commit: 5a7ddd6611
2011-08-05 01:14:16 -04:00
Eli Barzilay
6a6f849c5c Return a file size string when possible.
This takes the advice from
  http://files.stairways.com/other/ftp-list-specs-info.txt
further: search for the date by an explicit occurrence of a known month
name.  This means that we won't see files with bad names (they'd be
filtered out of the result), but the filtered out entries are ones that
would not be usable with `ftp-make-file-seconds'.

When the month is found, and the entry is a file, look for a number
preceding the month, and if found, return it as the file size string.
This is a minor change in the API.  (But it's probably better to either
revise it further, or eventually make it irrelevant by exposing the
interesting functionality via `net/url'.)

original commit: 6a1336e75e
2011-08-05 01:14:16 -04:00
Eli Barzilay
55405d017b Make `ftp-make-file-seconds' use a correct year instead of 2002.
This function was using 2002 when there's no year...  Updated it to use
the last occurrence of the guessed date, as described at
  http://files.stairways.com/other/ftp-list-specs-info.txt

This function still looks pretty bogus -- the RFC does *not* say
anything about the format of response to `LIST', so it's whatever
semi-random thing the server does.  (The above link looks like an
attempt to fix it, but I didn't see anything more official than that.)
From some looking around, it looks like ftp clients just try a bunch of
patterns against the text.  Add also warnings in the documentation about
this.

original commit: 234015b34d
2011-08-05 01:14:16 -04:00