Handle 'Location' header reply in drmprocessorclientimpl
This commit is contained in:
		@@ -40,7 +40,7 @@
 | 
				
			|||||||
#define ACS_SERVER              "http://adeactivate.adobe.com/adept"
 | 
					#define ACS_SERVER              "http://adeactivate.adobe.com/adept"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define LIBGOUROU_VERSION       "0.2"
 | 
					#define LIBGOUROU_VERSION       "0.2.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace gourou
 | 
					namespace gourou
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -107,7 +107,8 @@ namespace gourou
 | 
				
			|||||||
	CLIENT_BAD_KEY_SIZE,
 | 
						CLIENT_BAD_KEY_SIZE,
 | 
				
			||||||
	CLIENT_BAD_ZIP_FILE,
 | 
						CLIENT_BAD_ZIP_FILE,
 | 
				
			||||||
	CLIENT_ZIP_ERROR,
 | 
						CLIENT_ZIP_ERROR,
 | 
				
			||||||
	CLIENT_GENERIC_EXCEPTION
 | 
						CLIENT_GENERIC_EXCEPTION,
 | 
				
			||||||
 | 
						CLIENT_NETWORK_ERROR,
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -111,6 +111,24 @@ std::string DRMProcessorClientImpl::sendHTTPRequest(const std::string& URL, cons
 | 
				
			|||||||
    while (!reply->isFinished())
 | 
					    while (!reply->isFinished())
 | 
				
			||||||
	app->processEvents();
 | 
						app->processEvents();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QByteArray location = reply->rawHeader("Location");
 | 
				
			||||||
 | 
					    if (location.size() != 0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
						GOUROU_LOG(gourou::DEBUG, "New location");
 | 
				
			||||||
 | 
						return sendHTTPRequest(location.constData(), POSTData, contentType);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (reply->error() != QNetworkReply::NoError)
 | 
				
			||||||
 | 
						EXCEPTION(gourou::CLIENT_NETWORK_ERROR, "Error " << reply->error());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (gourou::logLevel >= gourou::DEBUG)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
						QList<QByteArray> headers = reply->rawHeaderList();
 | 
				
			||||||
 | 
						for (int i = 0; i < headers.size(); ++i) {
 | 
				
			||||||
 | 
						    std::cout << headers[i].constData() << " : "  << reply->rawHeader(headers[i]).constData() << std::endl;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    replyData = reply->readAll();
 | 
					    replyData = reply->readAll();
 | 
				
			||||||
    if (reply->rawHeader("Content-Type") == "application/vnd.adobe.adept+xml")
 | 
					    if (reply->rawHeader("Content-Type") == "application/vnd.adobe.adept+xml")
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user