// File: /workspace/github_cpp_makefile_star2_O1/trisolaris233[P]httpc/src/connection.hpp
// Function: httpc::Connection::HandleRead_(boost::system::error_code const&, unsigned long)
void HandleRead_(
            boost::system::error_code const& ec, std::size_t bytes_transferred
        ) {
            auto parse_res = 
                this->parser_.Parse(
                    this->request_, this->buffer_.data(),
                    this->buffer_.data() + bytes_transferred
                );
            auto res_enum = std::get<0>(parse_res);
            // if a request if parsed completely
            if (res_enum == RequestParser::kGood) {
                // all the headers is read
                // then check the alive state
                this->CheckKeepAlive_();
                // update the uri required
                this->request_.uri.Update();
                auto itr = this->request_.FindHeader("Content-Length");
                if (itr == this->request_.HeaderCEnd()) {
                    // if not found
                    // find the route
                    this->http_router_.Route(
                        this->request_.method,
                        this->request_.uri.GetUri(), 
                        this->request_, 
                        this->response_
                    );
                    this->handler_.Respond(
                        this->request_,
                        this->response_
                    );
                    this->DoWrite();
                } else {
                    // call once the user bussiness
                    // pass the judgement of whether receive the next file
                    // to user.
                    this->http_router_.Route(
                        this->request_.method,
                        this->request_.uri.GetUri(), 
                        this->request_, 
                        this->response_
                    );

                    auto itr2 = this->request_.FindHeader("Content-Type");
                    if (itr2 != this->request_.HeaderCEnd()
                        && itr2->value.find_first_of("multipart/formdata") != std::string::npos) {

                        if (this->request_.RecvNextFileOrNot()) {
                            debug().dg("here try to read post body").lf();
                            // debug().dg(this->socket_.available()).lf();
                            this->ReadBody();
                            return;
                        }
                    }
                    this->handler_.Respond(
                        this->request_,
                        this->response_
                    );
                    this->DoWrite();
                    
                    
                }
                // debug().dg("invoke this->readbody()").lf();
                //this->ResetKeepAliveTimer();
            } else if (res_enum == RequestParser::kIndeterminate) {
                //this->ResetKeepAliveTimer();
                this->DoRead();
            } else {   // make a bad request.
                this->response_.SetDefault(HTTPStatusCodeEnum::kBadRequest);
                this->DoWrite();
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x268(%rdi), %rsi
leaq 0x2a8(%rdi), %r14
leaq 0x68(%rdi), %rcx
leaq 0x68(%rdi,%rdx), %r8
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x16df6
movl 0x8(%r15), %eax
cmpl $0x2, %eax
je 0x16daf
testl %eax, %eax
jne 0x16db9
movq %rbx, %rdi
callq 0x16eea
leaq 0x2c8(%rbx), %rdi
movq %rdi, %rsi
callq 0x17c3e
leaq 0xda8c(%rip), %rsi      # 0x247b9
movq %r14, %rdi
callq 0x17114
movq %rax, %r12
movq 0x348(%rbx), %r13
movq 0x10(%rbx), %rdi
leaq 0x2e8(%rbx), %rdx
leaq 0x3d0(%rbx), %r15
movq %r14, %rsi
movq %r14, %rcx
movq %r15, %r8
callq 0x17188
cmpq %r13, %r12
je 0x16dcc
leaq 0xd9db(%rip), %rsi      # 0x24746
movq %r14, %rdi
callq 0x176f6
cmpq 0x348(%rbx), %rax
je 0x16dcc
addq $0x20, %rax
leaq 0xde2e(%rip), %rsi      # 0x24bb5
movl $0x12, %ecx
movq %rax, %rdi
xorl %edx, %edx
callq 0x8760
cmpq $-0x1, %rax
je 0x16dcc
cmpb $0x1, 0x3c8(%rbx)
jne 0x16dcc
movq %rbx, %rdi
callq 0x1776a
jmp 0x16de6
movq %rbx, %rdi
callq 0x15798
jmp 0x16de6
leaq 0x3d0(%rbx), %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xa5ba
jmp 0x16dde
leaq 0x490(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x234bc
movq %rbx, %rdi
callq 0x17650
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop