projects
/
reposerve
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reposerve server half way done
[reposerve]
/
server
/
src
/
main.c
diff --git
a/server/src/main.c
b/server/src/main.c
index
12bb01f
..
ab5c055
100644
(file)
--- a/
server/src/main.c
+++ b/
server/src/main.c
@@
-15,12
+15,15
@@
static const char *guess_repo_name(const char *path);
static int parse_args(int argc, char **argv);
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;
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;
int main(int argc, char **argv)
{
struct sockaddr_in addr;
@@
-101,7
+104,7
@@
int main(int argc, char **argv)
perror("failed to accept connection");
continue;
}
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;
perror("failed to allocate memory for client structure");
close(s);
continue;
@@
-109,6
+112,8
@@
int main(int argc, char **argv)
c->s = s;
c->next = clients;
clients = c;
c->s = s;
c->next = clients;
clients = c;
+
+ send_string(c, "reposerve-0.1 protocol:0\n");
}
}
}
}