summaryrefslogtreecommitdiff
path: root/src/server.h
blob: 943eaa2cdd88674d4df96b89c21f0abdaebed592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_server_h__
#define INCLUDE_server_h__

#include "common.h"
#include "transports/smart.h"
#include "array.h"

typedef git_array_t(git_oid) git_oid_array;

struct git_server {
	enum git_request_type type;
	git_repository *repo;
	gitno_socket s;
	int rpc;
	char *path;
	git_oid_array common;
	git_oid_array wants;
};

extern int git_server_new(git_server **out, git_repository *repo, int fd);
extern void git_server_free(git_server *server);
extern int git_server__handle_request(git_server *server, git_pkt *pkt);
extern int git_server__ls(git_buf *out, git_server *server);
extern int git_server__negotiation(git_server *server, git_pkt *_pkt);

#endif