<commit_before>#include <cstring>

#include "linear/addrinfo.h"

namespace linear {

Addrinfo::Addrinfo() : addr("undefined"), port(-1), proto(UNKNOWN) {
}

Addrinfo::Addrinfo(const std::string& a, int p) : addr("undefined"), port(-1), proto(UNKNOWN) {
  struct addrinfo hints;
  struct addrinfo* res = NULL;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_INET;
  hints.ai_flags = AI_NUMERICHOST;
  int r = getaddrinfo(a.c_str(), NULL, &hints, &res);
  if (r == 0) {
    addr = a;
    port = p;
    proto = IPv4;
    freeaddrinfo(res);
    return;
  }<commit_msg>fix bug.  - cannot resolve hostname<commit_after>#include <cstring>

#include "linear/addrinfo.h"

namespace linear {

Addrinfo::Addrinfo() : addr("undefined"), port(-1), proto(UNKNOWN) {
}

Addrinfo::Addrinfo(const std::string& a, int p) : addr("undefined"), port(-1), proto(UNKNOWN) {
  struct addrinfo hints;
  struct addrinfo* res = NULL;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_INET;
  int r = getaddrinfo(a.c_str(), NULL, &hints, &res);
  if (r == 0) {
    addr = a;
    port = p;
    proto = IPv4;
    freeaddrinfo(res);
    return;
  }
{'fraction_non_alphanumeric': 0.16974494283201408, 'fraction_numerical': 0.008795074758135445, 'mean_word_length': 4.057777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5584285', 'n_tokens_mistral': 433, 'n_tokens_neox': 427, 'n_words': 101}