Simple pipelining HTTP client fails

23 views
Skip to first unread message

Artem Grinblat

unread,
May 6, 2013, 5:13:48 PM5/6/13
to mordor...@googlegroups.com
What's wrong with this code: http://pastebin.com/tU6ND9CE ?
Without the
  Buffer buf; clientRequest->responseStream()->read (buf, 4096);
it works okay, but with it, it gives a PriorRequestFailedException:

$ ./testMordor
fiber 0; request...
fiber 1; request...
fiber 0; read...
fiber 0: 213.87.134.18
Host: glim.ru
User-Agent: testMordor
fiber 0; finish...
fiber 0; pass
mordor/http/client.cpp(1043): Throw in function void Mordor::HTTP::ClientRequest::ensureResponse()
Dynamic exception type: boost::exception_detail::clone_impl<Mordor::HTTP::PriorRequestFailedException>
std::exception::what: std::exception
[Mordor::tag_backtrace*] = /usr/local/lib/libmordor.so.1(_ZN6Mordor4HTTP13ClientRequest14ensureResponseEv+0x2008) [0x7fdf435ea898]
/usr/local/lib/libmordor.so.1(_ZN6Mordor4HTTP13ClientRequest8responseEv+0x11) [0x7fdf435ed121]
/usr/local/lib/libmordor.so.1(_ZN6Mordor4HTTP17BaseRequestBroker7requestERNS0_7RequestEbN5boost8functionIFvNS4_10shared_ptrINS0_13ClientRequestEEEEEE+0x3ac) [0x7fdf435d142c]
/usr/local/lib/libmordor.so.1(_ZN6Mordor4HTTP21RedirectRequestBroker7requestERNS0_7RequestEbN5boost8functionIFvNS4_10shared_ptrINS0_13ClientRequestEEEEEE+0x144) [0x7fdf435cec14]
./testMordor() [0x424f1c]
./testMordor() [0x425ad0]
/usr/local/lib/libmordor.so.1(_ZNK5boost9function0IvEclEv+0x1c) [0x7fdf435bcb6c]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber10entryPointEv+0x50) [0x7fdf435b6010]
/lib/x86_64-linux-gnu/libc.so.6(+0x43020) [0x7fdf428ff020]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber7yieldToEbNS0_5StateE+0x1f0) [0x7fdf435b5650]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber7yieldToEb+0x19) [0x7fdf435b57b9]
/usr/local/lib/libmordor.so.1(_ZN6Mordor9Scheduler3runEv+0x611) [0x7fdf4365b3b1]
/usr/local/lib/libmordor.so.1(_ZNK5boost9function0IvEclEv+0x1c) [0x7fdf435bcb6c]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber10entryPointEv+0x50) [0x7fdf435b6010]
/lib/x86_64-linux-gnu/libc.so.6(+0x43020) [0x7fdf428ff020]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber7yieldToEbNS0_5StateE+0x1f0) [0x7fdf435b5650]
/usr/local/lib/libmordor.so.1(_ZN6Mordor5Fiber7yieldToEb+0x19) [0x7fdf435b57b9]
/usr/local/lib/libmordor.so.1(_ZN6Mordor9Scheduler7yieldToEb+0x73) [0x7fdf43659143]
/usr/local/lib/libmordor.so.1(_ZN6Mordor9Scheduler4stopEv+0x124) [0x7fdf43659e14]
./testMordor() [0x42545d]
./testMordor() [0x425715]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fdf428daead]
./testMordor() [0x424c69]
[Mordor::HTTP::tag_source*] = 1

Artem Grinblat

unread,
May 6, 2013, 6:07:42 PM5/6/13
to mordor...@googlegroups.com
Figured it out: had to close the stream. http://pastebin.com/cqf6UqA4

вторник, 7 мая 2013 г., 1:13:48 UTC+4 пользователь Artem Grinblat написал:
What's wrong with this code: http://pastebin.com/tU6ND9CE ?
Without the
  Buffer buf; clientRequest->responseStream()->read (buf, 4096);
it works okay, but with it, it gives a PriorRequestFailedException.

Reply all
Reply to author
Forward
0 new messages