facebook / facebook/hhvm

SoapServer + FastCGI fails on large requests

Abierto
#4,592 0 comentarios 0 reacciones 0 asignados Ver en GitHub
fastcgi
Lenguaje dominante
C++
Estrellas
18.7k
Forks
3.1k
Merge medio
1 h 47 min
PR fusionados (30 d)
2

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.