|  | @@ -8762,13 +8762,18 @@ parse_http_request(char *buf, int len, struct mg_request_info *ri)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	/* RFC says that all initial whitespaces should be ingored */
 |  |  	/* RFC says that all initial whitespaces should be ingored */
 | 
											
												
													
														|  |  	/* This included all leading \r and \n (isspace) */
 |  |  	/* This included all leading \r and \n (isspace) */
 | 
											
												
													
														|  | -    /* See table: http://www.cplusplus.com/reference/cctype/ */
 |  | 
 | 
											
												
													
														|  | 
 |  | +	/* See table: http://www.cplusplus.com/reference/cctype/ */
 | 
											
												
													
														|  |  	while ((len > 0) && isspace(*(unsigned char *)buf)) {
 |  |  	while ((len > 0) && isspace(*(unsigned char *)buf)) {
 | 
											
												
													
														|  |  		buf++;
 |  |  		buf++;
 | 
											
												
													
														|  |  		len--;
 |  |  		len--;
 | 
											
												
													
														|  |  		init_skip++;
 |  |  		init_skip++;
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +	if (len == 0) {
 | 
											
												
													
														|  | 
 |  | +		/* Incomplete request */
 | 
											
												
													
														|  | 
 |  | +		return 0;
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	/* Control characters are not allowed, including zero */
 |  |  	/* Control characters are not allowed, including zero */
 | 
											
												
													
														|  |  	if (iscntrl(*(unsigned char *)buf)) {
 |  |  	if (iscntrl(*(unsigned char *)buf)) {
 | 
											
												
													
														|  |  		return -1;
 |  |  		return -1;
 | 
											
										
											
												
													
														|  | @@ -8844,13 +8849,18 @@ parse_http_response(char *buf, int len, struct mg_response_info *ri)
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	/* RFC says that all initial whitespaces should be ingored */
 |  |  	/* RFC says that all initial whitespaces should be ingored */
 | 
											
												
													
														|  |  	/* This included all leading \r and \n (isspace) */
 |  |  	/* This included all leading \r and \n (isspace) */
 | 
											
												
													
														|  | -    /* See table: http://www.cplusplus.com/reference/cctype/ */
 |  | 
 | 
											
												
													
														|  | 
 |  | +	/* See table: http://www.cplusplus.com/reference/cctype/ */
 | 
											
												
													
														|  |  	while ((len > 0) && isspace(*(unsigned char *)buf)) {
 |  |  	while ((len > 0) && isspace(*(unsigned char *)buf)) {
 | 
											
												
													
														|  |  		buf++;
 |  |  		buf++;
 | 
											
												
													
														|  |  		len--;
 |  |  		len--;
 | 
											
												
													
														|  |  		init_skip++;
 |  |  		init_skip++;
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +	if (len == 0) {
 | 
											
												
													
														|  | 
 |  | +		/* Incomplete request */
 | 
											
												
													
														|  | 
 |  | +		return 0;
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	/* Control characters are not allowed, including zero */
 |  |  	/* Control characters are not allowed, including zero */
 | 
											
												
													
														|  |  	if (iscntrl(*(unsigned char *)buf)) {
 |  |  	if (iscntrl(*(unsigned char *)buf)) {
 | 
											
												
													
														|  |  		return -1;
 |  |  		return -1;
 |