(file) Return to HTTPConnection.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/HTTPConnection.cpp between version 1.127 and 1.128

version 1.127, 2007/01/16 20:23:22 version 1.128, 2007/02/13 19:21:44
Line 345 
Line 345 
     Boolean isFirst = message.isFirst();     Boolean isFirst = message.isFirst();
     Boolean isLast = message.isComplete();     Boolean isLast = message.isComplete();
     Sint32 totalBytesWritten = 0;     Sint32 totalBytesWritten = 0;
     Uint32 messageLength = (Uint32) buffer.size();      Uint32 messageLength = buffer.size();
  
     try     try
     {     {
Line 441 
Line 441 
                         String httpStatus(s);                         String httpStatus(s);
                         Buffer message = XmlWriter::formatHttpErrorRspMessage                         Buffer message = XmlWriter::formatHttpErrorRspMessage
                             (httpStatus, String(), httpDetail);                             (httpStatus, String(), httpDetail);
                         messageLength = (Uint32)message.size();                          messageLength = message.size();
                         message.reserveCapacity(messageLength+1);                         message.reserveCapacity(messageLength+1);
                         messageStart = (char *) message.getData();                         messageStart = (char *) message.getData();
                         messageStart[messageLength] = 0;                         messageStart[messageLength] = 0;
Line 454 
Line 454 
                 {                 {
                     // subsequent chunks from the server, just append                     // subsequent chunks from the server, just append
  
                     messageLength += (Uint32)(_incomingBuffer.size());                      messageLength += _incomingBuffer.size();
                     _incomingBuffer.reserveCapacity(messageLength+1);                     _incomingBuffer.reserveCapacity(messageLength+1);
                     _incomingBuffer.append(buffer.getData(), buffer.size());                     _incomingBuffer.append(buffer.getData(), buffer.size());
                     buffer.clear();                     buffer.clear();
Line 663 
Line 663 
                             Uint32 insertOffset =                             Uint32 insertOffset =
                                 headerLength - headerLineTerminatorLength;                                 headerLength - headerLineTerminatorLength;
                             messageLength =                             messageLength =
                                 (Uint32)(contentLanguagesString.size() +                                  contentLanguagesString.size() + buffer.size();
                                     buffer.size());  
                             buffer.reserveCapacity(messageLength+1);                             buffer.reserveCapacity(messageLength+1);
                             messageLength =                              messageLength = contentLanguagesString.size();
                                 (Uint32)contentLanguagesString.size();  
                             messageStart =                             messageStart =
                                 (char *)contentLanguagesString.getData();                                 (char *)contentLanguagesString.getData();
                             // insert the content language line before end                             // insert the content language line before end
Line 675 
Line 673 
                             // note: this can be expensive on large payloads                             // note: this can be expensive on large payloads
                             buffer.insert(                             buffer.insert(
                                 insertOffset, messageStart, messageLength);                                 insertOffset, messageStart, messageLength);
                             messageLength = (Uint32)buffer.size();                              messageLength = buffer.size();
                             // null terminate                             // null terminate
                             messageStart = (char *) buffer.getData();                             messageStart = (char *) buffer.getData();
                             messageStart[messageLength] = 0;                             messageStart[messageLength] = 0;
Line 777 
Line 775 
                 _mpostPrefix << headerNameDescription << headerValueSeparator <<                 _mpostPrefix << headerNameDescription << headerValueSeparator <<
                 headerNameContentLanguage << headerLineTerminator;                 headerNameContentLanguage << headerLineTerminator;
             sendStart = (char *) trailer.getData();             sendStart = (char *) trailer.getData();
             bytesToWrite = (Uint32)trailer.size();              bytesToWrite = trailer.size();
             bytesWritten = _socket->write(sendStart, bytesToWrite);             bytesWritten = _socket->write(sendStart, bytesToWrite);
  
             if (bytesWritten < 0)             if (bytesWritten < 0)
Line 1090 
Line 1088 
 { {
     static const char func[] =     static const char func[] =
     "HTTPConnection::_getContentLengthAndContentOffset";     "HTTPConnection::_getContentLengthAndContentOffset";
     Uint32 size = (Uint32)_incomingBuffer.size();      Uint32 size = _incomingBuffer.size();
     if (size == 0)     if (size == 0)
         return;         return;
     char* data = (char*)_incomingBuffer.getData();     char* data = (char*)_incomingBuffer.getData();
Line 1437 
Line 1435 
         "HTTPConnection::_handleReadEventTransferEncoding";         "HTTPConnection::_handleReadEventTransferEncoding";
     PEG_METHOD_ENTER(TRC_HTTP, func);     PEG_METHOD_ENTER(TRC_HTTP, func);
  
     Uint32 messageLength = (Uint32)_incomingBuffer.size();      Uint32 messageLength = _incomingBuffer.size();
     Uint32 headerLength = (Uint32) _contentOffset;     Uint32 headerLength = (Uint32) _contentOffset;
  
     // return immediately under these conditions:     // return immediately under these conditions:
Line 1571 
Line 1569 
  
         // remove the chunk length line         // remove the chunk length line
         _incomingBuffer.remove(_transferEncodingChunkOffset, chunkLineLength);         _incomingBuffer.remove(_transferEncodingChunkOffset, chunkLineLength);
         messageLength = (Uint32)_incomingBuffer.size();          messageLength = _incomingBuffer.size();
         // always keep the byte after the last data byte null for easy string         // always keep the byte after the last data byte null for easy string
         // processing.         // processing.
         messageStart[messageLength] = 0;         messageStart[messageLength] = 0;
Line 1620 
Line 1618 
                 trailerStart[trailerLength] = save;                 trailerStart[trailerLength] = save;
  
                 _incomingBuffer.remove(trailerOffset, trailerLength);                 _incomingBuffer.remove(trailerOffset, trailerLength);
                 messageLength = (Uint32)_incomingBuffer.size();                  messageLength = _incomingBuffer.size();
                 messageStart[messageLength] = 0;                 messageStart[messageLength] = 0;
                 remainderLength -= trailerLength;                 remainderLength -= trailerLength;
  
Line 1784 
Line 1782 
  
         // now remove the chunk terminator         // now remove the chunk terminator
         _incomingBuffer.remove(chunkTerminatorOffset, chunkTerminatorLength);         _incomingBuffer.remove(chunkTerminatorOffset, chunkTerminatorLength);
         messageLength = (Uint32)_incomingBuffer.size();          messageLength = _incomingBuffer.size();
         messageStart[messageLength] = 0;         messageStart[messageLength] = 0;
  
         // jump to the start of the next chunk (which may not have been         // jump to the start of the next chunk (which may not have been
Line 1827 
Line 1825 
     HTTPMessage* httpMessage = new HTTPMessage(message);     HTTPMessage* httpMessage = new HTTPMessage(message);
     Tracer::traceBuffer(TRC_XML_IO, Tracer::LEVEL2,     Tracer::traceBuffer(TRC_XML_IO, Tracer::LEVEL2,
         httpMessage->message.getData(),         httpMessage->message.getData(),
         (Uint32)(httpMessage->message.size()));          httpMessage->message.size());
  
     // this is common error code. If we are the server side, we want to send     // this is common error code. If we are the server side, we want to send
     // back the error to the client, but if we are the client side, then we     // back the error to the client, but if we are the client side, then we


Legend:
Removed from v.1.127  
changed lines
  Added in v.1.128

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2