Changeset 33094 for lang/c

Show
Ignore:
Timestamp:
05/06/09 14:51:49 (4 years ago)
Author:
kawa0117
Message:

tdserver - query bug fix

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/c/tdserver/trunk/tdserver.c

    r33093 r33094  
    460460    readcgiparam(pstr?pstr:"",pmap); 
    461461    const char *query = tcmapget2(pmap, "q"); 
    462     if(strlen(query)==0) query = NULL; 
     462    if( query && strlen(query)==0 ) query = NULL; 
    463463    int ksiz; 
    464464    char *kbuf = tcurldecode(uri, &ksiz); 
     
    474474        int len = strlen(val); 
    475475        tcxstrprintf(xstr, "HTTP/1.1 200 OK\r\n"); 
    476         tcxstrprintf(xstr, "Content-Type: application/octet-stream\r\n"); 
     476        tcxstrprintf(xstr, "Content-Type: text/plain\r\n"); 
    477477        tcxstrprintf(xstr, "Content-Length: %d\r\n", len); 
    478478        tcxstrprintf(xstr, "X-TD-Time: %.6f\r\n", sptime); 
     
    614614    readcgiparam(pstr?pstr:"",pmap); 
    615615    const char *query = tcmapget2(pmap, "q"); 
    616     if(strlen(query)==0) query = NULL; 
     616    if( query && strlen(query)==0 ) query = NULL; 
    617617    int ksiz; 
    618618    char *kbuf = tcurldecode(uri, &ksiz);