infoMore than 5 years have passed since last update.
[WIP] Feb 2015時点でのh2o の実装を理解する
Last updated at Posted at 2015-02-24
フィルタ・ハンドラの初期化
- まず「このモジュールが存在するよ」という宣言をmainに追加する。例:
h2o_proxy_register_configurator(&conf.globalconf)
main.c#L1181
- configurator は設定ファイルからプログラム側に何かを伝えるために使う
- フックはhandlerかfilterかによって微妙に違う。
-
on_context_init
フックは各モジュールごと、スレッドごとによばれる。スレッドコンテキストの初期化に使われる main.c#L1070
- super、なんかわかるけどわかってない。
お得情報
-
h2o_iovec_t
がすごく便利。Cの世界にいることを一瞬忘れる。
あとでわかったら整理する:
-
h2o_context_get_filter_context
をfilterのon_setup_ostream
内でreq->conn->ctx
に対して実行するとSEGVする。登録の仕方が悪いのか、取り方がわるいのか?
- http1clientのコールバックが呼ばれるシーケンスが読んでるだけだとわかりにくい。SEGVが取れたらようやく呼び出しながら確認できるのであとでまとめる
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up