Merge branch 'master' of github.com:awakecoding/FreeRDP

This commit is contained in:
Marc-André Moreau 2012-11-14 09:01:47 -05:00
commit d0c66ce767
2 changed files with 33 additions and 18 deletions

View File

@ -22,6 +22,7 @@
#endif
#include <winpr/crt.h>
#include <winpr/print.h>
#include <freerdp/utils/memory.h>
@ -405,25 +406,39 @@ HttpResponse* http_response_recv(rdpTls* tls)
while (TRUE)
{
status = tls_read(tls, p, length - nbytes);
while (nbytes < 5)
{
status = tls_read(tls, p, length - nbytes);
if (status > 0)
{
nbytes += status;
p = (BYTE*) &buffer[nbytes];
}
else if (status == 0)
{
continue;
}
else
{
http_response_free(http_response);
return NULL;
}
}
if (status > 0)
{
nbytes += status;
p = (BYTE*) &buffer[nbytes];
}
else if (status == 0)
{
continue;
}
else
{
http_response_free(http_response) ;
header_end = strstr((char*) buffer, "\r\n\r\n");
if (header_end)
{
header_end += 2;
}
else
{
printf("http_response_recv: invalid response:\n");
winpr_HexDump(buffer, status);
http_response_free(http_response);
return NULL;
break;
}
header_end = strstr((char*) buffer, "\r\n\r\n") + 2;
}
if (header_end != NULL)
{

View File

@ -85,7 +85,7 @@ BOOL rts_connect(rdpRpc* rpc)
if (http_response->StatusCode != 200)
{
printf("rts_connect error!\n");
printf("rts_connect error! Status Code: %d\n", http_response->StatusCode);
http_response_print(http_response);
http_response_free(http_response) ;
return FALSE;