Board index » delphi » Problem with 'PUT' command on TIdHTTPServer

Problem with 'PUT' command on TIdHTTPServer

Just another dump, where you can see that some of the transfers are working
fine... (value between '[' and ']' = AThread.Handle)

[ F88] - PUT /dropbox/tst50758e0.tmp HTTP/1.1
[ F88] - --- header dump -----------------------
[ F88] -    crb: 152
[ F88] -    hdr: Accept: */*
[ F88] -    crb: 139
[ F88] -    hdr: User-Agent: TransporterClient
[ F88] -    crb: 108
[ F88] -    hdr: Host: 192.168.1.167
[ F88] -    crb: 87
[ F88] -    hdr: Content-Length: 16
[ F88] -    crb: 67
[ F88] -    hdr: Connection: Keep-Alive
[ F88] -    crb: 43
[ F88] -    hdr: Cache-Control: no-cache
[ F88] -    crb: 18
[ F88] -    hdr:
[ F88] - --- end header dump -------------------
[ F88] -    Reported stream size  : 16
[ F88] -    CurrentReadBuffer size: 16
[ F88] -    Stream loaded...  // OK
[ F88] - RET: 201
[ F6C] - GET/dropbox/tst50758e0.tmp?
[ F6C] - RET: 200
[ F90] - DELETE /dropbox/tst50758e0.tmp HTTP/1.1
[ F90] - --- header dump -----------------------
[ F90] -    crb: 135
[ F90] -    hdr: Accept: */*
[ F90] -    crb: 122
[ F90] -    hdr: User-Agent: TransporterClient
[ F90] -    crb: 91
[ F90] -    hdr: Host: 192.168.1.167
[ F90] -    crb: 70
[ F90] -    hdr: Content-Length: 0
[ F90] -    crb: 51
[ F90] -    hdr: Connection: Keep-Alive
[ F90] -    crb: 27
[ F90] -    hdr: Cache-Control: no-cache
[ F90] -    crb: 2
[ F90] -    hdr:
[ F90] - --- end header dump -------------------
[ F90] - RET: 200
[ F90] - PUT /dropbox/rep50759a8.msg HTTP/1.1
[ F90] - --- header dump -----------------------
[ F90] -    crb: 973
[ F90] -    hdr: Accept: */*
[ F90] -    crb: 960
[ F90] -    hdr: User-Agent: TransporterClient
[ F90] -    crb: 929
[ F90] -    hdr: Host: 192.168.1.167
[ F90] -    crb: 908
[ F90] -    hdr: Content-Length: 836
[ F90] -    crb: 887
[ F90] -    hdr: Connection: Keep-Alive
[ F90] -    crb: 863
[ F90] -    hdr: Cache-Control: no-cache
[ F90] -    crb: 838
[ F90] -    hdr:
[ F90] - --- end header dump -------------------
[ F90] -    Reported stream size  : 836
[ F90] -    CurrentReadBuffer size: 836
[ F90] -    Stream loaded...  // OK
[ F90] - RET: 201
[ F90] -
GET/script/mstrai40.exe?ERRORCODE=0&MESSAGEFILE=rep50759a8.msg&MESSAGEDBFILE
=&
[ F58] - PUT /dropbox/tst5075ad4.tmp HTTP/1.1
[ F58] - --- header dump -----------------------
[ F58] -    crb: 152
[ F58] -    hdr: Accept: */*
[ F58] -    crb: 139
[ F58] -    hdr: User-Agent: TransporterClient
[ F58] -    crb: 108
[ F58] -    hdr: Host: 192.168.1.167
[ F58] -    crb: 87
[ F58] -    hdr: Content-Length: 16
[ F58] -    crb: 67
[ F58] -    hdr: Connection: Keep-Alive
[ F58] -    crb: 43
[ F58] -    hdr: Cache-Control: no-cache
[ F58] -    crb: 18
[ F58] -    hdr:
[ F58] - --- end header dump -------------------
[ F58] -    Reported stream size  : 16
[ F58] -    CurrentReadBuffer size: 16
[ F58] -    Stream loaded...  // OK
[ F58] - RET: 201
[ F58] - GET/dropbox/tst5075ad4.tmp?
[ F58] - RET: 200
[ F58] - DELETE /dropbox/tst5075ad4.tmp HTTP/1.1
[ F58] - --- header dump -----------------------
[ F58] -    crb: 135
[ F58] -    hdr: Accept: */*
[ F58] -    crb: 122
[ F58] -    hdr: User-Agent: TransporterClient
[ F58] -    crb: 91
[ F58] -    hdr: Host: 192.168.1.167
[ F58] -    crb: 70
[ F58] -    hdr: Content-Length: 0
[ F58] -    crb: 51
[ F58] -    hdr: Connection: Keep-Alive
[ F58] -    crb: 27
[ F58] -    hdr: Cache-Control: no-cache
[ F58] -    crb: 2
[ F58] -    hdr:
[ F58] - --- end header dump -------------------
[ F58] - RET: 200
[ F58] - GET/dropbox/rep5075c0b.msg?
[ F58] - RET: 404
[ F58] - PUT /dropbox/rep5075c0b.msg HTTP/1.1
[ F58] - --- header dump -----------------------
[ F58] -    crb: 973
[ F58] -    hdr: Accept: */*
[ F58] -    crb: 960
[ F58] -    hdr: User-Agent: TransporterClient
[ F58] -    crb: 929
[ F58] -    hdr: Host: 192.168.1.167
[ F58] -    crb: 908
[ F58] -    hdr: Content-Length: 836
[ F58] -    crb: 887
[ F58] -    hdr: Connection: Keep-Alive
[ F58] -    crb: 863
[ F58] -    hdr: Cache-Control: no-cache
[ F58] -    crb: 838
[ F58] -    hdr:
[ F58] - --- end header dump -------------------
[ F58] -    Reported stream size  : 836
[ F58] -    CurrentReadBuffer size: 836
[ F58] -    Stream loaded...  // OK
[ F58] - RET: 201
[ F90] - RET: 200
[ F90] - GET/dropbox/rep5075c0b.msg?
[ F90] - RET: 200
[ F4C] - DELETE /dropbox/rep5075c0b.msg HTTP/1.1
[ F4C] - --- header dump -----------------------
[ F4C] -    crb: 135
[ F4C] -    hdr: Accept: */*
[ F4C] -    crb: 122
[ F4C] -    hdr: User-Agent: TransporterClient
[ F4C] -    crb: 91
[ F4C] -    hdr: Host: 192.168.1.167
[ F4C] -    crb: 70
[ F4C] -    hdr: Content-Length: 0
[ F4C] -    crb: 51
[ F4C] -    hdr: Connection: Keep-Alive
[ F4C] -    crb: 27
[ F4C] -    hdr: Cache-Control: no-cache
[ F4C] -    crb: 2
[ F4C] -    hdr:
[ F4C] - --- end header dump -------------------
[ F4C] - RET: 200
[ F4C] - PUT /dropbox/rep5075d2d.msg HTTP/1.1
[ F4C] - --- header dump -----------------------
[ F4C] -    crb: 973
[ F4C] -    hdr: Accept: */*
[ F4C] -    crb: 960
[ F4C] -    hdr: User-Agent: TransporterClient
[ F4C] -    crb: 929
[ F4C] -    hdr: Host: 192.168.1.167
[ F4C] -    crb: 908
[ F4C] -    hdr: Content-Length: 836
[ F4C] -    crb: 887
[ F4C] -    hdr: Connection: Keep-Alive
[ F4C] -    crb: 863
[ F4C] -    hdr: Cache-Control: no-cache
[ F4C] -    crb: 838
[ F4C] -    hdr:
[ F4C] - --- end header dump -------------------
[ F4C] -    Reported stream size  : 836
[ F4C] -    CurrentReadBuffer size: 836
[ F4C] -    Stream loaded...  // OK
[ F4C] - RET: 201
[ F90] - PUT /dropbox/Jet5075cfb.tmp HTTP/1.1
[ F90] - --- header dump -----------------------
[ F90] -    crb: 139
[ F90] -    hdr: Accept: */*
[ F90] -    crb: 126
[ F90] -    hdr: User-Agent: TransporterClient
[ F90] -    crb: 95
[ F90] -    hdr: Host: 192.168.1.167
[ F90] -    crb: 74
[ F90] -    hdr: Content-Length: 51332
[ F90] -    crb: 51
[ F90] -    hdr: Connection: Keep-Alive
[ F90] -    crb: 27
[ F90] -    hdr: Cache-Control: no-cache
[ F90] -    crb: 2
[ F90] -    hdr:
[ F90] - --- end header dump -------------------
[ F90] -    Reported stream size  : 51332
[ F90] -    CurrentReadBuffer size: 0             <<<< this one is failing.
All others are OK ...

Alain

 

Re:Problem with 'PUT' command on TIdHTTPServer


Found it myself...

Microsoft Access expects a "weird" response (it looks weird to me) from the
webserver handling the replication messages. This solved the problem:

          rsp.Add('HTTP/1.1 100 Continue');
          rsp.Add('Server: AidaLink Replication Engine' );
          rsp.Add('');
          rsp.Add('HTTP/1.1 201 Created');
          rsp.Add('Server: AidaLink Replication Engine' );
          rsp.Add('Connection: close');
          rsp.Add('Content-Length: 0');
          rsp.Add('Allow: GET, DELETE, PUT');
          rsp.Add('');

        Thread.Connection.Writeln(rsp.Text);

I didn't find this myself, so I have no idea why Access expects 2 headers
(the one with retcode 100 and the one with retcode 201). I monitored the TCP
traffic between access and IIS with an IdMapperPortTCP component and found
the double header in the logging...

Alain

Other Threads