ENC28J60 Ethernet Library V3.3
Ok here comes some explanations, after doing a research, I found that the protocol header string (aka httpHeader) should be changed to 'HTTP/1.1 200 OK' + #13 + #10 + 'Content-Type: ';
also all commands that terminate with #10 (Line Feed or LF) should be changed to CR + LF (Carriage Return + Line Feed).
If you try to open up the page with fiddler debuger it will shows that the protocol is missing this things.
After fixed that, I also implemented the Connection: close command before send the content page, or ie wouldnt reconize the end of the page content, it's better to implement the Content-Length: but my implementation is not working yet, I'm new to mikropascal and I miss a lote of features and methods that works diferent in delphi, but I will keep trying.
Another thing, the IE7 for some reason sends the GET / diferent, if you comment the code
It works, so something is wrong here I will reconfigure my ICD to see what is happening.
Until that if some of you guys has some news about it please post it here ;)
Regards,
Diego
also all commands that terminate with #10 (Line Feed or LF) should be changed to CR + LF (Carriage Return + Line Feed).
If you try to open up the page with fiddler debuger it will shows that the protocol is missing this things.
After fixed that, I also implemented the Connection: close command before send the content page, or ie wouldnt reconize the end of the page content, it's better to implement the Content-Length: but my implementation is not working yet, I'm new to mikropascal and I miss a lote of features and methods that works diferent in delphi, but I will keep trying.
Another thing, the IE7 for some reason sends the GET / diferent, if you comment the code
Code: Select all
if(memcmp(@getRequest, @txt, 5)) then // only GET method is supported here
begin
result := 0 ;
exit;
end;
Until that if some of you guys has some news about it please post it here ;)
Regards,
Diego
Hi, I did some tests and the command is indeed different, but not in the "Get" line (the first one):Another thing, the IE7 for some reason sends the GET / diferent, if you comment the code
Mozilla firefox:
IE7.0:GET / HTTP/1.1
Host: 192.168.123.79
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: nl,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
And of course IE7 does the job (shows not quite the same as Firefox, but it shows it...)GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*
Accept-Language: nl
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Host: 192.168.123.79
Connection: Keep-Alive
p.s. adding a #13 or changing a #10 into an #13 does not work for me, neither in Firefox nor in IE7.
Last edited by Dany on 25 Dec 2008 20:38, edited 2 times in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Hi Diego, can you share with us please the connections that finally worked? Thanks in advance!Loki1_11 wrote:Ok after I tryed some combinations using the new rj45 with transformer, It finally worked
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Sure I can Dany, just let get into my office so I share with you guys.
So I was reading the http documentation that especifies that the headers should be sended with CR + LF, and the last header (the one that comes before the html text) should have two sequences of CR + LF.
You can download the Fiedler Web Debugger, try to open up your pic web site with it, it will report the protocol errors.
Regards,
Diego.
So I was reading the http documentation that especifies that the headers should be sended with CR + LF, and the last header (the one that comes before the html text) should have two sequences of CR + LF.
You can download the Fiedler Web Debugger, try to open up your pic web site with it, it will report the protocol errors.
Regards,
Diego.
Take a look at http://www.w3.org/Protocols/rfc2616/rfc ... tml#sec6.2
see the first item, "6 Response".
Regards,
Diego ;)
see the first item, "6 Response".
Regards,
Diego ;)
Hi Diego. I will do so. Thanks very much for the documentation.Loki1_11 wrote:Take a look at http://www.w3.org/Protocols/rfc2616/rfc ... tml#sec6.2
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Diego, I tried this but without any success ...
or
The only version that work is :
Code: Select all
const httpHeader : string[42] = 'HTTP/1.1 200 OK'+#10+'Content-type:text/html'+#13+#10 ; // HTTP header
Code: Select all
const httpHeader : string[42] = 'HTTP/1.1 200 OK Content-type:text/html'+#13+#10 ; // HTTP header
Code: Select all
const httpHeader : string[42] = 'HTTP/1.1 200 OK'+#10+'Content-type:text/html'+#10+#10 ; // HTTP header
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Yap, on firefox 3.0.4, google chrome 1.0.154.36, ie7 (with some problems comparing the GET method sended by the ie)
Just a note I tryed on Ie7 of 2003 server and it works the get is sended as expected, on ie7 7.0.5730.11 it works fine to but on ie7 7.0.5730.13 the get method comparation doesnt works fine ... I'm searching the reasons ...
Regards,
Diego.
Just a note I tryed on Ie7 of 2003 server and it works the get is sended as expected, on ie7 7.0.5730.11 it works fine to but on ie7 7.0.5730.13 the get method comparation doesnt works fine ... I'm searching the reasons ...
Regards,
Diego.
I was trying to write two helper functions, but the string concatanation of mikropascal I dont know why doesnt allow me to work as I expected, it doesnt compiles.
So I wrote it in Delphi so if one of you guys can help me porting it to MP.
here comes the functions code, I will post the link to the (delphi project with exe) to download.
Link http://www.unitone.com.br/arquivos/httpUtils.zip
here comes the functions code:
Regards,
Diego.
So I wrote it in Delphi so if one of you guys can help me porting it to MP.
here comes the functions code, I will post the link to the (delphi project with exe) to download.
Link http://www.unitone.com.br/arquivos/httpUtils.zip
here comes the functions code:
Code: Select all
function ExtractQueryString(str:string; parName: string): string;
var
i, i1: word;
tmpStr: string;
bFoundedPar: byte;
begin
bFoundedPar := 0;
result := '';
for i:= 1 to Length(str) do
begin
if (str[i] = '?') or (str[i] = '&') then
begin
for i1 := i+1 to Length(str) do
begin
if (bFoundedPar = 0) and (str[i1] = '=') then
begin
tmpStr := '';
Break;
end;
if (bFoundedPar = 1) and (str[i1] = '=') then
Continue;
if bFoundedPar = 0 then
begin
tmpStr := tmpStr + str[i1];
if tmpStr = parName then
begin
bFoundedPar := 1;
tmpStr := '';
end;
end
else
begin
if (str[i1] <> '?') and (str[i1] <> '&') and (i1 <= Length(str)) then
begin
tmpStr := tmpStr + str[i1];
end
else
begin
result := tmpStr;
exit;
end;
end;
end;
end
else
Continue;
end;
if (tmpStr <> '') and (bFoundedPar = 1) then
Result := tmpStr;
end;
function ExtractPageName(str: string; pageExtensions: string): string;
var
I: Integer;
tmpStr: String;
tmpExtension: String;
bFoundedExtension: byte;
I1: Integer;
begin
bFoundedExtension := 0;
for I := 1 to Length(str) do
begin
if str[I] = '/' then
begin
for I1 := I+1 to Length(str) do
begin
if str[I1] = '.' then
begin
bFoundedExtension := 1;
Continue;
end;
if bFoundedExtension = 0 then
tmpStr := tmpStr + str[I1] else
tmpExtension := tmpExtension + str[I1];
if tmpExtension = pageExtensions then
Result := tmpStr+'.'+tmpExtension;
end;
end;
end;
end;
Diego.
Can you guys take a look at http://unitonedev.no-ip.org:8020 ?
Take a look if it will open everthing ok, and please if possible post the results for me, like browser name + version, and OS version.
I'm trying to fix some other things in this prog.
Kindly Regards, and happy new year :D
Diego.
Take a look if it will open everthing ok, and please if possible post the results for me, like browser name + version, and OS version.
I'm trying to fix some other things in this prog.
Kindly Regards, and happy new year :D
Diego.
Hi Diego, I get a network timeout both in Firefox and IE7.Loki1_11 wrote:Can you guys take a look at http://unitonedev.no-ip.org:8020 ?
Take a look if it will open everthing ok, and please if possible post the results for me, like browser name + version, and OS version.
I'm trying to fix some other things in this prog.
Kindly Regards, and happy new year
Diego.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)