Skip to content

Commit f3e4036

Browse files
committed
No need to reload the mask if we can extract it from the SSE path
1 parent dc350c7 commit f3e4036

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/lwan-websocket.c

+4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ static void unmask(char *msg, size_t msg_len, char mask[static 4])
213213
}
214214

215215
if (msg_len >= 4) {
216+
#if defined(__SSE_4_1__)
217+
const uint32_t mask32 = _mm_extract_epi32(mask128, 0);
218+
#else
216219
const uint32_t mask32 = string_as_uint32(mask);
220+
#endif
217221
do {
218222
uint32_t v = string_as_uint32(msg);
219223
v ^= (uint32_t)mask32;

0 commit comments

Comments
 (0)