113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciPOST
613498266Sopenharmony_ciPOST callback
713498266Sopenharmony_cislow callback
813498266Sopenharmony_ciearly response
913498266Sopenharmony_ci</keywords>
1013498266Sopenharmony_ci</info>
1113498266Sopenharmony_ci#
1213498266Sopenharmony_ci# This test checks to make sure curl can call recv() without failing after a
1313498266Sopenharmony_ci# send() fails on the same socket (#657). Most OSes should support this
1413498266Sopenharmony_ci# natively. On Windows there were reported problems and a workaround via
1513498266Sopenharmony_ci# define USE_RECV_BEFORE_SEND_WORKAROUND was added.
1613498266Sopenharmony_ci# This proved problematic in other cases and was removed again.
1713498266Sopenharmony_ci#
1813498266Sopenharmony_ci# Server-side
1913498266Sopenharmony_ci<reply>
2013498266Sopenharmony_ci# Force server reply right after request headers, not waiting for request body
2113498266Sopenharmony_ci<servercmd>
2213498266Sopenharmony_ciskip: 45
2313498266Sopenharmony_ci</servercmd>
2413498266Sopenharmony_ci<data>
2513498266Sopenharmony_ciHTTP/1.1 500 Internal Server Error
2613498266Sopenharmony_ciDate: Thu, 17 Mar 2016 14:41:00 GMT
2713498266Sopenharmony_ciServer: test-server/fake
2813498266Sopenharmony_ciContent-Type: text/plain; charset=US-ASCII
2913498266Sopenharmony_ciX-Special: swsclose
3013498266Sopenharmony_ciContent-Length: 55
3113498266Sopenharmony_ciConnection: close
3213498266Sopenharmony_ci
3313498266Sopenharmony_ciThis is a virtual description of server virtual error.
3413498266Sopenharmony_ci</data>
3513498266Sopenharmony_ci</reply>
3613498266Sopenharmony_ci
3713498266Sopenharmony_ci# Client-side
3813498266Sopenharmony_ci<client>
3913498266Sopenharmony_ci<server>
4013498266Sopenharmony_cihttp
4113498266Sopenharmony_ci</server>
4213498266Sopenharmony_ci# tool is what to use instead of 'curl'
4313498266Sopenharmony_ci<tool>
4413498266Sopenharmony_cilib%TESTNUMBER
4513498266Sopenharmony_ci</tool>
4613498266Sopenharmony_ci# precheck is a command line to run before the test, to see if we can execute
4713498266Sopenharmony_ci# the test or not
4813498266Sopenharmony_ci<precheck>
4913498266Sopenharmony_ci./libtest/lib%TESTNUMBER check
5013498266Sopenharmony_ci</precheck>
5113498266Sopenharmony_ci
5213498266Sopenharmony_ci<name>
5313498266Sopenharmony_ciHTTP POST, server responds before completed send
5413498266Sopenharmony_ci</name>
5513498266Sopenharmony_ci<command>
5613498266Sopenharmony_cihttp://%HOSTIP:%HTTPPORT/%TESTNUMBER
5713498266Sopenharmony_ci</command>
5813498266Sopenharmony_ci</client>
5913498266Sopenharmony_ci
6013498266Sopenharmony_ci#
6113498266Sopenharmony_ci# Verify data after the test has been "shot"
6213498266Sopenharmony_ci<verify>
6313498266Sopenharmony_ci<strippart>
6413498266Sopenharmony_cis/^(this is what we post to the silly web server)(\r)?\n//
6513498266Sopenharmony_ci</strippart>
6613498266Sopenharmony_ci<protocol>
6713498266Sopenharmony_ciPOST /%TESTNUMBER HTTP/1.1
6813498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
6913498266Sopenharmony_ciAccept: */*
7013498266Sopenharmony_ciContent-Length: 45
7113498266Sopenharmony_ciContent-Type: application/x-www-form-urlencoded
7213498266Sopenharmony_ci
7313498266Sopenharmony_ci</protocol>
7413498266Sopenharmony_ci<errorcode>
7513498266Sopenharmony_ci0
7613498266Sopenharmony_ci</errorcode>
7713498266Sopenharmony_ci</verify>
7813498266Sopenharmony_ci</testcase>
79