// File: /workspace/github_c_makefile_star2_O0/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpChilent_Close_nolock(httpChilent_t*)
void httpChilent_Close_nolock(struct httpChilent_t * client)
{
    struct sockaddr_in *address = NULL; 
    char ip[INET_ADDRSTRLEN];
    BufferevMap::iterator i;
    while(evbuffer_get_length(bufferevent_get_output(client->bev)) > 0);
    do
    {
        if(client == NULL)
        {
            De_printf("httpChilent NULL\r\n");
            break;
        }
        address = (struct sockaddr_in *)&(client->addr);
        if(address != NULL)
        {
            inet_ntop(AF_INET, &address->sin_addr,ip, INET_ADDRSTRLEN);
        }
            if(address != NULL)
                De_printf("Connection close:%s:%d\r\n", inet_ntop(AF_INET,&address->sin_addr, ip,(socklen_t) sizeof(ip)), ntohs(address->sin_port));  
            else
                De_printf("Connection close: Unknown\r\n");
    }
    while(0);
    bufferevent_lock(client->bev);
    bufferevent_disable(client->bev, EV_WRITE | EV_READ);
    if(client != NULL)
    {
        if(client->stat == HTTP_WS_DATA)
        {
            WebddSocket_Thread_Cb_arg_t * cb_arg = (WebddSocket_Thread_Cb_arg_t *)malloc(sizeof(WebddSocket_Thread_Cb_arg_t));
            cb_arg->client = client;
            cb_arg->type = Ws_Cb_Type_disconnect;
            threadpool_add(evbase_threadpool_get_threadpool(client->httpServer->evb_thpool), webSocke_thread_cb, cb_arg);
        }
        evbase_threadpool_close_event(client->httpServer->evb_thpool, bufferevent_get_base(client->bev));
        client->httpServer->clientMap->erase(client->bev);

        httpChilent_free(client);
    }
    bufferevent_unlock(client->bev);
    bufferevent_free(client->bev);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xb350
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x41b0
movq %rax, %rdi
callq 0x4550
cmpq $0x0, %rax
jbe 0x95da
jmp 0x95bd
jmp 0x95dc
cmpq $0x0, -0x8(%rbp)
jne 0x9627
jmp 0x95e5
leaq 0xabaf(%rip), %rdi      # 0x1419b
leaq 0xc4de(%rip), %rsi      # 0x15ad1
leaq 0xc4b5(%rip), %rdx      # 0x15aaf
movl $0x3e8, %ecx            # imm = 0x3E8
movb $0x0, %al
callq 0x4080
leaq 0xc4dd(%rip), %rdi      # 0x15aea
movb $0x0, %al
callq 0x4080
leaq 0xc6ce(%rip), %rdi      # 0x15ce9
movb $0x0, %al
callq 0x4080
jmp 0x9715
movq -0x8(%rbp), %rax
addq $0xa4, %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9657
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
leaq -0x20(%rbp), %rdx
movl $0x2, %edi
movl $0x10, %ecx
callq 0x4540
cmpq $0x0, -0x10(%rbp)
je 0x96d2
jmp 0x9660
leaq 0xab34(%rip), %rdi      # 0x1419b
leaq 0xc463(%rip), %rsi      # 0x15ad1
leaq 0xc43a(%rip), %rdx      # 0x15aaf
movl $0x3f1, %ecx            # imm = 0x3F1
movb $0x0, %al
callq 0x4080
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
leaq -0x20(%rbp), %rdx
movl $0x2, %edi
movl $0x10, %ecx
callq 0x4540
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x4890
movq -0x38(%rbp), %rsi
movzwl %ax, %edx
leaq 0xc442(%rip), %rdi      # 0x15afd
movb $0x0, %al
callq 0x4080
leaq 0xc620(%rip), %rdi      # 0x15ce9
movb $0x0, %al
callq 0x4080
jmp 0x9713
jmp 0x96d4
leaq 0xaac0(%rip), %rdi      # 0x1419b
leaq 0xc3ef(%rip), %rsi      # 0x15ad1
leaq 0xc3c6(%rip), %rdx      # 0x15aaf
movl $0x3f3, %ecx            # imm = 0x3F3
movb $0x0, %al
callq 0x4080
leaq 0xc41a(%rip), %rdi      # 0x15b16
movb $0x0, %al
callq 0x4080
leaq 0xc5df(%rip), %rdi      # 0x15ce9
movb $0x0, %al
callq 0x4080
jmp 0x9713
jmp 0x9715
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x4710
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x6, %esi
callq 0x4750
cmpq $0x0, -0x8(%rbp)
je 0x97dc
movq -0x8(%rbp), %rax
cmpl $0x5, 0x38(%rax)
jne 0x9791
movl $0x10, %edi
callq 0x46a0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl $0x3, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x60(%rax), %rdi
callq 0xd800
movq %rax, %rdi
movq -0x30(%rbp), %rdx
leaq -0x1b2c(%rip), %rsi     # 0x7c60
callq 0xfc20
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x60(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x4820
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xe060
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x50(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x30, %rsi
callq 0xb370
movq -0x8(%rbp), %rdi
callq 0x9800
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x47d0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x4160
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)