Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Simle question about HTTP...

Simle question about HTTP...

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Artem Moroz
    wrote on last edited by
    #1

    How to determine whether the new request header is coming from client in HTTP/1.1 Keep-alive Connections ?

    M 1 Reply Last reply
    0
    • A Artem Moroz

      How to determine whether the new request header is coming from client in HTTP/1.1 Keep-alive Connections ?

      M Offline
      M Offline
      Mike Nordell
      wrote on last edited by
      #2

      Looking at the header and check for "Keep-Alive:" ?

      A 1 Reply Last reply
      0
      • M Mike Nordell

        Looking at the header and check for "Keep-Alive:" ?

        A Offline
        A Offline
        Artem Moroz
        wrote on last edited by
        #3

        How to check whether this is a NEW http-header ? Do I have to check EVERY message or just the first ones?

        M 1 Reply Last reply
        0
        • A Artem Moroz

          How to check whether this is a NEW http-header ? Do I have to check EVERY message or just the first ones?

          M Offline
          M Offline
          Mike Nordell
          wrote on last edited by
          #4

          M A V wrote: How to check whether this is a NEW http-header ? As opposed to what? An OLD HTTP-header? Of course you have to parse every request the server gets. If your question is instead "How do I know if it's a 1.1 or 1.0" request: Well, read the header. It's all there, in plain-text format. It's either "HTTP/1.0" or "HTTP/1.1". Maybe a trip to this place can clear things up? Especially this page might prove useful.

          A 1 Reply Last reply
          0
          • M Mike Nordell

            M A V wrote: How to check whether this is a NEW http-header ? As opposed to what? An OLD HTTP-header? Of course you have to parse every request the server gets. If your question is instead "How do I know if it's a 1.1 or 1.0" request: Well, read the header. It's all there, in plain-text format. It's either "HTTP/1.0" or "HTTP/1.1". Maybe a trip to this place can clear things up? Especially this page might prove useful.

            A Offline
            A Offline
            Artem Moroz
            wrote on last edited by
            #5

            How can I determine whether the data that was just received, is a HTTP-header? I am writing HTTP proxy server application,it works ok with HTTP/1.0 and fails with HTTP/1.1... For example, when the page contains some data wich needs to be loaded from other server this data is not displayed. I think that browser, when configured to use HTTP/1.1 sends it's requests one after another without breaking the connection. My code looks like: Thread1(started on every connect from client): recv(...); // parse header get URL_to_connect _beginthread(Thread2); // wait here for Event.. while(!Thread1done && !Thread2Done) { recv(...); //from client send(...); //to server } closesocket(); //Thread2 connect(server_ip); // fire the Event... while(!Thread1Done && !Thread2Done) { recv(); //from server send(); //to client } closesocket(); I've read RFC, but found nothing concrete about this...

            M 1 Reply Last reply
            0
            • A Artem Moroz

              How can I determine whether the data that was just received, is a HTTP-header? I am writing HTTP proxy server application,it works ok with HTTP/1.0 and fails with HTTP/1.1... For example, when the page contains some data wich needs to be loaded from other server this data is not displayed. I think that browser, when configured to use HTTP/1.1 sends it's requests one after another without breaking the connection. My code looks like: Thread1(started on every connect from client): recv(...); // parse header get URL_to_connect _beginthread(Thread2); // wait here for Event.. while(!Thread1done && !Thread2Done) { recv(...); //from client send(...); //to server } closesocket(); //Thread2 connect(server_ip); // fire the Event... while(!Thread1Done && !Thread2Done) { recv(); //from server send(); //to client } closesocket(); I've read RFC, but found nothing concrete about this...

              M Offline
              M Offline
              Mike Nordell
              wrote on last edited by
              #6

              AFAIK you can't just recv() + send() to pass on any data to any server. You need to parse every request sent from the client to see f.ex. what server to pass on the request to.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups