Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix CCurlFile::Get() #1681

Merged
merged 1 commit into from

5 participants

@Red-F

This fixes CCurlFile::Get() by moving the explicit initialisation of the request pre-conditions (used by CCurlFile::Open()) to CCurlFile::Post() resp. CCurlFile::Get()

See issues with PR #1650.

@Red-F Red-F Fix CCurlFile::Get() by moving the explicit initialisation of the req…
…uest pre-conditions to CCurlFile::Post() resp. CCurlFile::Get()
5a03f0b
@opdenkamp opdenkamp commented on the diff
xbmc/filesystem/CurlFile.cpp
((16 lines not shown))
}
-bool CCurlFile::Service(const CStdString& strURL, const CStdString& strPostData, CStdString& strHTML)
+bool CCurlFile::Service(const CStdString& strURL, CStdString& strHTML)
@opdenkamp Collaborator

this isn't needed?

@Red-F
Red-F added a note

Service was a private method only called by Post and Get. Since we initialise now at the location where we actually know if we're doing a get or post, this is indeed no longer needed.

@opdenkamp Collaborator

oh wasn't talking about the method but about the const change. but if the method is no longer needed, then that's even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@huceke
Collaborator

@opdenkamp: This fixes a problem i have with scarping. ( http://pastebin.com/rBWJyvR0 )

@ryanroth

Ditto. I was having scrapping issues after the initial patch was committed.

@opdenkamp
Collaborator

yes i know

@jmarshallnz jmarshallnz merged commit 599a248 into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 26, 2012
  1. @Red-F

    Fix CCurlFile::Get() by moving the explicit initialisation of the req…

    Red-F authored
    …uest pre-conditions to CCurlFile::Post() resp. CCurlFile::Get()
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 6 deletions.
  1. +7 −5 xbmc/filesystem/CurlFile.cpp
  2. +1 −1  xbmc/filesystem/CurlFile.h
View
12 xbmc/filesystem/CurlFile.cpp
@@ -732,18 +732,20 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
bool CCurlFile::Post(const CStdString& strURL, const CStdString& strPostData, CStdString& strHTML)
{
- return Service(strURL, strPostData, strHTML);
+ m_postdata = strPostData;
+ m_postdataset = true;
+ return Service(strURL, strHTML);
}
bool CCurlFile::Get(const CStdString& strURL, CStdString& strHTML)
{
- return Service(strURL, "", strHTML);
+ m_postdata = "";
+ m_postdataset = false;
+ return Service(strURL, strHTML);
}
-bool CCurlFile::Service(const CStdString& strURL, const CStdString& strPostData, CStdString& strHTML)
+bool CCurlFile::Service(const CStdString& strURL, CStdString& strHTML)
@opdenkamp Collaborator

this isn't needed?

@Red-F
Red-F added a note

Service was a private method only called by Post and Get. Since we initialise now at the location where we actually know if we're doing a get or post, this is indeed no longer needed.

@opdenkamp Collaborator

oh wasn't talking about the method but about the const change. but if the method is no longer needed, then that's even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{
- m_postdata = strPostData;
- m_postdataset = true;
if (Open(strURL))
{
if (ReadData(strHTML))
View
2  xbmc/filesystem/CurlFile.h
@@ -123,7 +123,7 @@ namespace XFILE
void SetCommonOptions(CReadState* state);
void SetRequestHeaders(CReadState* state);
void SetCorrectHeaders(CReadState* state);
- bool Service(const CStdString& strURL, const CStdString& strPostData, CStdString& strHTML);
+ bool Service(const CStdString& strURL, CStdString& strHTML);
protected:
CReadState* m_state;
Something went wrong with that request. Please try again.