|  | @@ -6415,7 +6415,7 @@ void mg_close_connection(struct mg_connection *conn)
 | 
											
												
													
														|  |      mg_free(conn);
 |  |      mg_free(conn);
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -struct mg_connection *mg_connect(const char *host, int port, int use_ssl,
 |  | 
 | 
											
												
													
														|  | 
 |  | +struct mg_connection *mg_connect_client(const char *host, int port, int use_ssl,
 | 
											
												
													
														|  |                                   char *ebuf, size_t ebuf_len)
 |  |                                   char *ebuf, size_t ebuf_len)
 | 
											
												
													
														|  |  {
 |  |  {
 | 
											
												
													
														|  |      static struct mg_context fake_ctx;
 |  |      static struct mg_context fake_ctx;
 | 
											
										
											
												
													
														|  | @@ -6470,7 +6470,7 @@ static int is_valid_uri(const char *uri)
 | 
											
												
													
														|  |      return uri[0] == '/' || (uri[0] == '*' && uri[1] == '\0');
 |  |      return uri[0] == '/' || (uri[0] == '*' && uri[1] == '\0');
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -int mg_getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len)
 |  | 
 | 
											
												
													
														|  | 
 |  | +int getreq(struct mg_connection *conn, char *ebuf, size_t ebuf_len)
 | 
											
												
													
														|  |  {
 |  |  {
 | 
											
												
													
														|  |      const char *cl;
 |  |      const char *cl;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -6519,11 +6519,11 @@ struct mg_connection *mg_download(const char *host, int port, int use_ssl,
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      va_start(ap, fmt);
 |  |      va_start(ap, fmt);
 | 
											
												
													
														|  |      ebuf[0] = '\0';
 |  |      ebuf[0] = '\0';
 | 
											
												
													
														|  | -    if ((conn = mg_connect(host, port, use_ssl, ebuf, ebuf_len)) == NULL) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    if ((conn = mg_connect_client(host, port, use_ssl, ebuf, ebuf_len)) == NULL) {
 | 
											
												
													
														|  |      } else if (mg_vprintf(conn, fmt, ap) <= 0) {
 |  |      } else if (mg_vprintf(conn, fmt, ap) <= 0) {
 | 
											
												
													
														|  |          snprintf(ebuf, ebuf_len, "%s", "Error sending request");
 |  |          snprintf(ebuf, ebuf_len, "%s", "Error sending request");
 | 
											
												
													
														|  |      } else {
 |  |      } else {
 | 
											
												
													
														|  | -        mg_getreq(conn, ebuf, ebuf_len);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        getreq(conn, ebuf, ebuf_len);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |      if (ebuf[0] != '\0' && conn != NULL) {
 |  |      if (ebuf[0] != '\0' && conn != NULL) {
 | 
											
												
													
														|  |          mg_close_connection(conn);
 |  |          mg_close_connection(conn);
 | 
											
										
											
												
													
														|  | @@ -6646,7 +6646,7 @@ static void process_new_connection(struct mg_connection *conn)
 | 
											
												
													
														|  |         to crule42. */
 |  |         to crule42. */
 | 
											
												
													
														|  |      conn->data_len = 0;
 |  |      conn->data_len = 0;
 | 
											
												
													
														|  |      do {
 |  |      do {
 | 
											
												
													
														|  | -        if (!mg_getreq(conn, ebuf, sizeof(ebuf))) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (!getreq(conn, ebuf, sizeof(ebuf))) {
 | 
											
												
													
														|  |              send_http_error(conn, 500, "Server Error", "%s", ebuf);
 |  |              send_http_error(conn, 500, "Server Error", "%s", ebuf);
 | 
											
												
													
														|  |              conn->must_close = 1;
 |  |              conn->must_close = 1;
 | 
											
												
													
														|  |          } else if (!is_valid_uri(conn->request_info.uri)) {
 |  |          } else if (!is_valid_uri(conn->request_info.uri)) {
 |