| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d9cd171 commit be75795
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -856,23 +856,20 @@ int ParseMxReply(Environment* env, | |||
| 856 | 856 | return status; | |
| 857 | 857 | } | |
| 858 | 858 | ||
| 859 | - Local<String> exchange_symbol = env->exchange_string(); | ||
| 860 | - Local<String> priority_symbol = env->priority_string(); | ||
| 861 | - Local<String> type_symbol = env->type_string(); | ||
| 862 | - Local<String> mx_symbol = env->dns_mx_string(); | ||
| 863 | - | ||
| 864 | 859 | uint32_t offset = ret->Length(); | |
| 865 | 860 | ares_mx_reply* current = mx_start; | |
| 866 | 861 | for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { | |
| 867 | 862 | Local<Object> mx_record = Object::New(env->isolate()); | |
| 868 | 863 | mx_record->Set(context, | |
| 869 | - exchange_symbol, | ||
| 864 | + env->exchange_string(), | ||
| 870 | 865 | OneByteString(env->isolate(), current->host)).FromJust(); | |
| 871 | 866 | mx_record->Set(context, | |
| 872 | - priority_symbol, | ||
| 867 | + env->priority_string(), | ||
| 873 | 868 | Integer::New(env->isolate(), current->priority)).FromJust(); | |
| 874 | 869 | if (need_type) | |
| 875 | - mx_record->Set(context, type_symbol, mx_symbol).FromJust(); | ||
| 870 | + mx_record->Set(context, | ||
| 871 | + env->type_string(), | ||
| 872 | + env->dns_mx_string()).FromJust(); | ||
| 876 | 873 | ||
| 877 | 874 | ret->Set(context, i + offset, mx_record).FromJust(); | |
| 878 | 875 | } | |
@@ -959,31 +956,26 @@ int ParseSrvReply(Environment* env, | |||
| 959 | 956 | return status; | |
| 960 | 957 | } | |
| 961 | 958 | ||
| 962 | - Local<String> name_symbol = env->name_string(); | ||
| 963 | - Local<String> port_symbol = env->port_string(); | ||
| 964 | - Local<String> priority_symbol = env->priority_string(); | ||
| 965 | - Local<String> weight_symbol = env->weight_string(); | ||
| 966 | - Local<String> type_symbol = env->type_string(); | ||
| 967 | - Local<String> srv_symbol = env->dns_srv_string(); | ||
| 968 | - | ||
| 969 | 959 | ares_srv_reply* current = srv_start; | |
| 970 | 960 | int offset = ret->Length(); | |
| 971 | 961 | for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { | |
| 972 | 962 | Local<Object> srv_record = Object::New(env->isolate()); | |
| 973 | 963 | srv_record->Set(context, | |
| 974 | - name_symbol, | ||
| 964 | + env->name_string(), | ||
| 975 | 965 | OneByteString(env->isolate(), current->host)).FromJust(); | |
| 976 | 966 | srv_record->Set(context, | |
| 977 | - port_symbol, | ||
| 967 | + env->port_string(), | ||
| 978 | 968 | Integer::New(env->isolate(), current->port)).FromJust(); | |
| 979 | 969 | srv_record->Set(context, | |
| 980 | - priority_symbol, | ||
| 970 | + env->priority_string(), | ||
| 981 | 971 | Integer::New(env->isolate(), current->priority)).FromJust(); | |
| 982 | 972 | srv_record->Set(context, | |
| 983 | - weight_symbol, | ||
| 973 | + env->weight_string(), | ||
| 984 | 974 | Integer::New(env->isolate(), current->weight)).FromJust(); | |
| 985 | 975 | if (need_type) | |
| 986 | - srv_record->Set(context, type_symbol, srv_symbol).FromJust(); | ||
| 976 | + srv_record->Set(context, | ||
| 977 | + env->type_string(), | ||
| 978 | + env->dns_srv_string()).FromJust(); | ||
| 987 | 979 | ||
| 988 | 980 | ret->Set(context, i + offset, srv_record).FromJust(); | |
| 989 | 981 | } | |
@@ -1008,43 +1000,36 @@ int ParseNaptrReply(Environment* env, | |||
| 1008 | 1000 | return status; | |
| 1009 | 1001 | } | |
| 1010 | 1002 | ||
| 1011 | - Local<String> flags_symbol = env->flags_string(); | ||
| 1012 | - Local<String> service_symbol = env->service_string(); | ||
| 1013 | - Local<String> regexp_symbol = env->regexp_string(); | ||
| 1014 | - Local<String> replacement_symbol = env->replacement_string(); | ||
| 1015 | - Local<String> order_symbol = env->order_string(); | ||
| 1016 | - Local<String> preference_symbol = env->preference_string(); | ||
| 1017 | - Local<String> type_symbol = env->type_string(); | ||
| 1018 | - Local<String> naptr_symbol = env->dns_naptr_string(); | ||
| 1019 | - | ||
| 1020 | 1003 | ares_naptr_reply* current = naptr_start; | |
| 1021 | 1004 | int offset = ret->Length(); | |
| 1022 | 1005 | for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { | |
| 1023 | 1006 | Local<Object> naptr_record = Object::New(env->isolate()); | |
| 1024 | 1007 | naptr_record->Set(context, | |
| 1025 | - flags_symbol, | ||
| 1008 | + env->flags_string(), | ||
| 1026 | 1009 | OneByteString(env->isolate(), current->flags)).FromJust(); | |
| 1027 | 1010 | naptr_record->Set(context, | |
| 1028 | - service_symbol, | ||
| 1011 | + env->service_string(), | ||
| 1029 | 1012 | OneByteString(env->isolate(), | |
| 1030 | 1013 | current->service)).FromJust(); | |
| 1031 | 1014 | naptr_record->Set(context, | |
| 1032 | - regexp_symbol, | ||
| 1015 | + env->regexp_string(), | ||
| 1033 | 1016 | OneByteString(env->isolate(), | |
| 1034 | 1017 | current->regexp)).FromJust(); | |
| 1035 | 1018 | naptr_record->Set(context, | |
| 1036 | - replacement_symbol, | ||
| 1019 | + env->replacement_string(), | ||
| 1037 | 1020 | OneByteString(env->isolate(), | |
| 1038 | 1021 | current->replacement)).FromJust(); | |
| 1039 | 1022 | naptr_record->Set(context, | |
| 1040 | - order_symbol, | ||
| 1023 | + env->order_string(), | ||
| 1041 | 1024 | Integer::New(env->isolate(), current->order)).FromJust(); | |
| 1042 | 1025 | naptr_record->Set(context, | |
| 1043 | - preference_symbol, | ||
| 1026 | + env->preference_string(), | ||
| 1044 | 1027 | Integer::New(env->isolate(), | |
| 1045 | 1028 | current->preference)).FromJust(); | |
| 1046 | 1029 | if (need_type) | |
| 1047 | - naptr_record->Set(context, type_symbol, naptr_symbol).FromJust(); | ||
| 1030 | + naptr_record->Set(context, | ||
| 1031 | + env->type_string(), | ||
| 1032 | + env->dns_naptr_string()).FromJust(); | ||
| 1048 | 1033 | ||
| 1049 | 1034 | ret->Set(context, i + offset, naptr_record).FromJust(); | |
| 1050 | 1035 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments