Граф коммитов

311 Коммитов

Автор SHA1 Сообщение Дата
naruse d795f2d1a8 Shutdown gracefully.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-20 21:56:40 +00:00
shugo 2e63cd97c1 * lib/net/imap.rb (decode_utf7, encode_utf7): refactored by
Nobuyoshi Nakada, to use String#encode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-09 07:03:19 +00:00
shugo 9be3aa1767 * lib/net/imap.rb (body_type_attachment): parse body type
"ATTACHMENT". [ruby-core:44849] [Bug #6397]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-07 04:05:44 +00:00
ayumin 3893159530 * test/net/http/test_https.rb: update test for r35494
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 03:51:03 +00:00
nobu 77b1d88513 skip OpenSSL dependent tests if not available
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-23 13:48:41 +00:00
drbrain ea9b6997cc * lib/net/protocol.rb (module Net): Added ReadTimeout to match
OpenTimeout.  ReadTimeout is now raised by rbuf_fill instead of
  Timeout::Error to help users distinguish what type of timeout
  occurred.  [ruby-trunk - Feature #6088]
* lib/net/pop.rb (module Net):  Updated documentation for ReadTimeout
  and OpenTimeout.
* lib/net/http.rb (module Net):  ditto
* lib/net/smtp.rb (module Net):  ditto
* lib/net/telnet.rb (module Net):  Net::ReadTimeout is now raised in
  waitfor to match Net::Protocol.
* test/net/http/test_http.rb:  Updated Timeout::Error expectation to
  Net::ReadTimeout.
* test/net/ftp/test_ftp.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 21:20:51 +00:00
naruse 7865005fa1 * lib/ftp/ftp.rb (Net::FTP#close): restore original read_timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-04 04:10:58 +00:00
naruse bc2ece6cf8 * lib/ftp/ftp.rb (Net::FTP#close): close socket more gracefully.
* lib/ftp/ftp.rb (Net::BufferedSocket#shutdown): added.

* test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): wait socket
  with shutdown and read.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 19:24:30 +00:00
usa 995d212a64 * test/net/ftp/test_ftp.rb (FTPTest#create_ftp_server): should wait
a little before closing socket because if the client call
  Net::FTP#getmultiline the socket is suddenly closed by the server in
  the getline loop.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03 10:03:30 +00:00
naruse 8630041945 Refix of 35206; 0.3 is too small for Ruby's timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 21:06:13 +00:00
naruse 61fcda16fd ReRefix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 21:00:54 +00:00
naruse 9d8ca7e15e Refix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 20:59:02 +00:00
naruse 8520505e44 Fix the test for r35205.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 18:42:22 +00:00
naruse 4179e0b5c6 Client waits only the first line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 14:06:42 +00:00
naruse ae79409db4 * lib/net/ftp.rb (Net::BufferedSocket): should delegate send() to @io
for Net::FTP#abort and Net::FTP#status..

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-01 14:06:38 +00:00
shugo 5f81a53fd2 * lib/net/ftp.rb (read_timeout=, open_timeout=): supported timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31 04:44:36 +00:00
shugo 422c8baeb9 * lib/net/ftp.rb (parse_pasv_port): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 14:39:16 +00:00
shugo cae1d532f5 * test/net/ftp/test_ftp.rb: add the test, which was forgotten in the
previous commit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 10:52:06 +00:00
shugo 6853b44a92 * lib/net/imap.rb (initialize): raise Net::IMAP::Error when the
connection is closed without a greeting response.
  [ruby-core:40938] [Bug #5616]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 05:12:39 +00:00
shugo ed07df5ab5 * lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
[ruby-core:40945] [Bug #5620]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 04:56:18 +00:00
drbrain 09f27873ed * lib/net/protocol.rb: Add OpenTimeout subclass of Timeout::Error
* lib/net/pop.rb:  Modernize Timeout usage.  Patch by Eric Wong.
	  Use Net::OpenTimeout instead of Timeout::Error.  [Bug #5765]
	* lib/net/http.rb:  ditto
	* lib/net/smtp.rb:  ditto
	* lib/net/telnet.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 05:15:54 +00:00
drbrain 8a7da58c0f * lib/net/http.rb: Retry HTTP requests for additional network errors.
Introduce OpenTimeout subclass of Timeout::Error.  [Bug #6001]
	* test/net/http/test_http.rb:  Reduce timeout to 0.01s for faster test
	* test/net/http/test_https.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 04:51:37 +00:00
naruse aced01eeb4 Fix r34779. Raised error on connection reset varies on environments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 07:41:07 +00:00
drbrain 7a1180c745 * lib/net/http.rb (Net::HTTP#transport_request): Fix infinite loop
upon EOFError or Errno::ECONNRESET where count is reset to 0.
* test/net/http/test_http.rb (class TestNetHTTPKeepAlive):  Test for
  above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24 01:10:07 +00:00
kazu ca0bb51887 * test/net/http/test_https_proxy.rb
(HTTPSProxyTest#test_https_proxy_authentication):
  add workaround to avoid to hang up without openssl.
  see #5786

* test/resolv/test_dns.rb (TestResolvDNS#test_query_ipv4_address):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02 15:55:07 +00:00
usa a267b9512a * test/net/http/test_http.rb (TestNetHTTPKeepAlive#*): remove debug
output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-02 07:22:17 +00:00
naruse bee7ccddd2 * lib/net/http.rb (Net::HTTP#transport_request): retry a idempotent
request automatically. [ruby-dev:45030] [Bug #5790]
  [ruby-core:41821] [Bug #5813]

* lib/net/http.rb (Net::HTTP#keep_alive_timeout=): added to specify
  the second to reconnect the TCP connection on Keep-Alive.
  The default value is 2 second because current servers uses 2 sec.
  http://ftp-admin.blogspot.com/2009/09/keepalivetimeout2.html

* lib/net/http.rb (Net::HTTP#begin_transport): reconnect TCP
  connection on keep-alive timeout.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-20 05:56:35 +00:00
naruse afbcfdf961 Suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-22 09:48:50 +00:00
shugo e48c8be89b * lib/net/imap.rb: includes the sequence number of UID in a error
message.  suggested by art lussos.
  [ruby-core:41413] [Feature #5692]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-11 03:21:43 +00:00
akr b0fe688676 * test/net/http/test_http.rb: remove temporally files in ensure clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-19 07:37:22 +00:00
akr 805a01cb9a * test/net/http/test_http.rb: remove temporally files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18 23:19:26 +00:00
shugo 26f73a5117 * lib/net/imap.rb (default_port, default_imap_port,
default_tls_port, default_ssl_port, default_imaps_port):
  added methods for consistency with Net::POP.
  based on the patch by art lussos.  [ruby-core:38997] [Bug #5198]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04 13:33:14 +00:00
shugo 2bd37c7183 * lib/net/imap.rb (idle): raises a Net::IMAP::Error when the
connection is closed.  based on the patch by Hugo Barauna.
  [Bug #5190] [ruby-core:38930]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-19 05:16:20 +00:00
shugo 28b5db007f * lib/net/imap.rb (msg_att): accepts extra space before ')'.
based on the patch by art lussos.  [Bug #5163] [ruby-core:38820]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-19 02:32:59 +00:00
shyouhei fa25f26095 * test/net/http/test_http.rb (TestNetHTTP_version_1_1_methods#test_timeout_during_HTTP_session):
If you connect to localhost, you should listen localhost.

* test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 22:35:05 +00:00
nahi 800c313bde * lib/net/http.rb (Net::HTTP.post_form): Do not ignore query part of
the given URI to post. See #655.

* test/net/http/test_http.rb, test/net/http/utils.rb: Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21 17:44:44 +00:00
shugo 97ac172d58 * lib/net/imap.rb (search_response): parses SEARCH responses from
the Yahoo IMAP server correctly.  patched by Mark Nadig.  [Bug #4509]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 02:41:03 +00:00
nahi b219a56c07 * lib/net/http.rb, lib/net/protocol.rb: Allow to configure to wait
server returning '100 continue' response befor sending HTTP request
  body. See NEWS for more detail. See #3622.
  Original patch is made by Eric Hodel <drbrain@segment7.net>.

* test/net/http/test_http.rb: test it.

* NEWS: Add new feature.

On my env (Ubuntu 11.04 64bit),
9510 tests, 2203824 assertions, 0 failures, 0 errors, 29 skips
->
9514 tests, 2203836 assertions, 0 failures, 0 errors, 29 skips


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 08:10:42 +00:00
kosaki e15b3c83b8 * test/net/http/utils.rb (TestNetHTTPUtils#teardown): add nil check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-28 17:17:36 +00:00
naruse 84b96e1be4 Fix tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-19 12:43:27 +00:00
nobu 49cf75e675 * test/net/smtp/test_ssl_socket.rb: fix dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-15 03:01:19 +00:00
shugo 9d155ebf51 * test/net/imap/test_imap.rb: call neither logout nor disconnect
unless connected.  patch by Kazuhiro NISHIYAMA.  [ruby-dev:42860]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14 06:38:32 +00:00
yugui ef0736604a * lib/net/http.rb (Net::HTTP#connect): makes it timeout during
SSL handshake too. [ruby-core:34203]
  Patch by Marc Slemko.

* test/net/http/test_http.rb (TestNetHTTP_v1_2#test_timeout_during_HTTP_session):
  test for [ruby-core:34203]

* test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-12 07:26:18 +00:00
tenderlove b092e967b0 use require_relative instead of File.expand_path
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-06 00:39:50 +00:00
tenderlove 9bc8ccf4d4 * lib/net/protocol.rb (eof?): BufferedIO should proxy eof? to the
underlying IO object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-06 00:24:45 +00:00
knu 0d375e732d * lib/net/http.rb (Net::HTTP#get): A header hash given should not
be modified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 04:58:57 +00:00
yugui dae189e8c6 * test/net/imap/cacert.pem: updated because it has been expired.
* test/net/imap/server.crt: signed again because CA cert was expired.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 10:25:44 +00:00
tenderlove 26e6372a87 adding tests for Net::SMTP::Response#exception_class
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-22 23:32:57 +00:00
tenderlove 3971bc3c70 adding more tests for Net::SMTP::Response class
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-22 23:26:05 +00:00
tenderlove 0a2392a50a * lib/net/smtp.rb: refactoring Net::SMTP#esmtp= to use an
attr_accessor

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-22 23:13:49 +00:00
tenderlove df8e7db7c5 adding tests for the SMTP response parser
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-22 23:09:05 +00:00
tenderlove 4a7f4d1f48 * lib/net/smtp.rb: Net::SMTP should close the SSL connection if the
connection verification fails.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-22 21:37:13 +00:00
naruse cba0d62d91 * lib/net/http.rb (Net::HTTPRequest#send_request_body_data):
set binmode to tempfile.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-14 04:05:03 +00:00
naruse 1c9f703a47 * lib/net/http.rb (Net::HTTPRequest#set_form): Added to support
both application/x-www-form-urlencoded and multipart/form-data.
  There is a similar API, Net::HTTPRequest#set_form_data, but
  to keep its compatibility this is newly added. [ruby-dev:42729]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-13 01:04:37 +00:00
naruse c37ca96692 * lib/net/http.rb: remove version 1.1 features.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-10 01:08:45 +00:00
naruse 4ec63ef245 fix typo: not response.attr.data, but response.data.attr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 13:12:10 +00:00
shugo fd019a5cbd * lib/net/imap.rb (xlist): supported the XLIST command, which is an
extension by Apple and Google.  patch by Geoff Youngs.
  [ruby-core:33521]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 08:07:12 +00:00
shyouhei 93fba33b47 * test/net/http/test_https.rb: As always, localhost is not
guaranteed to be resolved as 127.0.0.1.  But a SSL
          certificate needs a socket to listen on a specific address
          where a CN resolves to.  On situations where localhost is
          not 127.0.0.1, these tests are not possible.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-27 06:57:39 +00:00
shyouhei 36cfaa8052 * test/net/imap/test_imap.rb: resurrection of r29259.
this change depends on minitest 1.7.1.

	* lib/test/unit/assertions.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-27 06:28:59 +00:00
shyouhei cc9b6ba611 reverting; http://rubyforge.org/tracker/?func=detail&atid=4099&aid=28566&group_id=1040
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 07:56:04 +00:00
shyouhei 6bab4ea991 * lib/test/unit/assertions.rb (Test::Unit::Assertions::assert_nothing_raised):
should properly ignore MiniTest::Skip

	* lib/minitest/unit.rb (MiniTest::Assertions::assert_raises):
	  ditto.

	* test/net/imap/test_imap.rb: Properly skip SSL tests when
	  localhost is not 127.0.0.1.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 06:01:00 +00:00
shyouhei 0d58b7a4e6 * test/net/imap/test_imap.rb: "localhost" not guaranteed to
resolve to "127.0.0.1".  On my machine it is "::1" instead.
	  The problem is, you have to connect to the imaps server via
	  the canonical name written in a server certificate, and that
	  of the server.cert is "localhost".  So you have to listen to
	  the address of what "localhost" resolves to.  I think this
	  situation cannot be resolved in a handy manner because the
	  test "test_imaps_post_connection_check" is actually
	  expecting to connect to a server via an address other than
	  the CN.  On my machine several assertions won't pass because
	  the test cannot connect to the server.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-15 04:37:45 +00:00
nahi e54c30c05e * test/net/http/test_https.rb (test_identity_verify_failure): follows
the SSL hostname check error message of openssl.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-09 08:17:51 +00:00
nobu f75ab0150d * test/net/imap/test_imap.rb (test_exception_during_shutdown):
need to raise always.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05 05:11:15 +00:00
naruse ab70e53ac3 * lib/net/http.rb: adding support to rfc5789 patch verb.
Added a Net::HTTP::Patch class which expects a message body
  and response body. It recycles the post method into a patch one,
  that will send the encoded representation to the server.
  Summarizing, a new class has been created, the post method
  extracted into send_entity, including a new argument,
  which defines which class to use (Post or Patch) and
  finally a patch method was created. [ruby-core:30426]
  Patched by Guilherme Silveira
  <guilherme.silveira AT caelum.com.br>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-01 12:30:52 +00:00
shugo d2a9f00ecc * test/net/imap/test_imap.rb: use IPv4 for
test_imaps_post_connection_check.  [ruby-dev:41189]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 00:16:48 +00:00
shugo e240f93f21 * lib/net/imap.rb (disconnect): terminates @receiver_thread even if
@sock.shutdown raises an exception.  [ruby-dev:34881]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 23:25:54 +00:00
mame 57c1406697 * lib/net/http.rb (Net::HTTPResponse#read_chunked): ensure to skip the
last newline of chunk.  [ruby-core:29229]

* test/net/http/utils.rb: add an option for chunked response test.

* test/net/http/test_http.rb: add tests for chunked response.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-03 23:42:26 +00:00
shugo 2587316c73 * lib/net/imap (encode_utf7): encode & properly. Thanks, Kengo
Matsuyama.  [ruby-dev:38063]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-14 04:00:09 +00:00
shugo 3b21e88faa test/net/imap/test_imap_response_parser.rb: fixed test_resp_text_code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06 14:11:21 +00:00
shugo d724d5e771 * test/net/imap/test_imap_response_parser.rb (test_resp_text_code): added a test
for [ruby-core:27913].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06 14:09:13 +00:00
shugo 69c3348b79 * lib/net/imap.rb (receive_responses): does not hang when an unexpected BYE
response received.  fixed [ruby-core:27944].  Thanks, Bob Potter.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06 13:57:10 +00:00
shugo 237c2211e6 * test/net/imap/test_imap.rb (test_exception_during_idle): use timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-06 12:31:59 +00:00
shugo 718ceb5476 * lib/net/imap.rb (flag_list): untaint strings to intern in the safe
level 1.
* lib/net/imap.rb (max_flag_count=): new methods to set the max
  number of flags interned to symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-19 13:56:23 +00:00
nahi d1cb4a5ba7 * lib/net/http.rb (Net::HTTPResponse#each_response_header):
accept multiline message header of HTTP response.  see #1796.
          cf. RFC 2616 '4.2 Message Header'.                          

        * test/net/http/test_httpresponse.rb: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-30 13:09:03 +00:00
shugo 9914a16ca9 * lib/net/imap.rb (idle): leaves IDLE in a ensure clause. a patch
from Eric Hodel.
* test/net/imap/test_imap.rb (setup, teardown): turn on
  Socket.do_not_reverse_lookup in tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-24 09:09:04 +00:00
shugo 4676ede3d1 * lib/net/imap.rb (resp_text_code): accepts response codes without
text.  [ruby-core:24194]
* lib/net/imap.rb (idle, idle_done): new methods for the IMAP4 IDLE
  command (RFC 2177).  Thanks, Eric Hodel.
* lib/net/imap.rb (format_date, format_datetime): new method to
  format IMAP-style date/datetime. Thanks, Eric Hodel.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-23 15:20:47 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
kazu 0e0d05d5f4 * lib/net/pop.rb: check for invalid APOP timestamp. (CVE-2007-1558)
[ruby-dev:36631]

* test/net/pop/test_pop.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14 02:22:46 +00:00
nobu 00b4a3f9c4 * test: assert_raises has been deprecated since a long time ago.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24 17:44:39 +00:00
mame 7edda76f15 * test/net/http/test_http.rb (_test_request__file): specify encoding
explicitly.

* test/net/http/utils.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 18:02:24 +00:00
mame 8d4f4e25e5 * test/net/http/test_http.rb: compare encodings of two strings before
comparing themself, which suppress too big error output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 14:49:39 +00:00
shugo 79fdbe0519 * lib/net/imap.rb: do not use Thread#raise. [ruby-dev:34739]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 17:47:33 +00:00
akr 786e7aba7f * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception.
* test/net/imap/test_imap.rb: ensure disconnecting imap to terminate
  receiver thread..


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-05 17:18:09 +00:00
usa f7b12afff5 * test/net/imap/test_imap.rb: check OpenSSL definition before testing imaps.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-30 20:58:31 +00:00
gotoyuzo e963ff1e98 * test/net/http/test_https.rb: should rescue LoadError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23 19:05:39 +00:00
shugo 018bdcadac * test/net/imap/test_imap.rb: added tests for SSL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22 15:50:43 +00:00
gotoyuzo 40aa32a0d7 * ext/openssl/lib/net/ssl.rb (OpenSSL::SSL::SSLContext.build): removed.
* ext/openssl/lib/net/ssl.rb (OpenSSL::SSL::SSLContext#set_params):
  new method to set suitable SSL parameters.

* lib/net/pop.rb, lib/net/http.rb, lib/net/imap.rb, 
  test/openssl/test_ssl.rb: follow above change.

* test/net/http/test_https.rb: refine error case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22 08:31:53 +00:00
shugo e875cfa1fe * lib/net/imap.rb (encode_utf7): accept UTF-8 strings.
* lib/net/imap.rb (decode_utf7): return UTF-8 strings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22 08:00:04 +00:00
gotoyuzo c6920177f3 * lib/net/http.rb (Net::HTTP#connect): use
OpenSSL::SSL::SSLContext.build instead of SSLContext.new (default
  verify mode is now OpenSSL::SSL::VERIFY_PEER).

* lib/net/https.rb: SSL parameters are defined by attr_accessor.

* test/net/http/test_https.rb: add test for HTTPS features.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 16:21:22 +00:00
gotoyuzo f2266fe471 * test/net/http/utils.rb: split TestNetHTTPUtils module from
test/net/http/test_http.rb. and start HTTP server in each test case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18 14:46:52 +00:00
akr 0884b1d8b1 catch EOFError in a thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-15 11:12:20 +00:00
akr 49f00d5d2d close socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-15 11:04:30 +00:00
matz 67172a2401 * test/net/http/test_https_proxy.rb
(HTTPSProxyTest::test_https_proxy_authentication): initialize
  local variable 't' first.  [ruby-dev:32253]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-14 07:17:18 +00:00
aamine 22d6ff16d3 * lib/net/http.rb (tokens): forgot to add strip. [ruby-core:11120]
* test/net/http/test_http.rb: test Net::HTTP.post_form.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-12 09:25:56 +00:00
aamine 429c03eb2a merge test cases with Ruby 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-26 13:23:40 +00:00
aamine e1173b2c78 * lib/net/http.rb (Net::HTTP#post, request_post, request): should set Content-Type: x-www-form-urlencoded by default.
* lib/net/http.rb (Net::HTTPHeader#content_type): should return nil when there's no Content-Type.
* lib/net/http.rb (Net::HTTPHeader#sub_type): should return nil when there's no sub Content-Type (e.g. "Content-Type: text").
* lib/net/http.rb (Net::HTTPHeader#type_params): wrongly failed when there's no Content-Type.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-26 13:00:26 +00:00
nobu ec12edb11c * lib/scanf.rb (Scanf::FormatSpecifier#letter, #width): use matched
substring directly.

* ext/nkf/lib/kconv.rb (Kconv.conv): get rid of nil.to_a.

* test/ruby/test_assignment.rb, test/ruby/test_iterator.rb: followed
  change of sample/test.rb.

* test/net/http/test_http.rb: removed superfluous splatting stars.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-08 10:45:52 +00:00
aamine 8e1d3e5498 * test/net/http/test_http.rb (teardown): ensure that Net::HTTP is version 1.2. [ruby-dev:27312]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-24 11:25:29 +00:00
aamine 74b34477e2 * test/net/http/test_http.rb: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-24 02:45:02 +00:00
akr 261f8e0f73 skip test if openssl is not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-07 02:49:16 +00:00
akr 8a85b8bef1 fix another IPv6 issue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-03 20:40:39 +00:00
akr a1782f4e6a avoid IPv6 issue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-03 18:03:52 +00:00
akr 0ad0462183 add ML number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-03 17:14:06 +00:00
akr ea0a08fddd set verify_mode to avoid a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-03 16:49:56 +00:00
akr f7298a29ea add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-03 16:11:40 +00:00
aamine 9d0758b3b0 * lib/net/http.rb: new method Net::HTTP.post_form.
* lib/net/http.rb: new method Net::HTTPHeader#set_form_data and its alias #form_data=.
* lib/net/http.rb: Net::HTTPHeader#add_header -> add_field (adjustted to Ruby 1.8).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-20 13:55:26 +00:00
shugo 90ad5e3699 * lib/net/imap.rb (decode_utf7): use pack("U*") to encode UTF-8.
* lib/net/imap.rb (encode_utf7): use unpack("U*") to decode UTF-8.
* test/net/imap/test_imap.rb: added tests for Net::IMAP.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-21 08:15:56 +00:00
aamine 94402f983f * lib/net/http.rb (each_capitalized): should join header field value. This patch is contributed sheepman [ruby-list:40478]
* test/net/http/test_httpheader.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-01 08:45:50 +00:00
aamine 39848fe845 * lib/net/http.rb: HTTPHeader keeps its header fields as an array.
* lib/net/http.rb: new method HTTPHeader#add_header, get_fields.
* lib/net/http.rb: new method HTTPHeader#content_length=.
* lib/net/http.rb: new method HTTPHeader#content_type, main_type, sub_type, type_params, content_type=, set_content_type.
* lib/net/http.rb (HTTPHeader#basic_encode): result of pack(m) may contain multiple LFs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-06 20:35:19 +00:00
aamine b33d3cfb41 * test/net/test_httpheader.rb: new file.
* MANIFEST: add test/net/test_httpheader.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-07 11:52:14 +00:00