MCPcopy Create free account
hub / github.com/defold/defold / NameWireLength

Function NameWireLength

engine/dlib/src/test/test_mdns.cpp:365–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363 }
364
365 static uint16_t NameWireLength(const char* name)
366 {
367 uint16_t size = 1;
368 const char* cursor = name;
369 while (*cursor)
370 {
371 uint16_t label_len = 0;
372 while (*cursor && *cursor != '.')
373 {
374 char decoded = 0;
375 if (!DecodeEscapedChar(&cursor, &decoded))
376 return 0;
377 ++label_len;
378 }
379 size += 1 + label_len;
380 if (*cursor == '.')
381 ++cursor;
382 }
383 return size;
384 }
385
386 static bool GetExpectedAdvertisedAddress(dmSocket::Address* out)
387 {

Callers 1

TESTFunction · 0.85

Calls 1

DecodeEscapedCharFunction · 0.70

Tested by

no test coverage detected