INNER CODE UNIT · Go

gfa_server_query

lh3/gfatools · gfa-server.go:198

func gfa_server_query(w http.ResponseWriter, r *http.Request) {
	r.ParseForm();
	start_time := time.Now().UnixNano();
	fmt.Fprintf(os.Stderr, "[%d] got request: %s\n", start_time, r.Form);
	defer fmt.Fprintf(os.Stderr, "[%d] responded %d\n", time.Now().UnixNano(), start_time);
	if len(r.Form) == 0 {
		gfa_print_page(w, r, "");
		return;
	}
	g := gfa_graph_default;
	step := 3;
	if len(r.Form["graph"]) > 0 { // set graph
		tmp, ok := gfa_graphs[r.Form["graph"][0]];
		if !ok {
			http.Error(w, "400 Bad Request: failed to find graph '" + r.Form["graph"][0] + "'", 400);
			return;
		}
		g = tmp;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…