upload files problem

Discussion in 'Bug Reports' started by Grzegorz Derebecki, Dec 7, 2009.

  1. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    It happends sometimes: when i uploading files it don't finish request:


    Code:
    2009-12-07 12:10:26.923 [NOTICE] [127.0.0.1:58421-0#fdb.dev] Content len: 224961, Request line: 
    POST /contents/upload?format=js&form_type=poster&form_id=1&random=0.8401927328668535 HTTP/1.1
    2009-12-07 12:10:26.923 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:26.923 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 7
    2009-12-07 12:10:26.923 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Finsh request body 1053/0 bytes!
    2009-12-07 12:10:26.923 [DEBUG] [127.0.0.1:58421-0#fdb.dev] processNewReq() return 0. 
    2009-12-07 12:10:27.824 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:27.825 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:27.825 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:28.852 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:28.852 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:28.852 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:29.853 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:29.853 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:29.853 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:30.859 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:30.859 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:30.859 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:31.860 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:31.860 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:31.860 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:32.863 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:32.863 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:32.863 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:33.864 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:33.864 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:33.864 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:34.865 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:34.865 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:34.865 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:35.866 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:35.866 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:35.867 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:36.868 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:36.868 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:36.868 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:37.869 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:37.869 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:37.869 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:38.873 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:38.873 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:38.873 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:39.874 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:39.874 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:39.874 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:40.875 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:40.875 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:40.875 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:41.876 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:41.877 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:41.877 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:42.878 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:42.878 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:42.878 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:43.879 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:43.880 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:43.880 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:44.881 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:44.881 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    2009-12-07 12:10:44.881 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read from client: 0
    2009-12-07 12:10:45.882 [DEBUG] [127.0.0.1:58421-0#fdb.dev] HttpConnection::onReadEx(), state: 2!
    2009-12-07 12:10:45.882 [DEBUG] [127.0.0.1:58421-0#fdb.dev] Read Request Body!
    
    litespeed 4.0.11
    safari 4 as webbrowser

    when i use script/server (simple ruby web server for developing) it works ok.
    Last edited: Dec 7, 2009
  2. mistwang

    mistwang LiteSpeed Staff

    Looks like LSWS has difficulty parsing "Content-length" from the POST request.
    Do you have similar issue with other browsers?

    Can provide a TCPDUMP or wireshark capture of the request header and body?
    tcpdump -s0 -X -i lo port <your_lsws_port>

    wireshark is for windows.
  3. Grzegorz Derebecki

    Grzegorz Derebecki New Member

  4. mistwang

    mistwang LiteSpeed Staff

    Not sure why it sent POST twice via two connections.
    The request itself looks normal.

    in the debug log, does it ever show something like

    Finsh request body xxxx/227232 bytes
  5. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    I think that i know answer.

    I was using observer on form (on submit).
    2 request was probably reason why it works so bad. 1 request goes to iframe (ajax request can't send file fields) and second was by my mistake send by ajax.

    No i fixed that and i hope it will resolve my problem with uploading.
  6. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    hmm removing observer(onsubmit) don't change to mutch.

  7. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    With keep-alive it don't works but without is ok. How it is possible?
    i set bigger timeout for keep-alive maby this will help.
  8. mistwang

    mistwang LiteSpeed Staff

    OK, we will do more test on this.
  9. mistwang

    mistwang LiteSpeed Staff

    Can you please send us the full debug log for two consecutive keepalive requests, and the second the request is hanging?
  10. mistwang

    mistwang LiteSpeed Staff

    well, I tried the Safari 4.0.2 and 4.0.4 on a MacBook, it wont able to do consecutive POST on a keepalive connection. It crashes when sends the second request.:eek:

    More likely a bug in Safari. The solution is to turn off keepalive when detect POST request from Safari. Will add a feature in 4.0.12 to turn off keepalive with rewrite rule when "nokeepalive" environment is set.

Share This Page