QJSONDocument and QNetworkReply



  • Ive run into a little problem addressing a bug;

    The application runs fine and receives a JSON response in linux.
    the application runs fine and receives a JSON response on windows when compiled with debug symbols and running in gdb.
    the application runs fine but does not receive a JSON response on windows in release version.

    QT 5.8.0

    This is a little confusing. The problem area is :

    try
    {
        QByteArray data;
        data = reply->readAll();
        std::string newVersionString;
    
        QJsonDocument replyJson = QJsonDocument::fromJson(data);
        QJsonObject obj = replyJson.object();
        if(!obj.empty()) {
    

    NOTE: obj is empty only in windows release version of the code. linux release its not empty and windows release with debug symbols running in gdb is not empty.

    any ideas.



  • upn looking further back i realised is the issue is with the network reply. it gets a empty or blank one and finished is signaled.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you try something like WireShark to see what happens on the network when it's not working ?
    Does your server generated something wrong ?



  • this sounds completely stupid but turns out the debugger is more forgiving dll wise and a dll was forgotten. my bad ! figured it out with errorReply() said SSL problems.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.