2

I am trying to access to the byte range header request made to a G-wan server, the thing is that I always obtain "0" as a value from the h_range_from attribute int the http_t struct.

http_t *head = (http_t*)get_env(argv, HTTP_HEADERS);

printf("FROM: %d\n", head->h_range_from); 

printf("TO: %d\n", head->h_range_to); 

Has anyone obtain the byte ranges successfully before?

// Example header request:

Range: bytes=1000-

I will really appreciate your help.

Thanks!

Gil
  • 3,279
  • 1
  • 15
  • 25

1 Answers1

0

Testing the current development codebase, the feature works as expected. This codebase cumulates 7 months of user feedback so it has been heavily tested.

I believe that this was an HTTP Header parsing error fixed a few months ago, when someone playing with Flash streaming technologies asked tips while giving feedback with his experiments.

If this HTTP header is not reported by v3.3.28 then you will have to parse this HTTP header manually.

Thank you anyway for the feedback, that's what makes fixing bugs possible in the first place!

Gil
  • 3,279
  • 1
  • 15
  • 25
  • Hello Gil, thanks a lot for your answer, the code that am running was downloaded yesterday, is recent, in this case, can you help me or give me a clue about to "to parse this HTTP header manually" I really appreciate that – Jonathan Santilli Dec 07 '12 at 15:07
  • You can run **./gwan -v** to check your release number (which is likely to be v3.3.28). The next *public* release will be available this month, after 7 months of beta releases that were *not* publicly released (restricted to a few selected persons who helped us with tests, new features and suggestions, etc.). – Gil Dec 08 '12 at 11:05
  • To parse HTTP headers "manually" just start with the getenv(REQUEST_STRING); pointer and read, passing zero-terminated strings, until you reach your header. HTTP requests are all terminated by a double "\n\n". – Gil Dec 09 '12 at 07:33
  • Hello again Gil, sorry, but to be honest i did not understand very good when you say "start with the getenv(REQUEST_STRING); pointer and read, passing zero-terminated strings" the method "get_env" receive two params and the enum value "REQUEST_STRING" does not exist, i know it was a kind of references from you, maybe that's the clue. Thanks for your help Gil, i really appreciate. – Jonathan Santilli Dec 10 '12 at 09:26
  • This would deserve a new question to be fully-answered: **char *p = get_env(argv, REQUEST);** and then the idea is to check each string first characters until you find your Header of interest. The other easier solution is to wait for the new version expected this month as it was tested to do this well. – Gil Dec 11 '12 at 10:42
  • Well Gil, Thanks a lot for your help, of course i will wait for the new release, but at the moment i have to try :) Really i appreciate your help, i will alert to the new release. – Jonathan Santilli Dec 11 '12 at 16:02