Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool comparacaoChar(char *trying, int pi, int n, string ideal, int s)
- {
- if(s!=n) return 0;
- while((i<pi+n))
- if(trying[i]!=ideal[i-pi]) return 0;
- return 1;
- }
- bool badRequis(char *r)
- {
- int i = 0;
- if(!cmpChar(r, i, 3, "GET", 3)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 4, "Host", 4)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 10, "User-Agent", 10)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 6, "Accept", 6)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 15, "Accept-Language", 15)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 15, "Accept-Encoding", 15)) return 1; while(r[i]!='\n') ++i;
- if(!cmpChar(r, ++i, 10, "Connection", 10)) return 1; while(r[i]!='\n') ++i;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement