<commit_before>
#include "http.h"
#include "core.h"

#include <uv.h>

static int
http_send_request(struct context *ctx) {
    struct http_request req;
    rps_addr_t  *remote;
    struct upstream *u;
    char message[HTTP_MESSAGE_MAX_LENGTH];
    int len;

    remote = &ctx->sess->remote;
    ASSERT(remote->family == AF_DOMAIN);

    http_request_init(&req);
    
    req.method = http_connect;
    req.port = (int)remote->addr.name.port;
    string_duplicate(&req.host, remote->addr.name.host, strlen(remote->addr.name.host));<commit_msg>Handle remote addr in a appropriate way while hybrid enable.<commit_after>
#include "http.h"
#include "core.h"

#include <uv.h>

static int
http_send_request(struct context *ctx) {
    struct http_request req;
    struct upstream *u;
    rps_addr_t  *remote;
    char remote_addr[MAX_INET_ADDRSTRLEN];
    char message[HTTP_MESSAGE_MAX_LENGTH];
    int len;

    remote = &ctx->sess->remote;

    if (rps_unresolve_addr(remote, remote_addr) != RPS_OK) {
        return RPS_ERROR;
    }


    http_request_init(&req);
    
    req.method = http_connect;
    req.port = (int)rps_unresolve_port(remote);
    string_duplicate(&req.host, remote_addr, strlen(remote_addr));
{'fraction_non_alphanumeric': 0.1216887417218543, 'fraction_numerical': 0.0, 'mean_word_length': 3.816733067729084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1843051', 'n_tokens_mistral': 427, 'n_tokens_neox': 419, 'n_words': 86}