//read status: HTTP/1.1 200 OK
int count = http_read_line(input, 0);
String status = new String(_buffer, 0, count).toLowerCase();
if(!status.startsWith("http/1.1") && !status.startsWith("http/1.0"))
{
throw new SystemException("HTTP response error");
}
if(status.indexOf("200") == -1 || status.indexOf("ok") == -1)
{
throw new SystemException("HTTP response error");
}
//skip headers and read content length
boolean cLenRead = false;
int clen = 0;
while( (count = http_read_line(input, 0)) != 0)
{
if( (_buffer[0] == 'c' || _buffer[0] == 'C'))
{
String str = new String(_buffer, 0, count).toLowerCase();
if(str.startsWith("content-length:"))
{
str = str.substring(15).trim();
try
{
clen = java.lang.Integer.parseInt(str);
}
catch(Exception e)
{
throw new SystemException(e.toString());
}
cLenRead = true;
}
}
}
if(!cLenRead)
{
throw new SystemException("HTTP Post: Missing Content-Length");
}
//now read the iiop stream
GiopMessage gm = receive_message(input, url, false);