From 449978990a390ea7c9870ed65fd9122cddda535c Mon Sep 17 00:00:00 2001 From: kavinhan Date: Wed, 26 Sep 2018 10:22:05 +0800 Subject: [PATCH] change postDate and doPostForm function change functions timespan number value to timeoutSeconds parameter --- src/ofxHttpUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ofxHttpUtils.cpp b/src/ofxHttpUtils.cpp index 0039887..92b25d2 100644 --- a/src/ofxHttpUtils.cpp +++ b/src/ofxHttpUtils.cpp @@ -183,13 +183,13 @@ ofxHttpResponse ofxHttpUtils::postData(string url, const ofBuffer & data, strin istream * rs; if(uri.getScheme()=="https"){ HTTPSClientSession * httpsSession = new HTTPSClientSession(uri.getHost(), uri.getPort());//,context); - httpsSession->setTimeout(Poco::Timespan(20,0)); + httpsSession->setTimeout(Poco::Timespan(timeoutSeconds,0)); httpsSession->sendRequest(req) << data; rs = &httpsSession->receiveResponse(res); session = ofPtr(httpsSession); }else{ HTTPClientSession * httpSession = new HTTPClientSession(uri.getHost(), uri.getPort()); - httpSession->setTimeout(Poco::Timespan(20,0)); + httpSession->setTimeout(Poco::Timespan(timeoutSeconds,0)); httpSession->sendRequest(req) << data; rs = &httpSession->receiveResponse(res); session = ofPtr(httpSession); @@ -282,13 +282,13 @@ ofxHttpResponse ofxHttpUtils::doPostForm(ofxHttpForm & form){ istream * rs; if(uri.getScheme()=="https"){ HTTPSClientSession * httpsSession = new HTTPSClientSession(uri.getHost(), uri.getPort());//,context); - httpsSession->setTimeout(Poco::Timespan(20,0)); + httpsSession->setTimeout(Poco::Timespan(timeoutSeconds,0)); pocoForm.write(httpsSession->sendRequest(req)); rs = &httpsSession->receiveResponse(res); session = ofPtr(httpsSession); }else{ HTTPClientSession * httpSession = new HTTPClientSession(uri.getHost(), uri.getPort()); - httpSession->setTimeout(Poco::Timespan(20,0)); + httpSession->setTimeout(Poco::Timespan(timeoutSeconds,0)); pocoForm.write(httpSession->sendRequest(req)); rs = &httpSession->receiveResponse(res); session = ofPtr(httpSession);