Commit Graph

273 Commits

Author SHA1 Message Date
Matthew Flatt
e4e4d544f5 net/imap: log to an 'imap logger 2012-11-23 18:44:51 -07:00
Eli Barzilay
586b323430 #lang racket' -> #lang racket/base' conversions in net/websocket. 2012-11-07 08:03:46 -05:00
Eli Barzilay
14d8c8b5a5 Newlines at EOFs. 2012-11-06 14:07:15 -05:00
Danny Yoo
dcf4d8b040 adding close-eval at the end of scribble files that have a toplevel evaluator 2012-11-01 15:32:53 -06:00
John Clements
1f02a0a8b8 exposed mapping for unreserved characters 2012-11-01 12:38:09 -07:00
Marc Burns
25bc661a03 Fix socket leak on redirected `*-pure-port' calls.
A port over which a redirection is served to get-pure-port is not closed
if `get-pure-port' follows the redirection.  This leaks file descriptors
on the host machine.
2012-10-05 11:14:38 -04:00
Matthew Flatt
3fb42cf3f1 scribble/html-properties: allow URLs in css-addition' and js-addition' 2012-09-11 18:52:59 -06:00
Jay McCarthy
a1e855a035 adding an optional argument to get-pure-port/headers 2012-08-16 14:47:09 -06:00
Jay McCarthy
23226b41da Preserve scheme, user, host, and port if the redirection doesn't have them 2012-08-14 21:34:02 -06:00
Jay McCarthy
f2e0e0bfeb get-port-port/headers should not remove status line 2012-08-14 21:34:01 -06:00
Matthew Flatt
c747af21e3 move commented-out tests to `test' submodule 2012-07-15 10:32:33 -06:00
Eli Barzilay
17090fca4f A bunch of fprintf' -> eprintf' conversions (and a few related things). 2012-05-06 12:06:00 -04:00
Robby Findler
f5449f38e8 adjust url-exception so it recognizes the same exceptions it used to 2012-04-01 22:16:35 -05:00
Robby Findler
97b76d474e some cleanups, thanks to Eli 2012-03-30 10:44:42 -05:00
Robby Findler
86572cc8c3 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
2012-03-29 19:31:32 -05:00
Robby Findler
fdf3fa6492 apply Andy's diff (and adjust the documentation correspondingly)
closes PR 12652
2012-03-27 12:21:17 -05:00
Eli Barzilay
818e434c60 Remove no-longer used net/cgi exceptions. 2012-03-16 02:55:35 -04:00
Matthew Flatt
537f194c4e net/imap: add TLS support
Based on a patch from Thomas Spurden
2012-03-10 10:47:22 -07:00
Eli Barzilay
f7c67b49a4 Big newline at EOF scan. 2012-02-29 00:28:11 -05:00
Matthew Flatt
b656219f8a net/smtp: fix auth encoding to not add extra CRLFs
Closes PR 12501
2012-02-21 06:14:44 -07:00
Matthew Flatt
a12f9831a3 add optional newline argument to `base64-encode' 2012-02-21 06:14:44 -07:00
Eli Barzilay
999e481785 Fix apparent bug.
In the new-ish code for following redirections, the `strings' argument
wasn't passed along as it did before.
2012-02-01 21:51:47 -05:00
Matthew Flatt
7153fbd4d5 net/mime: allow any subtype, exns as exn:fail subtypes; doc fixes 2012-01-08 12:14:51 -07:00
Eli Barzilay
3fcd3c04d5 Minor typo in recent new regexp. 2011-12-28 21:07:25 -05:00
Jay McCarthy
9723e939b4 Merge branch 'master' of git.racket-lang.org:plt 2011-12-26 14:33:20 -07:00
Jay McCarthy
ae31b19168 Synchronizable events from Tom McNulty 2011-12-26 14:33:07 -07:00
Eli Barzilay
ed8e3367d4 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.
2011-12-21 14:46:13 -05:00
Eli Barzilay
188c65661d 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.
2011-12-21 14:46:13 -05:00
Eli Barzilay
ddcab952f7 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.
2011-12-20 16:13:13 -05:00
Eli Barzilay
f9d07d8400 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.
2011-12-20 15:53:40 -05:00
Jay McCarthy
12580337f2 Fixes PR9965 and a missing doc xref 2011-12-07 06:23:25 -07:00
Jay McCarthy
37a7e0a2e1 Revert "Forgot to include doc change"
This reverts commit ccd5061c87.
2011-11-23 11:13:21 -07:00
Jay McCarthy
41e04b33da 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.
2011-11-23 11:13:20 -07:00
Jay McCarthy
ccd5061c87 Forgot to include doc change 2011-11-23 10:59:54 -07:00
Jay McCarthy
7f9818bb3e 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. 2011-11-23 10:59:54 -07:00
Rodolfo Carvalho
f43405543a Add missing word 'one', clarify behavior of the 'semi-or-amp mode. 2011-10-17 13:18:17 -04:00
Robby Findler
11a3d9b0ac add support for redirections to get-pure-port and add get-pure-port/headers 2011-10-03 13:21:30 -05:00
Robby Findler
1fa6129afc adjust the "Transfer-Encoding: chunked" code to re-use bytes more
agressively
2011-10-03 13:21:29 -05:00
Jon Zeppieri
d44a7a480a Moved `net/url' code from unit to module. 2011-09-05 15:22:39 -04:00
Jon Zeppieri
3f69d4c8e8 Moved `net/uri-codec' code from unit to module. 2011-09-05 15:22:39 -04:00
Jon Zeppieri
647d3fb365 Moved `net/smtp' code from unit to module. 2011-09-05 15:22:39 -04:00
Jon Zeppieri
9ab674fd0c Moved `net/sendmail' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
d034297c76 Moved `net/qp' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
54deaac318 Moved `net/pop3' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
df5fef0c95 Moved `net/nntp' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
67ca846fd9 Moved `net/mime' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
9ae3840211 Moved `net/imap' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
095ee4e007 Moved `net/head' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
03237c06f2 Moved `net/ftp' code from unit to module. 2011-09-05 15:22:38 -04:00
Jon Zeppieri
a0eac7ac5c Moved `net/dns' code from unit to module. 2011-09-05 15:22:38 -04:00