SOURCES: lighttpd-branch.diff - correct

glen glen at pld-linux.org
Sat Jul 15 22:40:37 CEST 2006


Author: glen                         Date: Sat Jul 15 20:40:37 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- correct

---- Files affected:
SOURCES:
   lighttpd-branch.diff (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/lighttpd-branch.diff
diff -u SOURCES/lighttpd-branch.diff:1.5 SOURCES/lighttpd-branch.diff:1.6
--- SOURCES/lighttpd-branch.diff:1.5	Sat Jul 15 21:51:05 2006
+++ SOURCES/lighttpd-branch.diff	Sat Jul 15 22:40:32 2006
@@ -796,7 +796,7 @@
  LIGHTTPD_DIR=$(BUILD_DIR)/$(LIGHTTPD)
  LIGHTTPD_IPK=$(BUILD_DIR)/$(LIGHTTPD)_mipsel.ipk
 --- ../lighttpd-1.4.11/src/Makefile.am	2006-03-07 14:20:20.000000000 +0200
-+++ lighttpd-1.4.12/src/Makefile.am	2006-07-15 22:43:21.000000000 +0300
++++ lighttpd-1.4.12/src/Makefile.am	2006-07-15 23:38:00.000000000 +0300
 @@ -16,18 +16,24 @@
  else
  configparser.y: lemon
@@ -12392,6 +12392,140 @@
 +    }
 +  }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
 +  return;
++}
+--- ../lighttpd-1.4.11/src/http_resp_parser.h	1970-01-01 03:00:00.000000000 +0300
++++ lighttpd-1.4.12/src/http_resp_parser.h	2006-07-15 22:44:07.000000000 +0300
+@@ -0,0 +1,3 @@
++#define TK_CRLF                            1
++#define TK_STRING                          2
++#define TK_COLON                           3
+--- ../lighttpd-1.4.11/src/http_resp_parser.y	1970-01-01 03:00:00.000000000 +0300
++++ lighttpd-1.4.12/src/http_resp_parser.y	2006-07-15 22:43:21.000000000 +0300
+@@ -0,0 +1,125 @@
++%token_prefix TK_
++%token_type {buffer *}
++%extra_argument {http_resp_ctx_t *ctx}
++%name http_resp_parser
++
++%include {
++#include <assert.h>
++#include <string.h>
++#include "http_resp.h"
++#include "keyvalue.h"
++#include "array.h"
++}
++
++%parse_failure {
++  ctx->ok = 0;
++}
++
++%type protocol { int }
++%type response_hdr { http_resp * }
++%type number { int }
++%type headers { array * }
++%type header { data_string * }
++%token_destructor { buffer_free($$); }
++
++/* just headers + Status: ... */
++response_hdr ::= headers(HDR) CRLF . {
++    http_resp *resp = ctx->resp;
++    data_string *ds;
++ 
++    resp->protocol = HTTP_VERSION_UNSET;
++
++    buffer_copy_string(resp->reason, ""); /* no reason */
++    array_free(resp->headers);
++    resp->headers = HDR;
++
++    if (NULL == (ds = (data_string *)array_get_element(HDR, "Status"))) { 
++        resp->status = 0;
++    } else {
++        char *err;
++        resp->status = strtol(ds->value->ptr, &err, 10);
++   
++        if (*err != '\0' && *err != ' ') {
++            buffer_copy_string(ctx->errmsg, "expected a number: ");
++            buffer_append_string_buffer(ctx->errmsg, ds->value);
++            buffer_append_string(ctx->errmsg, err);
++        
++            ctx->ok = 0;
++        }
++    }
++
++    HDR = NULL;
++}
++/* HTTP/1.0 <status> ... */
++response_hdr ::= protocol(B) number(C) reason(D) CRLF headers(HDR) CRLF . {
++    http_resp *resp = ctx->resp;
++    
++    resp->status = C;
++    resp->protocol = B;
++    buffer_copy_string_buffer(resp->reason, D);
++    
++    array_free(resp->headers);
++    
++    resp->headers = HDR;
++    
++    HDR = NULL;
++}
++
++protocol(A) ::= STRING(B). {
++    if (buffer_is_equal_string(B, CONST_STR_LEN("HTTP/1.0"))) {
++        A = HTTP_VERSION_1_0;
++    } else if (buffer_is_equal_string(B, CONST_STR_LEN("HTTP/1.1"))) {
++        A = HTTP_VERSION_1_1;
++    } else {
++        buffer_copy_string(ctx->errmsg, "unknown protocol: ");
++        buffer_append_string_buffer(ctx->errmsg, B);
++        
++        ctx->ok = 0;
++    }
++}
++
++number(A) ::= STRING(B). {
++    char *err;
++    A = strtol(B->ptr, &err, 10);
++    
++    if (*err != '\0') {
++        buffer_copy_string(ctx->errmsg, "expected a number: ");
++        buffer_append_string_buffer(ctx->errmsg, B);
++        
++        ctx->ok = 0;
++    }
++}
++
++reason(A) ::= STRING(B). {
++    A = B;
++    B = NULL;
++}
++
++reason(A) ::= reason(C) STRING(B). {
++    A = C;
++    
++    buffer_append_string(A, " ");
++    buffer_append_string_buffer(A, B);
++    
++    C = NULL;
++}
++
++headers(HDRS) ::= headers(SRC) header(HDR). {
++    HDRS = SRC;
++    
++    array_insert_unique(HDRS, (data_unset *)HDR);
++    
++    SRC = NULL;
++}
++
++headers(HDRS) ::= header(HDR). {
++    HDRS = array_init();
++
++    array_insert_unique(HDRS, (data_unset *)HDR);
++}
++header(HDR) ::= STRING(A) COLON STRING(B) CRLF. {
++    HDR = data_string_init();
++    
++    buffer_copy_string_buffer(HDR->key, A);
++    buffer_copy_string_buffer(HDR->value, B);    
 +}
 --- ../lighttpd-1.4.11/src/inet_ntop_cache.c	2005-08-11 01:26:38.000000000 +0300
 +++ lighttpd-1.4.12/src/inet_ntop_cache.c	2006-07-11 22:07:52.000000000 +0300
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/lighttpd-branch.diff?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list