mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
Add http-reverse-proxy example
This commit is contained in:
1 parent
b2ab484883
commit
49b8480bfb
5 files changed
+612
-14
No files matched your search
@@ -79,14 +79,9 @@ bool mg_dns_parse(const uint8_t *buf, size_t len, struct mg_dns_message *dm) {
|
||||
memset(dm, 0, sizeof(*dm));
|
||||
if (len < sizeof(*h)) return 0; // Too small, headers dont fit
|
||||
if (len > 512) return 0; // Too large, we don't expect that
|
||||
if (mg_ntohs(h->num_questions) > 2) return 0; // Sanity
|
||||
if (mg_ntohs(h->num_answers) > 5) return 0; // Sanity
|
||||
if (mg_ntohs(h->num_questions) > 1) return 0; // Sanity
|
||||
if (mg_ntohs(h->num_answers) > 10) return 0; // Sanity
|
||||
dm->txnid = mg_ntohs(h->transaction_id);
|
||||
{
|
||||
// char *s = mg_hexdump(buf, len);
|
||||
// LOG(LL_DEBUG, ("--\n%s\n--\n", s));
|
||||
// free(s);
|
||||
}
|
||||
for (i = 0; i < mg_ntohs(h->num_questions); i++) {
|
||||
j += mg_dns_parse_name(s, e, j, dm->name, sizeof(dm->name), 0) + 5;
|
||||
// LOG(LL_INFO, ("QUE %zu %zu [%s]", i, j, dm->name));
|
||||
|
||||
Reference in new issue
Block a user