You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
mod_ruby で cgi.rb を使用すると、CGI.new 時にアップロードしたファイルと同じサイズのメモリを使用してしまいます。
request.c の read_client_block() で、apr_palloc() でメモリを獲得していますが、これがアップロードファイルを全部読むまで繰り返し呼ばれるため、結果としてアップロードファイルと同じサイズのメモリが獲得されてしまいます。
apr_palloc() で獲得したメモリ buf は rb_str_cat() 後は不要なため、apr_palloc() ではなくて、この関数内で malloc() & free() した方がいいのではないかと思うのですが、いかがでしょうか。
The text was updated successfully, but these errors were encountered: