私は組み込みプラットフォーム用のアプリケーションを開発しています。つまり、アラゴ Linux を実行している TI の DM385 です。
http 経由で 3 ~ 4 MB を超えるファイルをアップロードすると、奇妙な問題が発生しました。
アップロードが正常に機能する場合もあれば、ファイルはアップロードされても、ファイルのバイナリ データの途中に HTTP ヘッダーが表示されてデータが破損する場合があります。
また、glibc() エラー (malloc または free) が発生したり、SIGSEGV や boa がクラッシュしたりすることもあります。
1MB 以下などの小さなファイルを使用する場合、すべてがうまく機能します。プログラムのフロー全体にさまざまなデバッグ出力を追加して、問題をデバッグしようとしました。これにより、サーバーの動作が非常に遅くなり、一時的に問題が解決しました。ファイルのアップロードは毎回うまくいきました.
データ転送中に使用されているファイル記述子の 1 つで、ある種のバッファ アンダーランが発生しているようですが、具体的なことを指し示すことはできません。
誰かがこの問題または同様の問題に関する知識を共有できますか?
[コメントから更新:]
ビルド中の警告:
boa.c: In function 'main':
boa.c:290: warning: passing argument 4 of 'pthread_create' makes pointer from integer without a cast
boa.c:292: warning: implicit declaration of function 'onvif_dbg'
boa.c: In function 'create_server_socket_udp_hello':
boa.c:376: warning: unused variable 'one'
boa.c: At top level:
boa.c:374: warning: 'create_server_socket_udp_hello' defined but not used
buffer.c: In function 'req_flush':
buffer.c:219: warning: implicit declaration of function 'onvif_dbg'
cgi.c: In function 'uri_decoding':
cgi.c:329: warning: pointer targets in passing argument 1 of 'ascii_to_hex' differ in signedness
config.c: In function 'read_config_files':
config.c:294: warning: implicit declaration of function 'onvif_trace'
request.c: In function 'uri_mpeg4':
request.c:3327: warning: implicit declaration of function 'onvif_dbg'
request.c: In function 'process_requests':
request.c:4730: warning: suggest parentheses around assignment used as truth value
request.c: At top level:
request.c:49: warning: 'sts' defined but not used
In file included from response.c:26:
/home/user/IPNC_RDK/Source/ipnc_rdk/../ipnc_rdk/ipnc_app/interface/inc/system_default.h:16:1: warning: "IPNC_DM385" redefined
<command-line>: warning: this is the location of the previous definition
In file included from select.c:27:
onvif.h:33:12: warning: missing whitespace after the macro name
select.c: In function 'probe_thr':
select.c:46: warning: implicit declaration of function 'GetSysInfo'
select.c:46: warning: initialization makes pointer from integer without a cast
select.c:51: warning: control reaches end of non-void function
select.c: In function 'select_loop':
select.c:66: warning: implicit declaration of function 'pthread_create'
select.c:68: warning: implicit declaration of function 'onvif_dbg'