static int read_post_init()

in tcl_cmds.c [443:476]


static int read_post_init(request_rec *r, Tcl_Interp *interp)
{
	const char *type = apr_table_get(r->headers_in, "Content-Type");
	char *boundary;
	
	if (read_post_ok) {
		read_post_ok = 0;
	}
	else {
		/* already read */
		return OK;
	}
	
	if (!strcmp(type, "application/x-www-form-urlencoded")) {
		return read_post(r, interp);
	}
	else if (strstr(type, "multipart/form-data")) {
		boundary = strstr(type, "boundary=");
		
		if (!boundary) {
			ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r->server, "read_post_init(...): no boundry in multipart/form-data");
			return DECLINED;
		}
		
		boundary += 9;
		
		return read_post_data(r, interp, boundary);
	}
	else {
		ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r->server, "read_post_init(...): unknown, Content-Type: %s", type);
		
		return DECLINED;
	}
}