Changeset 62

Show
Ignore:
Timestamp:
03/01/2005 01:37:40 PM (4 years ago)
Author:
jan
Message:

added checks for the line-terminator handling and cleanup the configs

Location:
trunk
Files:
2 added
1 removed
3 modified
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/mod_fastcgi.c

    r52 r62  
    20262026                                                c = hctx->response->ptr + 1; 
    20272027                                        } else if (NULL != (c = buffer_search_string_len(hctx->response, "\r\n\r\n", 4))) { 
    2028                                                 hlen = c - hctx->response->ptr + 4; 
     2028                                                c += 4; 
     2029                                                hlen = c - hctx->response->ptr; 
     2030                                                 
    20292031                                        } else if (NULL != (c = buffer_search_string_len(hctx->response, "\n\n", 2))) { 
    2030                                                 hlen = c - hctx->response->ptr + 2; 
     2032                                                c += 2; 
     2033                                                hlen = c - hctx->response->ptr; 
    20312034                                        } 
    20322035                                         
     
    20542057                                                 
    20552058                                                        if (blen) { 
    2056                                                                 http_chunk_append_mem(srv, con, c + 4, blen + 1); 
     2059                                                                http_chunk_append_mem(srv, con, c, blen + 1); 
    20572060                                                                joblist_append(srv, con); 
    20582061#if 0 
  • trunk/tests/Makefile.am

    r56 r62  
    33 
    44if CHECK_WITH_FASTCGI 
    5 check_PROGRAMS=fcgi-auth 
     5check_PROGRAMS=fcgi-auth fcgi-responder 
    66 
    77fcgi_auth_SOURCES=fcgi-auth.c 
    88fcgi_auth_LDADD=-lfcgi 
     9 
     10fcgi_responder_SOURCES=fcgi-responder.c 
     11fcgi_responder_LDADD=-lfcgi 
    912endif 
    1013 
     
    1518 
    1619CONFS=fastcgi-10.conf \ 
    17       fastcgi-11.conf \ 
    18       fastcgi-12.conf \ 
     20      fastcgi-auth.conf \ 
     21      fastcgi-responder.conf \ 
    1922      fastcgi-13.conf \ 
    2023      bug-06.conf \ 
  • trunk/tests/run-tests.pl

    r60 r62  
    33use strict; 
    44use IO::Socket; 
    5 use Test::More tests => 120; 
     5use Test::More tests => 124; 
    66 
    77 
     
    3333 
    3434        kill('TERM',$pid) or return -1; 
    35         select(undef, undef, undef, 0.25); 
     35        select(undef, undef, undef, 0.01); 
    3636 
    3737        return 0; 
     
    11381138ok(stop_proc == 0, "Stopping lighttpd"); 
    11391139 
    1140 $configfile = 'fastcgi-11.conf'; 
    1141 ok(start_proc == 0, "Starting lighttpd with fastcgi-11.conf") or die(); 
     1140$configfile = 'fastcgi-auth.conf'; 
     1141ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
    11421142@request  = ( <<EOF 
    11431143GET /index.html?ok HTTP/1.0 
     
    11481148ok(handle_http == 0, 'FastCGI - Auth'); 
    11491149 
    1150 ok(stop_proc == 0, "Stopping lighttpd"); 
    1151  
    1152 $configfile = 'fastcgi-12.conf'; 
    1153 ok(start_proc == 0, "Starting lighttpd with fastcgi-12.conf") or die(); 
    11541150@request  = ( <<EOF 
    11551151GET /index.html?fail HTTP/1.0 
     
    11991195ok(stop_proc == 0, "Stopping lighttpd"); 
    12001196 
    1201  
     1197$configfile = 'fastcgi-responder.conf'; 
     1198ok(start_proc == 0, "Starting lighttpd with $configfile") or die(); 
     1199@request  = ( <<EOF 
     1200GET /index.fcgi?lf HTTP/1.0 
     1201Host: www.example.org 
     1202EOF 
     1203 ); 
     1204@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1205ok(handle_http == 0, 'line-ending \n\n'); 
     1206 
     1207@request  = ( <<EOF 
     1208GET /index.fcgi?crlf HTTP/1.0 
     1209Host: www.example.org 
     1210EOF 
     1211 ); 
     1212@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1213ok(handle_http == 0, 'line-ending \r\n\r\n'); 
     1214 
     1215@request  = ( <<EOF 
     1216GET /index.fcgi?slow-lf HTTP/1.0 
     1217Host: www.example.org 
     1218EOF 
     1219 ); 
     1220@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1221ok(handle_http == 0, 'line-ending \n + \n'); 
     1222 
     1223 
     1224 
     1225@request  = ( <<EOF 
     1226GET /index.fcgi?slow-crlf HTTP/1.0 
     1227Host: www.example.org 
     1228EOF 
     1229 ); 
     1230@response = ( { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => 'test123' } ); 
     1231ok(handle_http == 0, 'line-ending \r\n + \r\n'); 
     1232 
     1233 
     1234ok(stop_proc == 0, "Stopping lighttpd"); 
     1235