| 1 |
|
| #include <stdlib.h> |
| 2 |
|
| #include "scan.h" |
| 3 |
|
| |
| 4 |
|
| void |
| 5 |
2 |
| scan_search_entry_response(const char** src, const char* max, HV *out) { |
| 6 |
|
| SV *dn, *key; |
| 7 |
|
| STRLEN len; |
| 8 |
2 |
| dn = newSV(0); |
| 9 |
2 |
| hv_stores(out, "dn", dn); |
| 10 |
2 |
| scan_string_utf8(src, max, dn); |
| 11 |
|
| |
| 12 |
2 |
▶ | scan_sequence(src, max, &len); |
Branch: 2 branches
| Branch | True | False | Total |
| scan_sequence(src, max, &len); |
2 |
0 |
2 |
| scan_sequence(src, max, &len); |
2 |
0 |
2 |
|
| 13 |
2 |
▶ | if (len != max - *src) |
Branch: 1 branch
| Branch | True | False | Total |
| if (len != max - *src) |
0 |
2 |
2 |
|
| 14 |
0 |
| croak("scan_search_entry_response: packet too short"); |
| 15 |
|
| |
| 16 |
2 |
| key = sv_newmortal(); |
| 17 |
4 |
▶ | while (*src < max) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (*src < max) { |
2 |
2 |
4 |
|
| 18 |
|
| const char *attribute_max; |
| 19 |
|
| AV *values; |
| 20 |
2 |
▶ | scan_sequence(src, max, &len); |
Branch: 2 branches
| Branch | True | False | Total |
| scan_sequence(src, max, &len); |
2 |
0 |
2 |
| scan_sequence(src, max, &len); |
2 |
0 |
2 |
|
| 21 |
2 |
| attribute_max = *src + len; |
| 22 |
2 |
| scan_string_utf8(src, max, key); |
| 23 |
2 |
| values = newAV(); |
| 24 |
2 |
| hv_store_ent(out, key, newRV_noinc((SV*)values), 0); |
| 25 |
2 |
▶ | scan_set(src, max, &len); |
Branch: 2 branches
| Branch | True | False | Total |
| scan_set(src, max, &len); |
2 |
0 |
2 |
| scan_set(src, max, &len); |
2 |
0 |
2 |
|
| 26 |
2 |
▶ | if (attribute_max != *src + len) |
Branch: 1 branch
| Branch | True | False | Total |
| if (attribute_max != *src + len) |
0 |
2 |
2 |
|
| 27 |
0 |
| croak("bad packet"); |
| 28 |
6 |
▶ | while (*src < attribute_max) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (*src < attribute_max) { |
4 |
2 |
6 |
|
| 29 |
4 |
| SV *v = newSV(0); |
| 30 |
4 |
| av_push(values, v); |
| 31 |
4 |
| scan_string_utf8(src, attribute_max, v); |
| 32 |
|
| } |
| 33 |
|
| } |
| 34 |
2 |
| } |