Redirect fix #300

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

yllan commented Jan 16, 2012

Currently, the requestRedirected delegate method will be called right after the header is parsed. However, the data received delegate method which comes together with the redirected header will be called after the requestRedirected callback.

The sequence is like this:

  1. HTTP Redirect Header
  2. requestRedirected
  3. HTTP Redirect Body (usually some simple html indicate the redirection)
  4. dataReceived
  5. HTTP Header
  6. headerReceived
  7. HTTP Body
  8. dataReceived

I think in this sequence, step 4 may cause bugs. The delegate is most likely accumulating the received data for writing to file, live parsing, etc. Apparently, we should not append the data received from step 4 to step 8. The most straight forward thought is to "reset" the data status after the request being redirected but that actually happens before step 4.

I propose to move the step 2 between step 4 and 5.

Coeur commented on ec65def Nov 29, 2011

Semantic Issue warning on line 1469:
Undeclared selector 'requestRedirected'

Owner

yllan replied Nov 29, 2011

Add a declaration in Private header solve this. Check my commit 8d88424

@yllan yllan closed this Jan 16, 2012

Contributor

yllan commented Jan 16, 2012

Ooops, how can I make pull request with exactly only the commit I want?

Collaborator

jogu commented Jan 16, 2012

I'm not sure, I'm not very familiar with github pull requests :(

Possibly you can create a branch then use git cherry-pick to merge just the commits you want onto the branch, then send the pull request for the branch.

Contributor

yllan commented Jan 16, 2012

Well, as you can see in the diff, it is only two lines of code modification. Maybe you could just merge it manually.

Contributor

yllan commented Jan 19, 2012

Never mind. I've managed to make a pull request with only the involved commit. Please check pull request #301.

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