// File: enbock[P]Warp10Server/warp10server/src/Network/WebConnection.cpp
// Function: Warp10::Network::WebConnection::read(u::Object*)
void WebConnection::read(Object* arg)
{
	lock();
	if(_isReading == true)
	{
		unlock();
		return;
	}

	ByteArray* buffer = new ByteArray();
	_isReading = true;
	Socket* socket = _socket;
	unlock();

	trace(className() + ":read: Start reading.");
	int64 l;
	do {
		l = _socket->read(buffer);
	} while(l != 0);
	trace(className() + "::read: Done.");

	lock();
	_isReading = false;
	unlock();

	decodeBuffer(buffer);

	buffer->destroy();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x417410
movq -0x140(%rbp), %rax
movb 0x88(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x40a10b
movq -0x140(%rbp), %rdi
callq 0x417380
jmp 0x40a3fc
movl $0x58, %edi
callq 0x434cd0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
callq 0x40f0a0
jmp 0x40a129
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rax
movq %rax, -0x18(%rbp)
movb $0x1, 0x88(%rdi)
movq 0x90(%rdi), %rax
movq %rax, -0x30(%rbp)
callq 0x417380
movq $0x668c60, %rdi         # imm = 0x668C60
leaq 0x1d0f31(%rip), %rsi    # 0x5db091
callq 0x49dd60
movq %rax, -0x150(%rbp)
movb $0x0, -0xa9(%rbp)
movb $0x0, -0xab(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x40a182
jmp 0x40a1b8
movq -0x140(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0xa8(%rbp), %rdi
callq *%rax
movb $0x1, -0xa9(%rbp)
leaq -0x70(%rbp), %rsi
leaq 0x1d13ff(%rip), %rdx    # 0x5db5aa
leaq -0x50(%rbp), %rdi
callq 0x405d00
jmp 0x40a1b6
jmp 0x40a1ed
leaq -0xaa(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x435b90
movq -0x158(%rbp), %rdx
movb $0x1, -0xab(%rbp)
leaq 0x1f67c2(%rip), %rsi    # 0x6009a2
leaq -0x50(%rbp), %rdi
callq 0x407e60
jmp 0x40a1eb
jmp 0x40a1ed
movq -0x150(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x160(%rbp)
jmp 0x40a206
movq -0x160(%rbp), %rdi
leaq 0x1d0ebc(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x168(%rbp)
jmp 0x40a222
movq -0x168(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x40a237
leaq -0x50(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0xab(%rbp)
jne 0x40a24b
jmp 0x40a257
leaq -0xaa(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0xa9(%rbp)
jne 0x40a262
jmp 0x40a26e
leaq -0xa8(%rbp), %rdi
callq 0x405650
jmp 0x40a270
movq -0x140(%rbp), %rax
movq 0x90(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x41c080
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x40a270
movq $0x668c60, %rdi         # imm = 0x668C60
leaq 0x1d0deb(%rip), %rsi    # 0x5db091
callq 0x49dd60
movq %rax, -0x170(%rbp)
movb $0x0, -0x131(%rbp)
movb $0x0, -0x133(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x40a2c8
jmp 0x40a304
movq -0x140(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x130(%rbp), %rdi
callq *%rax
movb $0x1, -0x131(%rbp)
leaq -0xf8(%rbp), %rsi
leaq 0x1d12ea(%rip), %rdx    # 0x5db5de
leaq -0xd8(%rbp), %rdi
callq 0x405d00
jmp 0x40a302
jmp 0x40a33c
leaq -0x132(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x435b90
movq -0x178(%rbp), %rdx
movb $0x1, -0x133(%rbp)
leaq 0x1f6676(%rip), %rsi    # 0x6009a2
leaq -0xd8(%rbp), %rdi
callq 0x407e60
jmp 0x40a33a
jmp 0x40a33c
movq -0x170(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4b05e0
movq %rax, -0x180(%rbp)
jmp 0x40a358
movq -0x180(%rbp), %rdi
leaq 0x1d0d6a(%rip), %rsi    # 0x5db0d0
callq 0x49dd60
movq %rax, -0x188(%rbp)
jmp 0x40a374
movq -0x188(%rbp), %rdi
movq $0x49d640, %rsi         # imm = 0x49D640
callq 0x49c850
jmp 0x40a389
leaq -0xd8(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x133(%rbp)
jne 0x40a3a0
jmp 0x40a3ac
leaq -0x132(%rbp), %rdi
callq 0x435bb0
testb $0x1, -0x131(%rbp)
jne 0x40a3b7
jmp 0x40a3c3
leaq -0x130(%rbp), %rdi
callq 0x405650
movq -0x140(%rbp), %rdi
callq 0x417410
movq -0x140(%rbp), %rdi
movb $0x0, 0x88(%rdi)
callq 0x417380
movq -0x140(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x40(%rax)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x58, %esi
callq 0x433cf0
jmp 0x40a4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a458
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0xab(%rbp)
jne 0x40a463
jmp 0x40a46f
leaq -0xaa(%rbp), %rdi
callq 0x435bb0
jmp 0x40a471
testb $0x1, -0xa9(%rbp)
jne 0x40a47c
jmp 0x40a488
leaq -0xa8(%rbp), %rdi
callq 0x405650
jmp 0x40a4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a4d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a4be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4adc60
testb $0x1, -0x133(%rbp)
jne 0x40a4c9
jmp 0x40a4d5
leaq -0x132(%rbp), %rdi
callq 0x435bb0
jmp 0x40a4d7
testb $0x1, -0x131(%rbp)
jne 0x40a4e2
jmp 0x40a4ee
leaq -0x130(%rbp), %rdi
callq 0x405650
jmp 0x40a4f0
movq -0x20(%rbp), %rdi
callq 0x4deb40
nopl (%rax)