Jump to content
Tuts 4 You
LCF-AT

WinSock problem

Recommended Posts

LCF-AT

Hi,

do you know any standard solutions I could use for that? :) Its pretty bad to find any detailed informations and examples what to do in case A,B,C etc.As I said,my main goal is it to handle only that redirection codes till I get status success or status error so that I can stop to request go on and going in any loop process without to finish.Lets say a site only allows to redirect to https and dosent send that info in location field then I trigger a loop.Found no site yet (except google which also allows http too).Maybe a little small steplist would be helpfully to know what to do and when to stop.

Redirection messages
--------------------------------------------------------------
   | 300   | Multiple Choices              | Section 6.4.1  |
   | 301   | Moved Permanently             | Section 6.4.2  |
   | 302   | Found                         | Section 6.4.3  |
   | 303   | See Other                     | Section 6.4.4  |
   | 305   | Use Proxy                     | Section 6.4.5  |
   | 306   | (Unused)                      | Section 6.4.6  |
   | 307   | Temporary Redirect            | Section 6.4.7  |
     308 too
--------------------------------------------------------------

Lets say I send first request via http port 80 and get any of this RD status codes back.

 Check location field if present and read it.Check if https:// is present at location field start = use https port 443 and also check if host is same or changed or used www or not and change it.If none of both are present = no port change / no host change & use relativ path found in location for next request.Something like that just to do a correct check and update to handle redirection.

About HSTS.Does it mean its just checking a whole list to check whether server xy is found and if so then switch to HTTPS and I can not check the response header for that like for some other sites which do send https protocol at location field?

greetz

Share this post


Link to post
Share on other sites
LCF-AT

Hi,

I am looking for a API as fgets to read lines but not from any loaded file (from memory / buffer address xy).So it seems I cant use fgets for that.Now I tried also a around with scanf function (%[^\n]) but its not workiing.

Its also possible to disable case sensitiv with scanf?

https://%s

Now it checks for https but if HTtps is in buffer = fail

greetz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×