|  | @@ -82,21 +82,6 @@ enum mg_event {
 | 
											
												
													
														|  |    //   SSL_CTX *ssl_context = request_info->ev_data;
 |  |    //   SSL_CTX *ssl_context = request_info->ev_data;
 | 
											
												
													
														|  |    MG_INIT_SSL,
 |  |    MG_INIT_SSL,
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  // Mongoose tries to open file.
 |  | 
 | 
											
												
													
														|  | -  // If callback returns non-NULL, Mongoose will not try to open it, but
 |  | 
 | 
											
												
													
														|  | -  // will use the returned value as a pointer to the file data. This allows
 |  | 
 | 
											
												
													
														|  | -  // for example to serve files from memory.
 |  | 
 | 
											
												
													
														|  | -  // ev_data contains file path, including document root path.
 |  | 
 | 
											
												
													
														|  | -  // Upon return, ev_data should return file size,  which should be a long int.
 |  | 
 | 
											
												
													
														|  | -  //
 |  | 
 | 
											
												
													
														|  | -  //   const char *file_name = request_info->ev_data;
 |  | 
 | 
											
												
													
														|  | -  //   if (strcmp(file_name, "foo.txt") == 0) {
 |  | 
 | 
											
												
													
														|  | -  //     request_info->ev_data = (void *) (long) 4;
 |  | 
 | 
											
												
													
														|  | -  //     return "data";
 |  | 
 | 
											
												
													
														|  | -  //   }
 |  | 
 | 
											
												
													
														|  | -  //   return NULL;
 |  | 
 | 
											
												
													
														|  | -  MG_OPEN_FILE,
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |    // Sent on HTTP connect, before websocket handshake.
 |  |    // Sent on HTTP connect, before websocket handshake.
 | 
											
												
													
														|  |    // If user callback returns NULL, then mongoose proceeds
 |  |    // If user callback returns NULL, then mongoose proceeds
 | 
											
												
													
														|  |    // with handshake, otherwise it closes the connection.
 |  |    // with handshake, otherwise it closes the connection.
 | 
											
										
											
												
													
														|  | @@ -117,6 +102,26 @@ enum mg_event {
 | 
											
												
													
														|  |    // Callback's return value is ignored.
 |  |    // Callback's return value is ignored.
 | 
											
												
													
														|  |    // ev_data contains NULL.
 |  |    // ev_data contains NULL.
 | 
											
												
													
														|  |    MG_WEBSOCKET_CLOSE,
 |  |    MG_WEBSOCKET_CLOSE,
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +  // Mongoose tries to open file.
 | 
											
												
													
														|  | 
 |  | +  // If callback returns non-NULL, Mongoose will not try to open it, but
 | 
											
												
													
														|  | 
 |  | +  // will use the returned value as a pointer to the file data. This allows
 | 
											
												
													
														|  | 
 |  | +  // for example to serve files from memory.
 | 
											
												
													
														|  | 
 |  | +  // ev_data contains file path, including document root path.
 | 
											
												
													
														|  | 
 |  | +  // Upon return, ev_data should return file size,  which should be a long int.
 | 
											
												
													
														|  | 
 |  | +  //
 | 
											
												
													
														|  | 
 |  | +  //   const char *file_name = request_info->ev_data;
 | 
											
												
													
														|  | 
 |  | +  //   if (strcmp(file_name, "foo.txt") == 0) {
 | 
											
												
													
														|  | 
 |  | +  //     request_info->ev_data = (void *) (long) 4;
 | 
											
												
													
														|  | 
 |  | +  //     return "data";
 | 
											
												
													
														|  | 
 |  | +  //   }
 | 
											
												
													
														|  | 
 |  | +  //   return NULL;
 | 
											
												
													
														|  | 
 |  | +  MG_OPEN_FILE,
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +  // Mongoose initializes Lua server page. Sent only if Lua support is enabled.
 | 
											
												
													
														|  | 
 |  | +  // Callback's return value is ignored.
 | 
											
												
													
														|  | 
 |  | +  // ev_data contains lua_State pointer.
 | 
											
												
													
														|  | 
 |  | +  MG_INIT_LUA,
 | 
											
												
													
														|  |  };
 |  |  };
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 |