// File: /workspace/github_c_makefile_star2_O0/niuyuling[P]CProxy/httpdns.c
// Function: http_in
static void http_in(dns_t * in)
{
    static char http_rsp[HTTP_RSP_SIZE + 1];
    int len;

    in->timer = 0;
    if (httpdns.connect_request && in->sent_CONNECT_len > httpdns.connect_request_len) {
        in->sent_CONNECT_len--;
        do {
            len = read(in->fd, http_rsp, HTTP_RSP_SIZE);
            //没有数据读取，CONNECT代理连接完成
            if (len < 0 && errno == EAGAIN)
                break;
            if (len <= 0) {
                dnsProxyStop(in);
                return;
            }
        } while (len == HTTP_RSP_SIZE);
        dns_ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
        dns_ev.data.ptr = in;
        epoll_ctl(dns_efd, EPOLL_CTL_MOD, in->fd, &dns_ev);
        return;
    }
    len = read(in->fd, http_rsp, HTTP_RSP_SIZE);
    if (len <= 0) {
        if (len == 0 || errno != EAGAIN)
            dnsProxyStop(in);
        return;
    }
    http_rsp[len] = '\0';
    if (httpdns.httpsProxy_encodeCode)
        dataEncode(http_rsp, len, httpdns.httpsProxy_encodeCode);
    if (httpdns.tcpDNS_mode == 1) {
        handle_tcpDNS_rsp(in, http_rsp, len);
    } else {
        handle_httpDNS_rsp(in, http_rsp, len);
    }
    dnsProxyStop(in);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x230(%rax)
cmpq $0x0, 0x14dfe(%rip)     # 0x1c6f0
je 0x79ab
movq -0x8(%rbp), %rax
movl 0x234(%rax), %eax
cmpl 0x14e10(%rip), %eax     # 0x1c718
jle 0x79ab
movq -0x8(%rbp), %rax
movl 0x234(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x234(%rax)
movq -0x8(%rbp), %rax
movl 0x22c(%rax), %edi
leaq 0x5e84e(%rip), %rsi     # 0x66180
movl $0x800, %edx            # imm = 0x800
callq 0x2260
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x7951
callq 0x2050
cmpl $0xb, (%rax)
jne 0x7951
jmp 0x7970
cmpl $0x0, -0xc(%rbp)
jg 0x7965
movq -0x8(%rbp), %rdi
callq 0x7560
jmp 0x7a58
jmp 0x7967
cmpl $0x800, -0xc(%rbp)      # imm = 0x800
je 0x7921
movl $0x80000005, 0x5cdca(%rip) # imm = 0x80000005
movq -0x8(%rbp), %rax
movq %rax, 0x5cdc3(%rip)     # 0x64748
movl 0x5cdb5(%rip), %edi     # 0x64740
movq -0x8(%rbp), %rax
movl 0x22c(%rax), %edx
movl $0x3, %esi
leaq 0x5cda3(%rip), %rcx     # 0x64744
callq 0x2240
jmp 0x7a58
movq -0x8(%rbp), %rax
movl 0x22c(%rax), %edi
leaq 0x5e7c4(%rip), %rsi     # 0x66180
movl $0x800, %edx            # imm = 0x800
callq 0x2260
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jg 0x79ea
cmpl $0x0, -0xc(%rbp)
je 0x79df
callq 0x2050
cmpl $0xb, (%rax)
je 0x79e8
movq -0x8(%rbp), %rdi
callq 0x7560
jmp 0x7a58
movslq -0xc(%rbp), %rcx
leaq 0x5e78b(%rip), %rax     # 0x66180
movb $0x0, (%rax,%rcx)
cmpl $0x0, 0x14d2c(%rip)     # 0x1c72c
je 0x7a17
movl -0xc(%rbp), %esi
movl 0x14d21(%rip), %edx     # 0x1c72c
leaq 0x5e76e(%rip), %rdi     # 0x66180
callq 0x3e20
movb 0x14d13(%rip), %al      # 0x1c730
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7a3c
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x5e74b(%rip), %rsi     # 0x66180
callq 0x8a00
jmp 0x7a4f
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x5e736(%rip), %rsi     # 0x66180
callq 0x8ac0
movq -0x8(%rbp), %rdi
callq 0x7560
addq $0x10, %rsp
popq %rbp
retq
nop