// File: /workspace/github_c_makefile_star2_O0/niuyuling[P]CProxy/httpudp.c
// Function: recvServer
static void recvServer(info_t * in)
{
    in->timer = 0;
    //当条件成立时表示未接收https回应状态码
    if (udp.http_request_len == in->http_request_sent_len) {
        static char http_rsp[HTTP_RSP_SIZE];
        int read_len;
        do {
            read_len = read(in->server_fd, http_rsp, HTTP_RSP_SIZE);
            if (read_len == 0 || (read_len < 0 && errno != EAGAIN)) {
                proxyStop(in);
                return;
            }
        } while (read_len == HTTP_RSP_SIZE);
        in->http_request_sent_len++; //不再接收http头
        udp_ev.data.ptr = in;
        udp_ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
        epoll_ctl(udp_efd, EPOLL_CTL_MOD, in->server_fd, &udp_ev);
        return;
    }

    char *new_data;
    int read_len;
    do {
        new_data = (char *)realloc(in->rsp_data, in->rsp_data_len + SERVER_BUFFER_SIZE);
        if (new_data == NULL) {
            proxyStop(in);
            return;
        }
        in->rsp_data = new_data;
        read_len = read(in->server_fd, in->rsp_data + in->rsp_data_len, SERVER_BUFFER_SIZE);
        /* 判断是否关闭连接 */
        if (read_len <= 0) {
            if (read_len == 0 || errno != EAGAIN || in->rsp_data_len == 0) {
                proxyStop(in);
                return;
            }
            read_len = 0;
            break;
        }
        if (udp.httpsProxy_encodeCode)
            dataEncode(in->rsp_data + in->rsp_data_len, read_len, udp.httpsProxy_encodeCode);
        if (udp.encodeCode)
            dataEncode(in->rsp_data + in->rsp_data_len, read_len, udp.encodeCode);
        in->rsp_data_len += read_len;
    } while (read_len == SERVER_BUFFER_SIZE);
    outputToClient(in);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x10064(%rax)
movl 0x206d978(%rip), %eax   # 0x20769d8
movq -0x8(%rbp), %rcx
cmpl 0x10050(%rcx), %eax
jne 0x910d
jmp 0x9072
movq -0x8(%rbp), %rax
movl 0x1005c(%rax), %edi
leaq 0x206dd6d(%rip), %rsi   # 0x2076df0
movl $0x800, %edx            # imm = 0x800
callq 0x2260
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x90a6
cmpl $0x0, -0xc(%rbp)
jge 0x90b4
callq 0x2050
cmpl $0xb, (%rax)
je 0x90b4
movq -0x8(%rbp), %rdi
callq 0x8d40
jmp 0x924f
jmp 0x90b6
cmpl $0x800, -0xc(%rbp)      # imm = 0x800
je 0x9072
movq -0x8(%rbp), %rax
movl 0x10050(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10050(%rax)
movq -0x8(%rbp), %rax
movq %rax, 0x206a8bb(%rip)   # 0x2073998
movl $0x80000005, 0x206a8ad(%rip) # imm = 0x80000005
movl 0x206a8a3(%rip), %edi   # 0x2073990
movq -0x8(%rbp), %rax
movl 0x1005c(%rax), %edx
movl $0x3, %esi
leaq 0x206a891(%rip), %rcx   # 0x2073994
callq 0x2240
jmp 0x924f
jmp 0x910f
movq -0x8(%rbp), %rax
movq 0x10040(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x10054(%rax), %eax
addl $0x2000, %eax           # imm = 0x2000
movslq %eax, %rsi
callq 0x23e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x914a
movq -0x8(%rbp), %rdi
callq 0x8d40
jmp 0x924f
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10040(%rax)
movq -0x8(%rbp), %rax
movl 0x1005c(%rax), %edi
movq -0x8(%rbp), %rax
movq 0x10040(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10054(%rax), %rax
addq %rax, %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x2260
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jg 0x91c6
cmpl $0x0, -0x1c(%rbp)
je 0x91ac
callq 0x2050
cmpl $0xb, (%rax)
jne 0x91ac
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10054(%rax)
jne 0x91ba
movq -0x8(%rbp), %rdi
callq 0x8d40
jmp 0x924f
movl $0x0, -0x1c(%rbp)
jmp 0x9246
cmpl $0x0, 0x206d817(%rip)   # 0x20769e4
je 0x91f6
movq -0x8(%rbp), %rax
movq 0x10040(%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x10054(%rax), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %esi
movl 0x206d7f3(%rip), %edx   # 0x20769e4
callq 0x3e20
cmpl $0x0, 0x206d7e3(%rip)   # 0x20769e0
je 0x9226
movq -0x8(%rbp), %rax
movq 0x10040(%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x10054(%rax), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %esi
movl 0x206d7bf(%rip), %edx   # 0x20769e0
callq 0x3e20
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x10054(%rax), %ecx
movl %ecx, 0x10054(%rax)
cmpl $0x2000, -0x1c(%rbp)    # imm = 0x2000
je 0x910f
movq -0x8(%rbp), %rdi
callq 0x9bd0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)