Changeset 5916

Show
Ignore:
Timestamp:
03/24/10 18:36:59 (3 years ago)
Author:
Cyrus
Message:

zhttpd: Adding CBI2 support (JSON support only for now)
cbi2, lmo: Fix compiling flags for shared linking

Location:
luci2
Files:
1 added
7 modified

Legend:

Unmodified
Added
Removed
  • luci2/cbi2/Makefile

    r5915 r5916  
    1616    $(AR) rc $@ $^ 
    1717 
    18 libcbi.so: parser.o json.o cbi_element.o cbi_dump.o cbi_core.o cbi_buffer.o cbi_uci.o source.o session.o u_sock.o validate.o uvl.o lang.o widget.o log.o handler.o 
     18libcbi.so: lucic.o parser.o json.o cbi_element.o cbi_dump.o cbi_core.o cbi_buffer.o cbi_uci.o source.o session.o u_sock.o validate.o uvl.o lang.o widget.o log.o handler.o ../lmo/liblmo.a 
    1919    $(CC) -shared -luci -ljson -lcrypt -lubox -o $@ $^ 
    2020 
  • luci2/lmo/Makefile

    r5854 r5916  
    1717 
    1818%.o: %.c 
    19     $(CC) $(CFLAGS) -g -c -o $@ $^  
     19    $(CC) $(CFLAGS) -fPIC -g -c -o $@ $^  
  • luci2/zhttpd/Makefile

    r5881 r5916  
    33WFLAGS:=-Wall -Werror -pedantic 
    44LDFLAGS?= 
    5 LDFLAGS+=-lubox -luci 
     5LDFLAGS+= 
    66TLSCFLAGS:= 
    77BINARY:=zhttpd 
     
    2020 
    2121$(BINARY): *.c handler/*.c 
    22     $(CC) $(CFLAGS) $(TLSCFLAGS) $(SFLAGS) $(WFLAGS) $(LDFLAGS) -I.. -o $@ $+ 
     22    $(CC) $(CFLAGS) $(TLSCFLAGS) $(SFLAGS) $(WFLAGS) $(LDFLAGS) -I.. -I../libubox -I../lmo -lubox -luci -lcbi -o $@ $+ 
    2323 
    2424clean: 
  • luci2/zhttpd/request.c

    r5884 r5916  
    178178        matchlen = size - 1; 
    179179        if (urllen > matchlen) { 
    180             zhttpd_env_set(&req->env, "PATH_INFO", url + matchlen + 1, 
    181                     urllen - matchlen - 1); 
     180            zhttpd_env_set(&req->env, "PATH_INFO", url + matchlen, 
     181                    urllen - matchlen); 
    182182        } else { 
    183183            zhttpd_env_set(&req->env, "PATH_INFO", "", 1); 
  • luci2/zhttpd/tcp.c

    r5900 r5916  
    8080    zhttpd_request_t* req = cookie; 
    8181    if (req->ioctx) { 
    82         SSL_shutdown((SSL*)req->ioctx); 
    8382        SSL_free((SSL*)req->ioctx); 
    8483        req->ioctx = NULL; 
  • luci2/zhttpd/zhttpd.c

    r5900 r5916  
    188188    zhttpd_vfs_t *d = NULL; 
    189189    for (zhttpd_vfs_t *c = zhttpd.vfs; c; c = d) { 
    190         c->handler->vfs_context_destroy(c->context); 
     190        if (c->handler->vfs_context_destroy) { 
     191            c->handler->vfs_context_destroy(c->context); 
     192        } 
    191193        d = c->next; 
    192194        free(c); 
     
    269271    mount->patternlen = pointlen; 
    270272    mount->handler = handler; 
    271     mount->context = handler->vfs_context_create(options); 
     273 
     274    if (handler->vfs_context_create) { 
     275        mount->context = handler->vfs_context_create(options); 
     276        if (!mount->context) { 
     277            free(mount); 
     278            return ZHTTPD_EINVAL; 
     279        } 
     280    } 
     281 
    272282    mount->next = zhttpd.vfs; 
    273  
    274     if (!mount->context) { 
    275         free(mount); 
    276         return ZHTTPD_EINVAL; 
    277     } 
    278  
    279283    zhttpd.vfs = mount; 
    280284 
  • luci2/zhttpd/zhttpd.uci

    r5900 r5916  
    2424    option physical /tmp 
    2525    option handler  cgi 
     26 
     27config mount luci2 
     28        option virtual /luci2 
     29        option handler luci2 
    2630     
    2731config mime mime