Comments (4)
xyzzyの実装は正しくて、コネクション自体が終わっていない(HTTP 1.1はデフォルトでkeep-aliveになっているから)だけではないでしょうか。
(yahoo はkeep-aliveを実装していない?)
(format stream "GET / HTTP/1.1\n")
を (format stream "GET / HTTP/1.0\n")
にするか、GETの後に
(format stream "Connection: close\n")
を付ければ、リクエスト毎にコネクションが切断されるようになって、所望の結果が得られるのではないかと思います。
from xyzzy.
確かにコネクションを切断するように指定すれば上のコードはうまく動作するみたいですね。ありがとうございます。
ただ、サイトによっては実行中に別の問題が発生するみたいです。
例えば httpbin.org では
(with-open-stream (stream (connect "httpbin.org" "https" :ssl t))
(format stream "GET /ip HTTP/1.1\n")
(format stream "Host: httpbin.org\n")
(format stream "Connection: close\n")
(format stream "\n")
(let (line)
(while (setq line (read-line stream nil))
(insert line "\n"))))
;;-> 通信内容が出力される
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 14 Jan 2016 18:49:00 GMT
Content-Type: application/json
Content-Length: 31
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"origin": "127.0.0.1"
}
;; エラーメッセージ: Disconnect: 指定されたハンドルが無効です
*Trace Output*
バッファを見ると「DecryptMessage (context expired): このコンテキストは、期限が切れているので使用できません。 」と出力されていて、read-line 関数の読み込み途中にSSLソケットストリームが無効になる(?)ようなエラーが発生してしまうため、解決したとは言いがたい状態です…。
from xyzzy.
どうも、src/sockssl.cc
内の sockssl::decrypt_data()
で、DecryptMessage()
が返すSEC_I_CONTEXT_EXPIRED
をエラーとして扱っているのが原因のようです。
他のソフトをいくつか見てみましたが、無視してセッションクローズしてしまうのが正しい?
件のサイトでもエラーが出ないようなパッチを作ってみましたが、Windowsはよく分かっていないのでこれでいいのかどうか。
https://gist.github.com/amuramatsu/8c3b63b05d8a23a70741
from xyzzy.
パッチを当てて再ビルドしてみたら通りました 👍
改善の余地はありそうですが、一応このパッチはPull Requestとして投げてみてはどうでしょうか。
from xyzzy.
Related Issues (20)
- 0.2.2.252 リリース作業
- ファイラにおけるフォルダ名の変更
- ウィンドウクラス名が " " (全角スペース1文字)になっており使い勝手が悪い HOT 4
- VisualStudio 2013 に移行
- zlib 1.2.8 へ更新
- buffer-bar-click-to-deleteが動かない HOT 4
- バッファ選択ダイアログのソート順 HOT 1
- 0.2.2.253 リリース作業
- reference.xml のDTD 指定と中身の項目no HOT 1
- reference.xml 内でのDTD 指定と中身の項目の不一致 HOT 3
- ファイル名にハングルやグレーブなどが入ると正常に開けない HOT 2
- 山の日対応
- ファイラから開くダイアログの改良
- ファイラでジャンクションを削除すると、参照先のファイルが削除されてしまう
- ashの返す値がおかしい
- IMEで円記号を変換・確定すると、バックスラッシュが入力されてしまう
- list-length の新たなバグ HOT 3
- last がドットリストに対してエラーとなる
- ファイラにて「アイコンをファイルから取ってくる」設定が効かず、かつxyzzyメインウィンドウのクローズが出来ない事がある HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xyzzy.