Results 1 to 7 of 7

Thread: QHTTP does not see tunneled TCP HTTP OK authentication response

  1. #1
    Join Date
    May 2009
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Red face QHTTP does not see tunneled TCP HTTP OK authentication response

    Hi

    I am trying to setup RTSP/RTP tunneled via HTTP. I have sent the request below

    Qt Code:
    1. GET /axis-media/media.amp?videocodec=h264 HTTP/1.1
    2. Host: 169.xxx.xxx.xxx
    3. Cache-Control: no-cache
    4. Connection: Keep-Alive
    5. x-sessioncookie: 123456789
    6. Authorization: Digest username="root", realm="AXIS_00408C943C65",
    7. nonce="00001c86Y8265782d13f595995eddef04419da03a5abc5",
    8. uri="/axis-media/media.amp?videocodec=h264", response="32ae033bc3a5d10c67efd8c2246716cf",
    9. qop=auth, nc=00000001, cnonce="de29e2a5683f6d43d65435a99ccba54a"
    To copy to clipboard, switch view to plain text mode 

    and the server responds with the result that is not carried by HTTP but is in the TCP
    segment data show below:

    Qt Code:
    1. HTTP/1.0 200 OK
    2. Content-Type: application/x-rtsp-tunnelled
    3. Date: Thu, 21 May 2009 17:54:42 GMT
    To copy to clipboard, switch view to plain text mode 

    The QHttp seems to be waiting for a HTTP protocol carried "200 OK" message and for some reason cannot see the TCP tunnelled "200 OK" message (waveshark can!!).

    I made sure the QAuthenticator was working by deleting the "x-sessioncookie: 123456789" content. When I do this, the server uses HTTP protocol to carry the "200 OK" message and my code proceeds, but without getting tunnelled RTSP setup.

    Any thoughts on how to get the Authenticator to see the tunnelled HTTP 200 OK message?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    I think you are expecting too much from a simple class such as QHttp. It handles HTTP protocol and HTTP only. You have to fetch the tunnel traffic yourself if you need to.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    Yiks. I was hoping that QHttp could handle it.

    Any recommendations on how to deal with this? I thought of connecting to the QHttp signal readyRead(), but if QT can't see the header in the packet below
    because the packet also contains MJpeg data, it may not fire the readyRead(). I know
    that signal readyRead() does not fire, so would readyRead() not fire?

    If readRead works, then I could parse the TCP segment data and look for the
    HTTP 200 OK. But if I find it, I'm not sure how I'd tell QHttp to stop the GET and proceed
    with the POST it has in its queue.

    The QT documentation says

    Qt Code:
    1. This signal is emitted when processing the request identified by id has finished. error is true if an error occurred during the processing; otherwise error is false.
    To copy to clipboard, switch view to plain text mode 

    What is "processing the request" for a HTTP GET? (what is the event QHttp is looking for?)

    Thanks


    Qt Code:
    1. 0000 00 23 ae 12 da a9 00 40 8c 94 3c 65 08 00 45 00 .#.....@..<e..E.
    2. 0010 05 dc 62 6c 40 00 40 06 52 d0 a9 fe b1 54 a9 fe ..bl@.@.R....T..
    3. 0020 7a 8e 00 50 0a a6 0b 2b b8 6e 2f 21 e8 1b 50 10 z..P...+.n/!..P.
    4.  
    5. TCP segment data starts here.
    6. ||
    7. V
    8. ????? Why can't QHTTP see this HTTP response???????
    9. 0030 19 20 c9 fc 00 00 48 54 54 50 2f 31 2e 30 20 32 . ....HTTP/1.0 2
    10. 0040 30 30 20 4f 4b 0d 0a 43 61 63 68 65 2d 43 6f 6e 00 OK..
    11. Cache-Con
    12. 0050 74 72 6f 6c 3a 20 6e 6f 2d 63 61 63 68 65 0d 0a trol: no-cache..
    13. 0060 50 72 61 67 6d 61 3a 20 6e 6f 2d 63 61 63 68 65 Pragma: no-cache
    14. 0070 0d 0a 45 78 70 69 72 65 73 3a 20 54 68 75 2c 20 ..Expires: Thu,
    15. 0080 30 31 20 44 65 63 20 31 39 39 34 20 31 36 3a 30 01 Dec 1994 16:0
    16. 0090 30 3a 30 30 20 47 4d 54 0d 0a 43 6f 6e 6e 65 63 0:00 GMT..Connec
    17. 00a0 74 69 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 43 6f 6e tion: close..Con
    18. 00b0 74 65 6e 74 2d 54 79 70 65 3a 20 6d 75 6c 74 69 tent-Type: multi
    19. 00c0 70 61 72 74 2f 78 2d 6d 69 78 65 64 2d 72 65 70 part/x-mixed-rep
    20. 00d0 6c 61 63 65 3b 20 62 6f 75 6e 64 61 72 79 3d 6d lace; boundary=m
    21. 00e0 79 62 6f 75 6e 64 61 72 79 0d 0a 0d 0a 2d 2d 6d yboundary....--m
    22. 00f0 79 62 6f 75 6e 64 61 72 79 0d 0a 43 6f 6e 74 65 yboundary..Conte
    23. 0100 6e 74 2d 54 79 70 65 3a 20 69 6d 61 67 65 2f 6a nt-Type: image/j
    24. 0110 70 65 67 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e peg..Content-Len
    25. 0120 67 74 68 3a 20 31 32 30 36 33 0d 0a 0d 0a ff d8 gth: 12063......
    26. 0130 ff e0 00 10 4a 46 49 46 00 01 02 00 00 0b 00 0a ....JFIF........
    27. 0140 00 00 ff fe 00 0f 0a 01 4a 16 ce c2 4a 4a 16 ce ........J...JJ.
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    Quote Originally Posted by SailingDreams View Post
    Any recommendations on how to deal with this?
    I know nothing of tunneling raw data like this, so no

    What is "processing the request" for a HTTP GET? (what is the event QHttp is looking for?)
    Request processing is finished when QHttp has received the full response from the server.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2009
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    I used the readResponseHeader() signal and it was able to read the response header for the HTTP GET I requested. Unfortunately the HTTP state is still stuck in state "reading". Which means (I think) that it will not process the next que'd HTTP request. I'd like get the HTTP state to "closed" so that I can let QHTTP do the next command in its queue.

    I am worried though that if I use the "QHttp::close()" command, my TCP connection will also be closed and bye bye to my streaming video.

    Any ideas how to get the QHttp to send the next request without closing the TCP session that was setup for the GET? (the TCP session stays open from the GET to receive the streaming video).


    Qt Code:
    1. void VideoInterfaceRealAxis282MJpeg::readResponseHeader(const QHttpResponseHeader
    2. &responseHeader)
    3. {
    4. switch (responseHeader.statusCode()) {
    5. case 200: // Ok
    6. qDebug("HTTP Header status 200 (OK) found");
    7. break;
    8.  
    9. default:
    10. break;
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    It might be easier if you provide your own implementation of QHttp. You can reuse some of the utility classes such as QHttpRequestHeader. Also have a look at QNetworkAccessManager.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2009
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QHTTP does not see tunneled TCP HTTP OK authentication response

    Thanks. I'll look at those.

Similar Threads

  1. Qhttp, is it possible to set http sessions?
    By joozt in forum Qt Programming
    Replies: 4
    Last Post: 20th August 2008, 09:20
  2. QHttp & HTTP 1.1 Compression
    By bporter in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2007, 20:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.