c++ - finding whether the body contains gzipped data -


i have program wherein searches reply curl request specific strings. gzipped data. there way find whether reply text or gzipped format? header contain gziipped,deflate header, not consistent. there way search string , find if gzipped?

you try taking @ first 2 bytes of data. gzipped data, they should 0x1f, 0x8b.

member header , trailer  id1 (identification 1) id2 (identification 2) these have fixed values id1 = 31 (0x1f, \037), id2 = 139 (0x8b, \213), identify file being in gzip format. 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -