Mercurial > hg > nginx
comparison src/http/ngx_http_spdy.h @ 5716:34d460c5d186
SPDY: fixed operator precedence in uint16/uint32 write macros.
Since the type cast has precedence higher than the bit shift operator,
all values were truncated to 8 bits.
These macros are used to construct header block for SYN_REPLY frame on
platforms with strict alignment requirements. As a result, any response
that contains a header with name or value longer than 255 bytes was
corrupted on such platforms.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Thu, 29 May 2014 21:15:19 +0400 |
parents | 2bc609a4b516 |
children |
comparison
equal
deleted
inserted
replaced
5715:790ba7484bb6 | 5716:34d460c5d186 |
---|---|
228 #define ngx_spdy_frame_write_uint32 ngx_spdy_frame_aligned_write_uint32 | 228 #define ngx_spdy_frame_write_uint32 ngx_spdy_frame_aligned_write_uint32 |
229 | 229 |
230 #else | 230 #else |
231 | 231 |
232 #define ngx_spdy_frame_write_uint16(p, s) \ | 232 #define ngx_spdy_frame_write_uint16(p, s) \ |
233 ((p)[0] = (u_char) (s) >> 8, (p)[1] = (u_char) (s), (p) + sizeof(uint16_t)) | 233 ((p)[0] = (u_char) ((s) >> 8), \ |
234 (p)[1] = (u_char) (s), \ | |
235 (p) + sizeof(uint16_t)) | |
234 | 236 |
235 #define ngx_spdy_frame_write_uint32(p, s) \ | 237 #define ngx_spdy_frame_write_uint32(p, s) \ |
236 ((p)[0] = (u_char) (s) >> 24, \ | 238 ((p)[0] = (u_char) ((s) >> 24), \ |
237 (p)[1] = (u_char) (s) >> 16, \ | 239 (p)[1] = (u_char) ((s) >> 16), \ |
238 (p)[2] = (u_char) (s) >> 8, \ | 240 (p)[2] = (u_char) ((s) >> 8), \ |
239 (p)[3] = (u_char) (s), (p) + sizeof(uint32_t)) | 241 (p)[3] = (u_char) (s), \ |
242 (p) + sizeof(uint32_t)) | |
240 | 243 |
241 #endif | 244 #endif |
242 | 245 |
243 | 246 |
244 #define ngx_spdy_ctl_frame_head(t) \ | 247 #define ngx_spdy_ctl_frame_head(t) \ |