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

278 Коммитов

Автор SHA1 Сообщение Дата
akr 976574413a * test/net/imap/test_imap.rb: Don't ignore exceptions on server
threads.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 15:22:29 +00:00
akr 9bf5457481 * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
exceptions on server thread.
  Delete read_timeout method call to fix NoMethodError.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 14:40:00 +00:00
akr 070c310e87 * test/webrick: Store log in an array.
* test/net/http: Ditto.

* test/open-uri: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 11:51:06 +00:00
akr 0babd24827 * test/net/http: Examine webrick log.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 02:49:13 +00:00
akr 179fde39ef * test/net/http/utils.rb: Don't connect to spawned server
before actual test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-08 17:06:10 +00:00
hsbt 7df9a77da1 * test/net/imap/test_imap_response_parser.rb: removed needless code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29 08:57:06 +00:00
naruse 70a2eb6399 * lib/net/http/generic_request.rb (Net::HTTP::GenericRequest#exec):
handle req['host'] in update_uri.

* lib/net/http/generic_request.rb
  (Net::HTTP::GenericRequest#update_uri):
  use req['host'] if it is explicitly set. Even if URI is given,
  it is already used for the initial value of req['host'].
  Therefore overwritten value should be respected. [Bug #10054]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 19:10:23 +00:00
naruse 25d3fc8823 suppress warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 19:08:26 +00:00
shugo 6479e0b04f * lib/net/ftp.rb (gets, readline): read lines without LF properly.
[ruby-core:63205] [Bug #9949]

* test/net/ftp/test_buffered_socket.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-17 07:44:53 +00:00
nobu ce4ecc6b13 fold too long line
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-09 14:05:47 +00:00
shugo 87505dd771 * lib/net/imap.rb (body_type_1part): Gmail IMAP reports a body
type as "MIXED" followed immediately by params
	  [ruby-core:62864] [Bug #9885]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-03 04:19:57 +00:00
akr e555e28eab Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-31 14:28:19 +00:00
akr 4565cd66ed Close FDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30 15:03:34 +00:00
akr 6f226d9d42 * lib/webrick/server.rb: Use a pipe to detect server shutdown.
shutdown() or close() for listening socket is not a reliable.
  Actually, both doesn't work (doesn't wake up select()) on
  DragonFly BSD 3.6.2.

* test/webrick/utils.rb: :ShutdownSocketWithoutClose is not required
  now to immediate server shutdown detection.
  This fixes fd leaks.

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



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30 12:32:48 +00:00
akr 58a6412754 No need to kill a thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28 11:17:48 +00:00
akr cbd370f669 * lib/net/imap.rb (Net::IMAP#initialize): Close the opened socket when
any exception occur.
  This fixes a fd leak by IMAPTest#test_imaps_post_connection_check
  which start_tls_session() raises an exception.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-28 10:02:54 +00:00
nobu fe8a3074f9 test_imap.rb: fix leaked threads
* test/net/imap/test_imap.rb (imaps_test): join work threads not
  to leak threads.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26 05:38:24 +00:00
nobu 3041f72833 test_http.rb: fix leaked threads
* test/net/http/test_http.rb (test_timeout_during_HTTP_session):
  join work threads not to leak threads.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26 05:38:12 +00:00
nobu 1fd639393f net/protocol.rb: fix SMTP dot stuffing
* net/protocol.rb (using_each_crlf_line): fix SMTP dot-stuffing
  for messages not ending with a new-line.
  [ruby-core:61441] [Bug #9627] [fix GH-616]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-23 12:36:30 +00:00
hsbt 0728a4ed70 * test/net/imap/test_imap.rb: remove unused variables.
* test/net/imap/test_imap_response_parser.rb: ditto.
* test/net/pop/test_pop.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-23 02:38:18 +00:00
hsbt 72191a0acd * test/net/ftp/test_ftp.rb: remove unused variables.
test/logger/test_logger.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 06:05:52 +00:00
tmm1 5ac7c395c1 test/net/imap/test_imap.rb: fix test failures due to expired certs
* test/net/imap/cacert.pem: generate new CA cert, since the last one
  expired. [Bug #9341] [ruby-core:59459]
* test/net/imap/server.crt: new server cert signed with updated CA.
* test/net/imap/Makefile: add `make regen_certs` to automate this
  process.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-03 01:46:55 +00:00
drbrain 34e57abf23 * lib/net/smtp.rb (Net::SMTP#critical): Always return a
Net::SMTP::Response.  Patch by Pawel Veselov.
  [ruby-trunk - Bug #9125]
* test/net/smtp/test_smtp.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-02 05:18:04 +00:00
akr 6895e77ffc * test/net/http/utils.rb (spawn_server): Specify zero for port to
avoid reusing an allocated port.

* test/net/http/test_http.rb: Don't specify port here.

* test/net/http/test_https.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-19 12:29:46 +00:00
naruse 5df9f0d839 Increase open_timeout [Bug #8986]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 06:36:27 +00:00
akr 28130c1c63 * test/net/http/test_http.rb (test_bind_to_local_port): Choose an open
port more reliably.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-01 12:19:15 +00:00
usa 26ac058958 * test/net/http/test_http.rb (TestNetHTTP_v1_2#test_get,
TestNetHTTP_v1_2_chunked#test_get): shoudn't check
  HttpResponse#decode_content if Zlib is not available.
  ko1 complained via IRC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10 02:38:17 +00:00
shugo 61b8250adc * lib/net/imap.rb (capability_response): should ignore trailing
spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 13:44:17 +00:00
shugo 8541ed6df6 * lib/net/imap.rb (getacl_response): parse the mailbox of an ACL
response correctly.  [ruby-core:54365] [Bug #8281]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-23 05:07:21 +00:00
akr 8f671120f1 * test/csv/test_features.rb, test/logger/test_logger.rb
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb,
  test/openssl/test_config.rb, test/psych/test_encoding.rb,
  test/psych/test_exception.rb, test/psych/test_psych.rb,
  test/psych/test_tainted.rb, test/readline/test_readline.rb,
  test/rexml/test_contrib.rb, test/ruby/test_autoload.rb,
  test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb,
  test/ruby/test_file.rb, test/ruby/test_io.rb,
  test/ruby/test_marshal.rb, test/ruby/test_process.rb,
  test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb,
  test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb,
  test/zlib/test_zlib.rb: Use Tempfile.create.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20 23:03:52 +00:00
shugo 3f927dec87 * lib/net/imap.rb (body_type_msg): should accept
message/delivery-status with extra data.
  [ruby-core:53741] [Bug #8167]

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19 09:02:31 +00:00
drbrain f2a13e60d9 * lib/net/smtp.rb: Added Net::SMTP#rset method to implement the SMTP
RSET command.  [ruby-trunk - Feature #5373]
* NEWS:  ditto.
* test/net/smtp/test_smtp.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-11 17:27:03 +00:00
drbrain 023561f704 * lib/net/http.rb: Removed duplicate Accept-Encoding in Net::HTTP#get.
[ruby-trunk - Bug #7924]
* test/net/http/test_http.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-24 06:15:05 +00:00
drbrain 64db9dcbd5 * lib/net/http.rb: Removed OpenSSL dependency from Net::HTTP.
* test/net/http/test_http.rb:  Remove Zlib dependency from tests.
* test/net/http/test_http_request.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-14 05:32:58 +00:00
drbrain f58d398075 * lib/net/http: Do not handle Content-Encoding when the user sets
Accept-Encoding.  This allows users to handle Content-Encoding for
  themselves.  This restores backwards-compatibility with Ruby 1.x.
* lib/net/http/generic_request.rb:  ditto.
* lib/net/http/response.rb:  ditto
* test/net/http/test_http.rb:  Test for the above.
* test/net/http/test_http_request.rb:  ditto.
* test/net/http/test_httpresponse.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-14 01:08:19 +00:00
naruse bd7184b866 Suppress warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-05 15:04:46 +00:00
naruse 02253a7961 * lib/net/http/generic_request.rb (Net::HTTPGenericRequest):
set content-length to zero on empty post requests
  by Gregory Ostermayr <gregory.ostermayr@gmail.com>
  https://github.com/ruby/ruby/pull/201 fix GH-201

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23 19:58:44 +00:00
drbrain 570b766901 * lib/net/http.rb: Requests may be created with a URI which sets the
Host header.  Responses contain the requested URI for easier redirect
	  following.  [ruby-trunk - Feature #6482]
	* lib/net/http/generic_request.rb:  ditto.
	* lib/net/http/response.rb:  ditto.j
	* NEWS (net/http):  Updated for above.
	* test/net/http/test_http.rb:  Tests for above.
	* test/net/http/test_http.rb:  ditto.
	* test/net/http/test_httpresponse.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21 20:36:07 +00:00
nobu 13d3f023c6 test: remove or replace trailing spaces
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 05:02:18 +00:00
naruse 6ce8c33936 * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-08 10:04:24 +00:00
naruse ccd7a805cc * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 05:30:17 +00:00
naruse 58ef0f06c6 * ruby.c (load_file_internal): set default source encoding as
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]

* parse.y (parser_initialize): set default parser encoding as
  UTF-8 instead of US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 00:49:57 +00:00
shugo bd6bb6c0b2 * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept
message/delivery-status ([ruby-core:47920] [Bug #7146]),
  message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and
  (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]).

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 06:18:14 +00:00
shirosaki e453cc71a8 test_http.rb: clear environment variables
* test/net/http/test_http.rb (TestNetHTTP#test_proxy_address):
  clear environment variables. If http_proxy environment variable was
  set, the test failed.

* test/net/http/test_http.rb (TestNetHTTP#test_proxy_port): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-29 11:19:06 +00:00
naruse 8e9bbfd513 * lib/webrick/ssl.rb (WEBrick::Config::SSL): add new key
SSLTmpDhCallback to set SSLContext#tmp_dh_calback.

* lib/webrick/ssl.rb (WEBrick::GenericServer#setup_ssl_context):
  follow above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-01 20:46:31 +00:00
naruse b238b5be91 Use 0 as port like #6766 [Bug #6959]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-01 20:46:27 +00:00
naruse ccf911a02d Refix r36678: switch with zlib and check content-encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-10 10:53:18 +00:00
naruse 89c88eb5a9 Suppress warnings: Net::HTTPResponse#header is obsolete
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-10 05:25:08 +00:00
naruse 7391ae231a Run automatic deflate decoding only if it has zlib.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-10 05:25:04 +00:00
shyouhei 9b16b7478a * test/net/http/test_https.rb (TestNetHTTPS#test_session_reuse): localhost is not (always) 127.0.0.1. Don't expect that.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-26 05:54:29 +00:00
drbrain ead728ca7d * lib/net/http.rb: Added SSL session reuse across connections for a
single instance to speed up connection.  [Feature #5341]
* NEWS:  ditto
* test/net/http/test_https.rb:  Tests for #5341


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-25 00:05:59 +00:00
naruse 478d37da05 Use 0 for webrick's port and get the actual port. [Bug #6766]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-21 19:07:28 +00:00
naruse 07a6d0e9d1 * lib/net/http.rb (Net::HTTP.newobj): return back for compatibility.
* lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
  not given.

* lib/net/http.rb (Net::HTTP#initialize): ditto.

* lib/net/http.rb (Net::HTTP#proxy?): return true or false.

* lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.

* lib/net/http.rb (Net::HTTP#proxy_port): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-21 15:45:10 +00:00
drbrain 9416becda4 * lib/net/http.rb: Net::HTTP now automatically detects and uses
proxies from the environment.  A proxy may also be specified as
  before.

  Net::HTTP::Proxy still creates anonymous classes, but these classes
  are only used to store configuration information.  When an HTTP
  instance is created the configuration is now copied.

  Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP

  [Feature #6546]
* lib/open-uri.rb:  Moved URI::Generic#find_proxy to uri/generic.
* lib/uri/generic.rb:  Imported find_proxy from open-uri.
* test/open-uri/test_open-uri.rb:  Moved proxy-discovery tests to URI.
* test/uri/test_generic.rb:  Imported proxy-discovery tests from
  open-uri.
* test/net/http/test_http.rb:  Added tests for proxy behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 01:56:21 +00:00
drbrain b1a0509b54 * lib/net/http/response.rb: Automatically inflate gzip and
deflate-encoded response bodies.  [Feature #6942]
* lib/net/http/generic_request.rb:  Automatically accept gzip and
  deflate content-encoding for requests.  [Feature #6494]
* lib/net/http/request.rb:  Updated documentation for #6494.
* lib/net/http.rb:  Updated documentation for #6492 and #6494, removed
  Content-Encoding handling now present in Net::HTTPResponse.
* test/net/http/test_httpresponse.rb:  Tests for #6492
* test/net/http/test_http_request.rb:  Tests for #6494
* test/open-uri/test_open-uri.rb (test_content_encoding):  Updated test
  for automatic content-encoding handling.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 22:43:38 +00:00
usa b72fc09537 * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
re-enable the tests because now it's OK on windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 04:29:14 +00:00
naruse da78490c80 use localhost for both local and remote. [Bug #6746]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 16:48:54 +00:00
naruse da74f0f426 Support IPv6 address. [Bug #6746]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 08:41:21 +00:00
usa 8cc3fef898 * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
cannot cross between network interfaces on Windows, so skip this test
  until we find better test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 01:48:23 +00:00
naruse 558edd5192 Use IPv4 address on connecting to 127.0.0.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 01:27:42 +00:00
naruse 4689853711 * lib/net/http.rb (Net::HTTP#connect): use local_host and local_port
if specified. patched by Ricardo Amorim [Feature #6617]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-11 18:37:18 +00:00
knu 1b51476c1b * test/net/http/test_httpresponses.rb: Add a test file for
Net::HTTPResponses and put a test case for the previous bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-05 03:31:36 +00:00
naruse 3ba0abdb15 * lib/net/http/header.rb (Net::HTTPHeader#range): fix broken parser of
HTTP Range request. Old one can't parse invalid specs and multiple
  specs correctly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 13:09:26 +00:00
naruse 3cbf88d8d4 rescue EPIPE raised from conn.print because of client's timeout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-22 12:35:18 +00:00
naruse f6fb038dee * lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
because transfercmd may fail and return nil.

* lib/net/ftp.rb (Net::FTP#retrlines): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-21 12:56:17 +00:00
naruse acb10b8c32 Rescue exception from writing to a socket.
conn.print may raise EPIPE because ftp.retrbinary closes the connection
because of read_timeout. but the exact result varies from the situation
like platform, timing, and so on.
it may raise ECONNRESET, ECONNABORTED, EOFError, or nothing raised.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-21 08:48:32 +00:00
naruse 52f0c6780e * lib/net/ftp.rb (Net::FTP#transfercmd): rescue shutdown.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-21 02:27:07 +00:00
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