[Groonga-commit] groonga/groonga at ed9af1f [master] http: don't accept "Expect: 100-CONTINUE"

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jun 7 14:47:54 JST 2014


Kouhei Sutou	2014-06-07 14:47:54 +0900 (Sat, 07 Jun 2014)

  New Revision: ed9af1f6eef8ed22646c094b4136997f9d0e720a
  https://github.com/groonga/groonga/commit/ed9af1f6eef8ed22646c094b4136997f9d0e720a

  Message:
    http: don't accept "Expect: 100-CONTINUE"
    
    Because RFC 2616 says the following at "8.2.3 Use of the
    100 (Continue) Status":
    
    > - If a client will wait for a 100 (Continue) response before
    >   sending the request body, it MUST send an Expect request-header
    >   field (section 14.20) with the "100-continue" expectation.

  Modified files:
    src/groonga.c

  Modified: src/groonga.c (+5 -1)
===================================================================
--- src/groonga.c    2014-06-07 14:44:11 +0900 (089ffb9)
+++ src/groonga.c    2014-06-07 14:47:54 +0900 (79a788c)
@@ -763,6 +763,10 @@ typedef struct {
   const char *body_start;
 } h_post_header;
 
+#define STRING_EQUAL(string, string_length, constant_string)\
+  (string_length == strlen(constant_string) &&\
+   strncmp(string, constant_string, string_length) == 0)
+
 #define STRING_EQUAL_CI(string, string_length, constant_string)\
   (string_length == strlen(constant_string) &&\
    strncasecmp(string, constant_string, string_length) == 0)
@@ -879,7 +883,7 @@ do_htreq_post_parse_header_values(grn_ctx *ctx,
             header->content_length = -1;
           }
         } else if (STRING_EQUAL_CI(name, name_length, "Expect")) {
-          if (STRING_EQUAL_CI(value, value_length, "100-continue")) {
+          if (STRING_EQUAL(value, value_length, "100-continue")) {
             header->have_100_continue = GRN_TRUE;
           }
         }
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index