Browse Source

Update goodbyedpi.c

pull/319/head
SashaXser 2 years ago
committed by GitHub
parent
commit
e8f00c7c70
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 122
      src/goodbyedpi.c

122
src/goodbyedpi.c

@ -415,42 +415,92 @@ static const char *find_http_method_end(const char *pkt, unsigned int http_frag,
const char *method_end = NULL; const char *method_end = NULL;
int fragmented = 0; int fragmented = 0;
if (strncmp(pkt, "GET", 3) == 0) { switch (*pkt) {
method_end = pkt + 3; case 'G':
} else if (strncmp(pkt, "POST", 4) == 0) { if (strncmp(pkt, "GET", 3) == 0) {
method_end = pkt + 4; method_end = pkt + 3;
} else if (strncmp(pkt, "HEAD", 4) == 0) { }
method_end = pkt + 4; break;
} else if (strncmp(pkt, "OPTIONS", 7) == 0) { case 'P':
method_end = pkt + 7; if (strncmp(pkt, "POST", 4) == 0) {
} else if (strncmp(pkt, "DELETE", 6) == 0) { method_end = pkt + 4;
method_end = pkt + 6; }
} else if (strncmp(pkt, "TRACE", 5) == 0) { break;
method_end = pkt + 5; case 'H':
} else if (strncmp(pkt, "CONNECT", 7) == 0) { if (strncmp(pkt, "HEAD", 4) == 0) {
method_end = pkt + 7; method_end = pkt + 4;
} else if ((http_frag == 1 || http_frag == 2)) { }
if (strncmp(pkt, "ET", http_frag) == 0) { break;
method_end = pkt + http_frag - 1; case 'O':
fragmented = 1; if (strncmp(pkt, "OPTIONS", 7) == 0) {
} else if (strncmp(pkt, "ST", http_frag) == 0) { method_end = pkt + 7;
method_end = pkt + http_frag - 1; }
fragmented = 1; break;
} else if (strncmp(pkt, "AD", http_frag) == 0) { case 'D':
method_end = pkt + http_frag - 1; if (strncmp(pkt, "DELETE", 6) == 0) {
fragmented = 1; method_end = pkt + 6;
} else if (strncmp(pkt, "NS", http_frag) == 0) { }
method_end = pkt + http_frag - 1; break;
fragmented = 1; case 'T':
} else if (strncmp(pkt, "LE", http_frag) == 0) { if (strncmp(pkt, "TRACE", 5) == 0) {
method_end = pkt + http_frag - 1; method_end = pkt + 5;
fragmented = 1; }
} else if (strncmp(pkt, "RACE", http_frag + 1) == 0) { break;
method_end = pkt + http_frag - 1; case 'C':
fragmented = 1; if (strncmp(pkt, "CONNECT", 7) == 0) {
} else if (strncmp(pkt, "ONNECT", http_frag + 1) == 0) { method_end = pkt + 7;
method_end = pkt + http_frag - 1; }
fragmented = 1; break;
default:
break;
}
if (method_end == NULL && (http_frag == 1 || http_frag == 2)) {
switch (*pkt) {
case 'E':
if (strncmp(pkt, "ET", http_frag) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'S':
if (strncmp(pkt, "ST", http_frag) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'A':
if (strncmp(pkt, "AD", http_frag) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'N':
if (strncmp(pkt, "NS", http_frag) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'L':
if (strncmp(pkt, "LE", http_frag) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'R':
if (strncmp(pkt, "RACE", http_frag + 1) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
case 'O':
if (strncmp(pkt, "ONNECT", http_frag + 1) == 0) {
method_end = pkt + http_frag - 1;
fragmented = 1;
}
break;
default:
break;
} }
} }

Loading…
Cancel
Save