Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/network/socket/qabstractsocket.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    521521#if defined (QABSTRACTSOCKET_DEBUG)
    522522    QString typeStr;
    523     if (q->socketType() == QAbstractSocket::TcpSocket) typeStr = "TcpSocket";
    524     else if (q->socketType() == QAbstractSocket::UdpSocket) typeStr = "UdpSocket";
    525     else typeStr = "UnknownSocketType";
     523    if (q->socketType() == QAbstractSocket::TcpSocket) typeStr = ;
     524    else if (q->socketType() == QAbstractSocket::UdpSocket) typeStr = ;
     525    else typeStr = ;
    526526    QString protocolStr;
    527     if (protocol == QAbstractSocket::IPv4Protocol) protocolStr = "IPv4Protocol";
    528     else if (protocol == QAbstractSocket::IPv6Protocol) protocolStr = "IPv6Protocol";
    529     else protocolStr = "UnknownNetworkLayerProtocol";
     527    if (protocol == QAbstractSocket::IPv4Protocol) protocolStr = ;
     528    else if (protocol == QAbstractSocket::IPv6Protocol) protocolStr = ;
     529    else protocolStr = ;
    530530#endif
    531531
     
    874874        return;
    875875
     876
     877
     878
     879
    876880    addresses = hostInfo.addresses();
    877881
    878882#if defined(QABSTRACTSOCKET_DEBUG)
    879     QString s = "{";
     883    QString s = ;
    880884    for (int i = 0; i < addresses.count(); ++i) {
    881         if (i != 0) s += ", ";
     885        if (i != 0) s += ;
    882886        s += addresses.at(i).toString();
    883887    }
    884     s += '}';
     888    s += ;
    885889    qDebug("QAbstractSocketPrivate::_q_startConnecting(hostInfo == %s)", s.toLatin1().constData());
    886890#endif
  • trunk/src/network/socket/qabstractsocket.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qabstractsocket_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qabstractsocketengine.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qabstractsocketengine_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qhttpsocketengine.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    213213{
    214214    Q_D(QHttpSocketEngine);
    215     qint64 bytesRead = 0;
    216 
    217     if (!d->readBuffer.isEmpty()) {
    218         // Read as much from the buffer as we can.
    219         bytesRead = qMin((qint64)d->readBuffer.size(), maxlen);
    220         memcpy(data, d->readBuffer.constData(), bytesRead);
    221         data += bytesRead;
    222         maxlen -= bytesRead;
    223         d->readBuffer = d->readBuffer.mid(bytesRead);
    224     }
    225 
    226     qint64 bytesReadFromSocket = d->socket->read(data, maxlen);
     215    qint64 bytesRead = d->socket->read(data, maxlen);
    227216
    228217    if (d->socket->state() == QAbstractSocket::UnconnectedState
     
    231220    }
    232221
    233     if (bytesReadFromSocket > 0) {
    234         // Add to what we read so far.
    235         bytesRead += bytesReadFromSocket;
    236     } else if (bytesRead == 0 && bytesReadFromSocket == -1) {
     222    if (bytesRead == -1) {
    237223        // If nothing has been read so far, and the direct socket read
    238224        // failed, return the socket's error. Otherwise, fall through and
     
    561547
    562548    QHttpResponseHeader responseHeader(QString::fromLatin1(d->readBuffer));
    563     d->readBuffer.clear();
     549    d->readBuffer.clear();
    564550
    565551    int statusCode = responseHeader.statusCode();
  • trunk/src/network/socket/qhttpsocketengine_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    163163    QString peerName;
    164164    QTcpSocket *socket;
    165     QByteArray readBuffer;
     165    QByteArray readBuffer;
    166166    QHttpSocketEngine::HttpState state;
    167167    QAuthenticator authenticator;
  • trunk/src/network/socket/qlocalserver.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalserver.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalserver_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalserver_tcp.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalserver_unix.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalserver_win.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket_tcp.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket_unix.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qlocalsocket_win.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qnativesocketengine.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    779779        close();
    780780        return -1;
     781
     782
     783
     784
     785
    781786    }
    782787    return readBytes;
  • trunk/src/network/socket/qnativesocketengine_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qnativesocketengine_unix.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qnativesocketengine_win.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    995995    Q_Q(QNativeSocketEngine);
    996996    qint64 ret = 0;
    997     // don't send more than 49152 per call to WSASendTo to avoid getting a WSAENOBUFS
     997    qint64 bytesToSend = len;
     998
    998999    for (;;) {
    999         qint64 bytesToSend = qMin<qint64>(49152, len - ret);
    10001000        WSABUF buf;
    10011001        buf.buf = (char*)data + ret;
     
    10081008        ret += qint64(bytesWritten);
    10091009
     1010
    10101011        if (socketRet != SOCKET_ERROR) {
    10111012            if (ret == len)
     
    10131014            else
    10141015                continue;
    1015         } else if (WSAGetLastError() == WSAEWOULDBLOCK) {
    1016             break;
     1016        } else if ((err = WSAGetLastError()) == WSAEWOULDBLOCK) {
     1017            break;
     1018        } else if (err == WSAENOBUFS) {
     1019            // this function used to not send more than 49152 per call to WSASendTo
     1020            // to avoid getting a WSAENOBUFS. However this is a performance regression
     1021            // and we think it only appears with old windows versions. We now handle the
     1022            // WSAENOBUFS and hope it never appears anyway.
     1023            // just go on, the next loop run we will try a smaller number
    10171024        } else {
    1018             int err = WSAGetLastError();
    10191025            WS_ERROR_DEBUG(err);
    10201026            switch (err) {
     
    10301036            break;
    10311037        }
     1038
     1039
     1040
    10321041    }
    10331042
     
    11911200    qDebug("QNativeSocketEnginePrivate::nativeClose()");
    11921201#endif
    1193     linger l = {1, 0};
    1194     ::setsockopt(socketDescriptor, SOL_SOCKET, SO_DONTLINGER, (char*)&l, sizeof(l));
     1202    // We were doing a setsockopt here before with SO_DONTLINGER. (However with kind of wrong
     1203    // usage of parameters, it wants a BOOL but we used a struct and pretended it to be bool).
     1204    // We don't think setting this option should be done here, if a user wants it she/he can
     1205     // do it manually with socketDescriptor()/setSocketDescriptor();
    11951206    ::closesocket(socketDescriptor);
    11961207}
  • trunk/src/network/socket/qnet_unix_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qsocks5socketengine.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qsocks5socketengine_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qtcpserver.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qtcpserver.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qtcpsocket.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qtcpsocket.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qtcpsocket_p.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qudpsocket.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
  • trunk/src/network/socket/qudpsocket.h

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 20 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
Note: See TracChangeset for help on using the changeset viewer.