摘要:Many network devices undertake tasks that involve extracting HTTP payload from a high concurrent number of data streams.In order to model such tasks and thus develop feasible approaches,this paper analyzes action characteristics of network byte stream reading and grammar of HTTP response message encoding.Based on this analysis, we propose a parsing algorithm for concurrent HTTP response streams,built upon stack buffer peeking operations and a extended finite state machine model.Implementation issues on parallel platforms are also studied in this paper.Our scheme is event-driven, does not require full buffering of the whole HTTP message, and reduces one memory copy compared to naive static parsing method.Test results from a Linux host show that our method achieves better performance in terms of CPU and memory consumption.
关键词:HTTP response;chunked encoding;extended finite state machine