ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mget incompatible



On Fri, Oct 26, 2007 at 12:16:22PM +0300, MZ wrote:

> Есть такая штука, для многопоточной закачки файлов с http:
> /usr/ports/ftp/mget
> 
> mGet is a command line download manager. It splits the file into a
> number of segments and uses several separate threads to download each
> segment. It can handle proxies and can tunnel through them to get files
> blocked by proxies.  Currently mGet only handles HTTP downloads
> directly, while FTP downloads must go through a proxy.
> WWW: http://cs-people.bu.edu/dbera/activities/projects/mget/mget.php
> 
> В общем, он с nginx не работает почему-то:
> Error code:-1
> HTTP Error: Unknown Error
> Exiting mGet/1.4.2
> 
> Я не разбирался, но может кому-то интересно, кто ж отступает от http -
> mget или nginx ? С apache проблем нет.

Прилагаемый патч лечит это дело.


-- 
Игорь Сысоев
http://sysoev.ru
Index: src/http/ngx_http_parse.c
===================================================================
--- src/http/ngx_http_parse.c   (revision 922)
+++ src/http/ngx_http_parse.c   (working copy)
@@ -124,6 +124,7 @@
         sw_major_digit,
         sw_first_minor_digit,
         sw_minor_digit,
+        sw_spaces_after_digit,
         sw_almost_done
     } state;
 
@@ -636,6 +637,11 @@
                 goto done;
             }
 
+            if (ch == ' ') {
+                state = sw_spaces_after_digit;
+                break;
+            }
+
             if (ch < '0' || ch > '9') {
                 return NGX_HTTP_PARSE_INVALID_REQUEST;
             }
@@ -643,6 +649,20 @@
             r->http_minor = r->http_minor * 10 + ch - '0';
             break;
 
+        case sw_spaces_after_digit:
+            switch (ch) {
+            case ' ':
+                break;
+            case CR:
+                state = sw_almost_done;
+                break;
+            case LF:
+                goto done;
+            default:
+                return NGX_HTTP_PARSE_INVALID_REQUEST;
+            }
+            break;
+
         /* end of request line */
         case sw_almost_done:
             r->request_end = p - 1;


 




Copyright © Lexa Software, 1996-2009.