[Groonga-commit] groonga/groonga [master] Name "=" and "&;"

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 8日 (日) 18:56:26 JST


Kouhei Sutou	2012-07-08 18:56:26 +0900 (Sun, 08 Jul 2012)

  New Revision: 6b168ae859c507470e8c39ddb9986518cd6570ed
  https://github.com/groonga/groonga/commit/6b168ae859c507470e8c39ddb9986518cd6570ed

  Log:
    Name "=" and "&;"

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+7 -4)
===================================================================
--- lib/ctx.c    2012-07-08 18:46:05 +0900 (5920a0b)
+++ lib/ctx.c    2012-07-08 18:56:26 +0900 (c553035)
@@ -1192,6 +1192,9 @@ get_command_version(grn_ctx *ctx, const char *p, const char *pe)
 #define OUTPUT_TYPE_LEN     (sizeof(OUTPUT_TYPE) - 1)
 #define COMMAND_VERSION_LEN (sizeof(COMMAND_VERSION) - 1)
 
+#define HTTP_QUERY_PAIR_DELIMITER   "="
+#define HTTP_QUERY_PAIRS_DELIMITERS "&;"
+
 static inline int
 command_proc_p(grn_obj *expr)
 {
@@ -1215,18 +1218,18 @@ grn_ctx_qe_exec_uri(grn_ctx *ctx, const char *path, uint32_t path_len)
     while (p < e) {
       int l;
       GRN_BULK_REWIND(&buf);
-      p = grn_text_cgidec(ctx, &buf, p, e, "=");
+      p = grn_text_cgidec(ctx, &buf, p, e, HTTP_QUERY_PAIR_DELIMITER);
       v = GRN_TEXT_VALUE(&buf);
       l = GRN_TEXT_LEN(&buf);
       if (l == OUTPUT_TYPE_LEN && !memcmp(v, OUTPUT_TYPE, OUTPUT_TYPE_LEN)) {
         GRN_BULK_REWIND(&buf);
-        p = grn_text_cgidec(ctx, &buf, p, e, "&;");
+        p = grn_text_cgidec(ctx, &buf, p, e, HTTP_QUERY_PAIRS_DELIMITERS);
         v = GRN_TEXT_VALUE(&buf);
         get_content_mime_type(ctx, v, GRN_BULK_CURR(&buf));
       } else if (l == COMMAND_VERSION_LEN &&
                  !memcmp(v, COMMAND_VERSION, COMMAND_VERSION_LEN)) {
         GRN_BULK_REWIND(&buf);
-        p = grn_text_cgidec(ctx, &buf, p, e, "&;");
+        p = grn_text_cgidec(ctx, &buf, p, e, HTTP_QUERY_PAIRS_DELIMITERS);
         get_command_version(ctx, GRN_TEXT_VALUE(&buf), GRN_BULK_CURR(&buf));
         if (ctx->rc) { goto exit; }
       } else {
@@ -1234,7 +1237,7 @@ grn_ctx_qe_exec_uri(grn_ctx *ctx, const char *path, uint32_t path_len)
           val = &buf;
         }
         grn_obj_reinit(ctx, val, GRN_DB_TEXT, 0);
-        p = grn_text_cgidec(ctx, val, p, e, "&;");
+        p = grn_text_cgidec(ctx, val, p, e, HTTP_QUERY_PAIRS_DELIMITERS);
       }
     }
     ctx->impl->curr_expr = expr;
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
다운로드 



Groonga-commit メーリングリストの案内
Back to archive index