facebook / facebook/hhvm

SoapServer + FastCGI fails on large requests

オープン
#4,592 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
fastcgi
主要言語
C++
スター
18.7k
フォーク
3.1k
平均マージ
1時間 47分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。