static const char *guess_repo_name(const char *path);
static int parse_args(int argc, char **argv);
-static const char *repo_path, *repo_name;
+static const char *repo_name;
static int lis = -1;
static int port = 64357;
static struct client *clients;
+const char *repo_path;
+
+
int main(int argc, char **argv)
{
struct sockaddr_in addr;
perror("failed to accept connection");
continue;
}
- if(!(c = malloc(sizeof *c))) {
+ if(!(c = calloc(1, sizeof *c))) {
perror("failed to allocate memory for client structure");
close(s);
continue;
c->s = s;
c->next = clients;
clients = c;
+
+ send_string(c, "reposerve-0.1 protocol:0\n");
}
}