Changeset 6149

Show
Ignore:
Timestamp:
05/08/10 19:15:12 (3 years ago)
Author:
Cyrus
Message:

zhttpd: Add HTTP/1.1 100 Continue support

Location:
luci2/zhttpd/handler
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci2/zhttpd/handler/cgi.c

    r6123 r6149  
    155155            } 
    156156        } 
     157        if ((p = zhttpd_env_get(&req->env, "HTTP_EXPECT")) 
     158        && strstr(p, "100-continue")) { 
     159            fputs("HTTP/1.1 100 Continue\r\n\r\n", req->streamout); 
     160            fflush(req->streamout); 
     161        } 
    157162 
    158163        ev.events = EPOLLOUT | EPOLLET; 
  • luci2/zhttpd/handler/luci2.c

    r6033 r6149  
    9393static int zhttpd_handler_luci2_json(zthread_t *thread) { 
    9494    zhttpd_request_t *req = thread->context; 
    95     const char *postlen = zhttpd_env_get(&req->env, "CONTENT_LENGTH"); 
     95    const char *postlen = zhttpd_env_get(&req->env, "CONTENT_LENGTH"), *p; 
    9696    unsigned int jsonsize; 
    9797    if (!postlen || (jsonsize = strtol(postlen, NULL, 10)) > LUCI2_JSON_LIMIT) { 
    9898        return zhttpd_request_error(thread, 
    9999                ZHTTPD_STATUS_REQUEST_ENTITY_TOO_LARGE); 
     100    } 
     101    if ((p = zhttpd_env_get(&req->env, "HTTP_EXPECT")) 
     102    && strstr(p, "100-continue")) { 
     103        fputs("HTTP/1.1 100 Continue\r\n\r\n", req->streamout); 
     104        fflush(req->streamout); 
    100105    } 
    101106