// File: /workspace/github_cpp_makefile_star2_O2/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 0x1448e
movl 0x8(%r15), %eax
cmpl $0x2, %eax
je 0x1441b
testl %eax, %eax
jne 0x14425
movq %rbx, %rdi
callq 0x1453a
leaq 0x2c8(%rbx), %rdi
callq 0x146d2
leaq 0xd41b(%rip), %rsi      # 0x217b9
movq %r14, %rdi
callq 0x146e0
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 0x14726
cmpq %r13, %r12
je 0x14438
leaq 0xd36a(%rip), %rsi      # 0x21746
movq %r14, %rdi
callq 0x14ab6
cmpq 0x348(%rbx), %rax
je 0x14438
addq $0x20, %rax
leaq 0xd7bd(%rip), %rsi      # 0x21bb5
movq %rax, %rdi
xorl %edx, %edx
callq 0x8300
cmpq $-0x1, %rax
je 0x14438
cmpb $0x1, 0x3c8(%rbx)
jne 0x14438
movq %rbx, %rdi
callq 0x14afc
jmp 0x14452
movq %rbx, %rdi
callq 0x13120
jmp 0x14452
leaq 0x3d0(%rbx), %rdi
movl $0x190, %esi            # imm = 0x190
callq 0x9b8a
jmp 0x1444a
leaq 0x490(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1fd54
movq %rbx, %rdi
callq 0x14a38
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop