Fossil

Check-in [225fd3da]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:json mode now accepts command=string request parameter if path length is 1 (no subcommand was specified).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | json-multitag-test | json
Files: files | file ages | folders
SHA1: 225fd3dad33e7a945d0ade473ab39cc5110c77b7
User & Date: stephan 2011-10-02 12:41:34
Context
2011-10-02
18:18
s/userName/name/, for consistency. check-in: 94689bbf user: stephan tags: json-multitag-test, json
12:41
json mode now accepts command=string request parameter if path length is 1 (no subcommand was specified). check-in: 225fd3da user: stephan tags: json-multitag-test, json
12:31
initial code for reading POST data from a file/stdin in CLI mode. check-in: 8145cdbf user: stephan tags: json-multitag-test, json
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/json.c.

979
980
981
982
983
984
985













986
987
988
989
990
991
992
....
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
        */;
  }

  /* Anything which needs json_getenv() and friends should go after
     this point.
  */














  if(!g.json.jsonp && g.json.post.o){
    g.json.jsonp =
      json_getenv_cstr("jsonp")
      /*cson_string_cstr(cson_value_get_string(cson_object_get(g.json.post.o,"jsonp")))*/
      ;
  }
  if( !g.isHTTP ){
................................................................................
       mode but (B) having them set gives us one less
       difference in the CLI/CGI/Server-mode JSON
       handling.
    */
    ;
  json_main_bootstrap();
  json_mode_bootstrap();
  if( g.argc<3 ){
    goto usage;
  }
  db_find_and_open_repository(0, 0);
#if 0
  json_warn(FSL_JSON_W_ROW_TO_JSON_FAILED, "Just testing.");
  json_warn(FSL_JSON_W_ROW_TO_JSON_FAILED, "Just testing again.");
#endif







>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
....
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
        */;
  }

  /* Anything which needs json_getenv() and friends should go after
     this point.
  */

  if(1 == cson_array_length_get(g.json.cmd.a)){
    /* special case: if we're at the top path, look for
       a "command" request arg which specifies which command
       to run.
    */
    char const * cmd = json_getenv_cstr("command");
    if(cmd){
      json_string_split(cmd, '/', 0, g.json.cmd.a);
    }
  }


  
  if(!g.json.jsonp && g.json.post.o){
    g.json.jsonp =
      json_getenv_cstr("jsonp")
      /*cson_string_cstr(cson_value_get_string(cson_object_get(g.json.post.o,"jsonp")))*/
      ;
  }
  if( !g.isHTTP ){
................................................................................
       mode but (B) having them set gives us one less
       difference in the CLI/CGI/Server-mode JSON
       handling.
    */
    ;
  json_main_bootstrap();
  json_mode_bootstrap();
  if( 2 > cson_array_length_get(g.json.cmd.a) ){
    goto usage;
  }
  db_find_and_open_repository(0, 0);
#if 0
  json_warn(FSL_JSON_W_ROW_TO_JSON_FAILED, "Just testing.");
  json_warn(FSL_JSON_W_ROW_TO_JSON_FAILED, "Just testing again.");
#endif