Dart Home | PowerTCP Web for ActiveX | Custom Development | Reply | PowerTCP Web for ActiveX Topics | Forums |
Author | Forum: PowerTCP Web for ActiveX Topic: Timeout When Header Ends with vbCrLf |
bholeman From: Kansas City, MO USA Posts: 6 Member Since: 10/03/03 |
posted October 3, 2003 4:10 PM Hello, I have a VB6 SP5 application that is loading the Webtool dynamically and using either .Post or .GetEx to communicate with an application on a secure server. The problem is when I append a carriage return/linefeed pair on the end of a header (ReqHeader.Add "Cookie: sesessionid=123mysession456" & vbCrlf) the control quits responding after entering the state httpReceivingResponse. It eventually times out or closes the connection. If I do not append vbCrLf is works, but only if I add only the one header. note: I unloaded seti@home |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 3, 2003 4:29 PM You should not be adding crlf's to the header. We should have designed it to throw an error if you do this. If you set "Cookies" to false you should be able to add your own cookies with no errors. |
bholeman From: Kansas City, MO USA Posts: 6 Member Since: 10/03/03 |
posted October 3, 2003 4:46 PM I do set Cookies = False. Here is my Header method: dstrReturn.Add "Content-Type: application/x-www-form-urlencoded" dstrReturn.Add "Content-Length: " & CStr(vMessageLength) dstrReturn.Add "Cookie: sesessionid=" & m_strSessionId dstrReturn.Add "Accept: text/*" When I use all these lines the server repsonds with not logged in which means it did not find the cookie. If I use only the cookie header it works. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 3, 2003 4:49 PM Then why don't you just use only the cookie header? |
bholeman From: Kansas City, MO USA Posts: 6 Member Since: 10/03/03 |
posted October 3, 2003 5:14 PM Because they have more functions that I need to use that require more header values. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 3, 2003 5:17 PM What if you change the order? Try adding the cookie last. If that does not help, then please modify the PostDemo sample so that the error occurs, then zip it up and email the project to support@dart.com with the subject "Files for topic 3529" |
bholeman From: Kansas City, MO USA Posts: 6 Member Since: 10/03/03 |
posted October 6, 2003 4:26 PM I modified the Post example and sent that to you. Since then, I think I have resolved the problem. When I add a carriage return/linefeed to the end of each header the host application finds the headers I add. It appears that if I set the content-length header and it has a carraige return/linefeed at the end of it the control hangs after the httpReceivingResponse State event, then times out. I am not setting the content-length. or content-type headers, but I am setting the other headers and ending each header with a carraige return/line feed and it seems to be working. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 7, 2003 9:00 AM Thanks for the follow-up. You should not have to add CRLF's to header-lines. That should be done by us. I'll look into why this is happening, but in the meantime keep using your workaround. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 7, 2003 9:28 AM I looked at your code and noticed that you set the delimiter to "". This should be left as vbcrlf ( the default ). Please see what happens if you use vbcrlf as delimiter and stop adding the crlf's |
bholeman From: Kansas City, MO USA Posts: 6 Member Since: 10/03/03 |
posted October 8, 2003 12:15 PM I tried changing the code to set the delimeter explicitly to vbCrLf and did not append the carriage return/line feed and it continued to work. Thank you |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 8, 2003 1:07 PM Thanks for the follow-up! |
Reply | PowerTCP Web for ActiveX Topics | Forums |
This site is powered by
![]() |