Hi All,
When I tried to use httpGate on my NanoBSD box, I've got following error:
400 Bad Request 

# uname -a
FreeBSD fs1.mtmlab.ru 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r245297: Sat Jan 12 
08:23:47 YEKT 2013     
root@proto.mtmlab.local:/usr/obj/nanobsd.NANOSERVER/usr/src/sys/NANOSERVER  
amd64

My little investigation shows, that httpGate (or TCP stack?) sends "GET /"  in 
first TCP packet and the rest of request in second TCP packet.
And what I see in "http" function :
1) without httpGate
! L
-> ("G" "E" "T" " " "/" " " "H" "T" "T" "P" "/" "1" "." "1")

2) with httpGate
! L
-> ("G" "E" "T" " " "/")

If I understand correctly, (line) immediatly returns first TCP packet value. 
I'm not expert in TCP/IP programming, maybe reason is FreeBSD itself?
I tried both 32 bit and 64 pil and httpGate with the same results.  

tcpdump listing:
... skipped
19:32:16.579988 IP6 ::1.22649 > ::1.8080: Flags [P.], seq 1:6, ack 1, win 1120, 
options [nop,nop,TS val 42586113 ecr 2588126972], length 5
        0x0000:  600b 4bd5 0025 0640 0000 0000 0000 0000  `.K..%.@........
        0x0010:  0000 0000 0000 0001 0000 0000 0000 0000  ................
        0x0020:  0000 0000 0000 0001 5879 1f90 07b4 e127  ........Xy.....'
        0x0030:  8b75 e17c 8018 0460 002d 0000 0101 080a  .u.|...`.-......
        0x0040:  0289 d001 9a43 aefc 4745 5420 2f         .....C..GET./
19:32:16.581157 IP6 ::1.8080 > ::1.22649: Flags [P.], seq 1:185, ack 6, win 
1120, 
options [nop,nop,TS val 2588126974 ecr 42586113], length 184
        0x0000:  6008 9f78 00d8 0640 0000 0000 0000 0000  `..x...@........
        0x0010:  0000 0000 0000 0001 0000 0000 0000 0000  ................
        0x0020:  0000 0000 0000 0001 1f90 5879 8b75 e17c  ..........Xy.u.|
        0x0030:  07b4 e12c 8018 0460 00e0 0000 0101 080a  ...,...`........
        0x0040:  9a43 aefe 0289 d001 4854 5450 2f31 2e30  .C......HTTP/1.0
        0x0050:  2034 3030 2042 6164 2052 6571 7565 7374  .400.Bad.Request
        0x0060:  0d0a 5365 7276 6572 3a20 5069 636f 4c69  ..Server:.PicoLi
        0x0070:  7370 0d0a 436f 6e74 656e 742d 5479 7065  sp..Content-Type
        0x0080:  3a20 7465 7874 2f68 746d 6c0d 0a43 6f6e  :.text/html..Con
        0x0090:  7465 6e74 2d4c 656e 6774 683a 2039 330d  tent-Length:.93.
        0x00a0:  0a0d 0a3c 4854 4d4c 3e0a 3c48 4541 443e  ...<HTML>.<HEAD>
        0x00b0:  3c54 4954 4c45 3e34 3030 2042 6164 2052  <TITLE>400.Bad.R
        0x00c0:  6571 7565 7374 3c2f 5449 544c 453e 3c2f  equest</TITLE></
        0x00d0:  4845 4144 3e0a 3c42 4f44 593e 3c48 313e  HEAD>.<BODY><H1>
        0x00e0:  4261 6420 5265 7175 6573 743c 2f48 313e  Bad.Request</H1>
        0x00f0:  3c2f 424f 4459 3e0a 3c2f 4854 4d4c 3e0a  </BODY>.</HTML>.
19:32:16.581218 IP6 ::1.22649 > ::1.8080: Flags [P.], seq 6:369, ack 185, win 
1117, 
options [nop,nop,TS val 42586115 ecr 2588126974], length 363
        0x0000:  600b 4bd5 018b 0640 0000 0000 0000 0000  `.K....@........
        0x0010:  0000 0000 0000 0001 0000 0000 0000 0000  ................
        0x0020:  0000 0000 0000 0001 5879 1f90 07b4 e12c  ........Xy.....,
        0x0030:  8b75 e234 8018 045d 0193 0000 0101 080a  .u.4...]........
        0x0040:  0289 d003 9a43 aefe 2048 5454 502f 312e  .....C...HTTP/1.
        0x0050:  310d 0a58 2d50 696c 3a20 2a47 6174 653d  1..X-Pil:.*Gate=
        0x0060:  6874 7470 0d0a 582d 5069 6c3a 202a 4164  http..X-Pil:.*Ad
        0x0070:  723d 3a3a 6666 6666 3a31 3932 2e31 3638  r=::ffff:192.168
        0x0080:  2e31 302e 320d 0a48 6f73 743a 2031 3932  .10.2..Host:.192
        0x0090:  2e31 3638 2e31 302e 350d 0a55 7365 722d  .168.10.5..User-
        0x00a0:  4167 656e 743a 204d 6f7a 696c 6c61 2f35  Agent:.Mozilla/5
        0x00b0:  2e30 2028 5831 313b 2055 6275 6e74 753b  .0.(X11;.Ubuntu;
        0x00c0:  204c 696e 7578 2078 3836 5f36 343b 2072  .Linux.x86_64;.r
        0x00d0:  763a 3138 2e30 2920 4765 636b 6f2f 3230  v:18.0).Gecko/20
        0x00e0:  3130 3031 3031 2046 6972 6566 6f78 2f31  100101.Firefox/1
        0x00f0:  382e 300d 0a41 6363 6570 743a 2074 6578  8.0..Accept:.tex
        0x0100:  742f 6874 6d6c 2c61 7070 6c69 6361 7469  t/html,applicati
        0x0110:  6f6e 2f78 6874 6d6c 2b78 6d6c 2c61 7070  on/xhtml+xml,app
        0x0120:  6c69 6361 7469 6f6e 2f78 6d6c 3b71 3d30  lication/xml;q=0
        0x0130:  2e39 2c2a 2f2a 3b71 3d30 2e38 0d0a 4163  .9,*/*;q=0.8..Ac
        0x0140:  6365 7074 2d4c 616e 6775 6167 653a 2065  cept-Language:.e
        0x0150:  6e2d 5553 2c65 6e3b 713d 302e 350d 0a41  n-US,en;q=0.5..A
        0x0160:  6363 6570 742d 456e 636f 6469 6e67 3a20  ccept-Encoding:.
        0x0170:  677a 6970 2c20 6465 666c 6174 650d 0a43  gzip,.deflate..C
        0x0180:  6f6e 6e65 6374 696f 6e3a 206b 6565 702d  onnection:.keep-
        0x0190:  616c 6976 650d 0a43 6163 6865 2d43 6f6e  alive..Cache-Con
        0x01a0:  7472 6f6c 3a20 6d61 782d 6167 653d 300d  trol:.max-age=0.
        0x01b0:  0a0d 0a                                  ...
... skipped

Best regards,
Mansur

Reply via email to