Miscellaneous tidying and fixes

This commit is contained in:
David Rowe 2021-06-26 22:07:48 +12:00
parent 5a5cb6488c
commit 2a9ab98e41
9 changed files with 21 additions and 15 deletions

View file

@ -252,8 +252,8 @@ public slots:
* <code>"127.0.0.1"</code> or <code>"localhost"</code>), a <code>file:///</code> address, a domain name, a named path * <code>"127.0.0.1"</code> or <code>"localhost"</code>), a <code>file:///</code> address, a domain name, a named path
* on a domain (starts with <code>"/"</code>), a position or position and orientation, or a user (starts with * on a domain (starts with <code>"/"</code>), a position or position and orientation, or a user (starts with
* <code>"@"</code>). * <code>"@"</code>).
* @param {boolean} [fromSuggestions=false] - Set to <code>true</code> if the address is obtained from the "Goto" dialog. * @param {boolean} [fromSuggestions=false] - Set to <code>true</code> if the address is obtained from the "Explore" app.
* Helps ensure that user's location history is correctly maintained. * Helps ensure that the user's location history is correctly maintained.
*/ */
void handleLookupString(const QString& lookupString, bool fromSuggestions = false); void handleLookupString(const QString& lookupString, bool fromSuggestions = false);
@ -390,10 +390,10 @@ signals:
void lookupResultIsNotFound(); void lookupResultIsNotFound();
/*@jsdoc /*@jsdoc
* Triggered when a request is made to go to an IP address. * Triggered when a request is made to go to a URL or IP address.
* @function location.possibleDomainChangeRequired * @function location.possibleDomainChangeRequired
* @param {Url} domainURL - URL for domain * @param {string} domainURL - The URL of the domain.
* @param {Uuid} domainID - The UUID of the domain to go to. * @param {Uuid} domainID - The UUID of the domain to go to. May be "{@link Uuid|Uuid.NULL} if not yet known.
* @returns {Signal} * @returns {Signal}
*/ */
// No example because this function isn't typically used in scripts. // No example because this function isn't typically used in scripts.

View file

@ -368,7 +368,7 @@ void DomainHandler::setIsConnected(bool isConnected) {
emit connectedToDomain(_domainURL); emit connectedToDomain(_domainURL);
// FIXME: Reinstate the requestDomainSettings() call here in version 2021.2.0 instead of having it in // FIXME: Reinstate the requestDomainSettings() call here in version 2021.2.0 instead of having it in
// NodeList::processDomainServerList(). // NodeList::processDomainList().
/* /*
if (_domainURL.scheme() == URL_SCHEME_HIFI && !_domainURL.host().isEmpty()) { if (_domainURL.scheme() == URL_SCHEME_HIFI && !_domainURL.host().isEmpty()) {
// we've connected to new domain - time to ask it for global settings // we've connected to new domain - time to ask it for global settings

View file

@ -147,7 +147,7 @@ NodeList::NodeList(char newOwnerType, int socketListenPort, int dtlsListenPort)
auto& packetReceiver = getPacketReceiver(); auto& packetReceiver = getPacketReceiver();
packetReceiver.registerListener(PacketType::DomainList, packetReceiver.registerListener(PacketType::DomainList,
PacketReceiver::makeUnsourcedListenerReference<NodeList>(this, &NodeList::processDomainServerList)); PacketReceiver::makeUnsourcedListenerReference<NodeList>(this, &NodeList::processDomainList));
packetReceiver.registerListener(PacketType::Ping, packetReceiver.registerListener(PacketType::Ping,
PacketReceiver::makeSourcedListenerReference<NodeList>(this, &NodeList::processPingPacket)); PacketReceiver::makeSourcedListenerReference<NodeList>(this, &NodeList::processPingPacket));
packetReceiver.registerListener(PacketType::PingReply, packetReceiver.registerListener(PacketType::PingReply,
@ -357,7 +357,7 @@ void NodeList::sendDomainServerCheckIn() {
if (publicSockAddr.isNull()) { if (publicSockAddr.isNull()) {
// we don't know our public socket and we need to send it to the domain server // we don't know our public socket and we need to send it to the domain server
qCDebug(networking_ice) << "Waiting for inital public socket from STUN. Will not send domain-server check in."; qCDebug(networking_ice) << "Waiting for initial public socket from STUN. Will not send domain-server check in.";
} else if (domainHandlerIp.isNull() && _domainHandler.requiresICE()) { } else if (domainHandlerIp.isNull() && _domainHandler.requiresICE()) {
qCDebug(networking_ice) << "Waiting for ICE discovered domain-server socket. Will not send domain-server check in."; qCDebug(networking_ice) << "Waiting for ICE discovered domain-server socket. Will not send domain-server check in.";
handleICEConnectionToDomainServer(); handleICEConnectionToDomainServer();
@ -401,6 +401,8 @@ void NodeList::sendDomainServerCheckIn() {
return; return;
} }
// WEBRTC TODO: Move code into packet library. And update reference in DomainConnectRequest.js.
auto domainPacket = NLPacket::create(domainPacketType); auto domainPacket = NLPacket::create(domainPacketType);
QDataStream packetStream(domainPacket.get()); QDataStream packetStream(domainPacket.get());
@ -709,7 +711,9 @@ void NodeList::processDomainServerConnectionTokenPacket(QSharedPointer<ReceivedM
sendDomainServerCheckIn(); sendDomainServerCheckIn();
} }
void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message) { void NodeList::processDomainList(QSharedPointer<ReceivedMessage> message) {
// WEBRTC TODO: Move code into packet library. And update reference in DomainServerList.js.
// parse header information // parse header information
QDataStream packetStream(message->getMessage()); QDataStream packetStream(message->getMessage());

View file

@ -109,7 +109,7 @@ public slots:
void sendDomainServerCheckIn(); void sendDomainServerCheckIn();
void handleDSPathQuery(const QString& newPath); void handleDSPathQuery(const QString& newPath);
void processDomainServerList(QSharedPointer<ReceivedMessage> message); void processDomainList(QSharedPointer<ReceivedMessage> message);
void processDomainServerAddedNode(QSharedPointer<ReceivedMessage> message); void processDomainServerAddedNode(QSharedPointer<ReceivedMessage> message);
void processDomainServerRemovedNode(QSharedPointer<ReceivedMessage> message); void processDomainServerRemovedNode(QSharedPointer<ReceivedMessage> message);
void processDomainServerPathResponse(QSharedPointer<ReceivedMessage> message); void processDomainServerPathResponse(QSharedPointer<ReceivedMessage> message);

View file

@ -57,7 +57,7 @@ BasePacket::BasePacket(qint64 size) {
} }
// Sanity check // Sanity check
Q_ASSERT(size >= 0 || size < maxPayload); Q_ASSERT(size >= 0 && size <= maxPayload);
_packetSize = size; _packetSize = size;
_packet.reset(new char[_packetSize]()); _packet.reset(new char[_packetSize]());

View file

@ -79,7 +79,7 @@ public:
qint64 writeDatagram(const QByteArray& datagram, const HifiSockAddr& sockAddr); qint64 writeDatagram(const QByteArray& datagram, const HifiSockAddr& sockAddr);
/// @brief Gets the number of bytes waiting to be written. /// @brief Gets the number of bytes waiting to be written.
/// @detail For UDP, there's a single buffer used for all destinations. For WebRTC, each destination has its own buffer. /// @details For UDP, there's a single buffer used for all destinations. For WebRTC, each destination has its own buffer.
/// @param socketType The type of socket for which to get the number of bytes waiting to be written. /// @param socketType The type of socket for which to get the number of bytes waiting to be written.
/// @param port If a WebRTC socket, the data channel for which to get the number of bytes waiting. /// @param port If a WebRTC socket, the data channel for which to get the number of bytes waiting.
/// @return The number of bytes waiting to be written. /// @return The number of bytes waiting to be written.

View file

@ -10,6 +10,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
// WEBRTC TODO: Rename / split up into files with better names.
#ifndef hifi_PacketHeaders_h #ifndef hifi_PacketHeaders_h
#define hifi_PacketHeaders_h #define hifi_PacketHeaders_h

View file

@ -124,9 +124,9 @@ public:
public slots: public slots:
/// @brief Handles the WebRTC data channel receiving a message. /// @brief Handles the WebRTC data channel receiving a message.
/// @details Queues the message to be read via readDatagram.
/// @param dataChannelID The data channel that the message was received on. /// @param dataChannelID The data channel that the message was received on.
/// @param message The message that was received. /// @param message The message that was received.
/// @detail Queues the message to be read via readDatagram.
void onDataChannelReceivedMessage(int dataChannelID, const QByteArray& message); void onDataChannelReceivedMessage(int dataChannelID, const QByteArray& message);
signals: signals:

View file

@ -509,7 +509,7 @@ EXTRACT_PACKAGE = NO
# included in the documentation. # included in the documentation.
# The default value is: NO. # The default value is: NO.
EXTRACT_STATIC = NO EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO, # locally in source files will be included in the documentation. If set to NO,
@ -794,7 +794,7 @@ CITE_BIB_FILES =
# messages are off. # messages are off.
# The default value is: NO. # The default value is: NO.
QUIET = NO QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are # The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES