facebook / facebook/hhvm

SoapServer + FastCGI fails on large requests

未關閉
#4,592 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
fastcgi
主要語言
C++
星號
18.7k
分支
3.1k
平均合併
1 小時 47 分鐘
30 天內合併 PR
2

描述

When using HHVM's SoapServer under FastCGI transport, we find that large requests (>~2k) always return SOAPFault due to truncation of the leading parts of the post body.

From the code, initial failure is here:
https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/soap/ext_soap.cpp#L2171

There, transport->getPostData() only returns trailling part of request, it looks like first 2k or so have already been read and dropped.

transport->getPostData() has already been called in processing of the request, through this path:

```
HttpRequestHandler
-> PrepareSystemVariables
-> PreparePostVariables
-> getPostData()
```

I'm not sure if getPostData() is intended to be used like this, but it appears at least its implementation is a bit at odds with what the caller from SoapServer expects it to do.

Example server code:
mysoap.php:

``` php
addFunction("ping");
$server->handle();
```

mysoap.wsdl (change YOUR_URL_HERE):

``` xml















```

Example (python) client code:

``` python
#!/usr/bin/python
from suds.client import Client
import logging

logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)

WSDL_URL = 'YOUR_URL_HERE/mysoap.wsdl'
client = Client(WSDL_URL)

request_size = 3000
request_arg = 'a' * request_size

result = client.service.ping(arg=request_arg)
print 'Result: %s' % result
```

Soap response for large request_size is as follows:

``` xml

SOAP-ENV:ClientBad Request
```

With smaller request_size (say 1000), a fault is not produced.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。