Skip to content

Commit 11c89c3

Browse files
committed
net: move gitno buffer to staticstr
The `gitno` buffer interface is another layer on top of socket reads. Abstract it a bit into a "static string" that has `git_str` like semantics but without heap allocation which moves the actual reading logic into the socket / stream code, and allows for easier future usage of a static / stack-allocated `git_str`-like interface.
1 parent 6e4bbf2 commit 11c89c3

File tree

22 files changed

+151
-237
lines changed

22 files changed

+151
-237
lines changed

src/libgit2/fetch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "remote.h"
1818
#include "refspec.h"
1919
#include "pack.h"
20-
#include "netops.h"
2120
#include "repository.h"
2221
#include "refs.h"
2322
#include "transports/smart.h"

src/libgit2/fetch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
#include "git2/remote.h"
1313

14-
#include "netops.h"
15-
1614
int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts);
1715

1816
int git_fetch_download_pack(git_remote *remote);

src/libgit2/netops.c

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/libgit2/netops.h

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/libgit2/pack-objects.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "zstream.h"
1212
#include "delta.h"
1313
#include "iterator.h"
14-
#include "netops.h"
1514
#include "pack.h"
1615
#include "thread.h"
1716
#include "tree.h"

src/libgit2/pack-objects.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "str.h"
1414
#include "hash.h"
1515
#include "oidmap.h"
16-
#include "netops.h"
1716
#include "zstream.h"
1817
#include "pool.h"
1918
#include "indexer.h"

src/libgit2/streams/mbedtls.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "runtime.h"
1515
#include "stream.h"
1616
#include "streams/socket.h"
17-
#include "netops.h"
1817
#include "git2/transport.h"
1918
#include "util.h"
2019

src/libgit2/streams/openssl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "stream.h"
2121
#include "net.h"
2222
#include "streams/socket.h"
23-
#include "netops.h"
2423
#include "git2/transport.h"
2524
#include "git2/sys/openssl.h"
2625

@@ -71,14 +70,14 @@ static void *git_openssl_malloc(size_t bytes, const char *file, int line)
7170
GIT_UNUSED(line);
7271
return git__calloc(1, bytes);
7372
}
74-
73+
7574
static void *git_openssl_realloc(void *mem, size_t size, const char *file, int line)
7675
{
7776
GIT_UNUSED(file);
7877
GIT_UNUSED(line);
7978
return git__realloc(mem, size);
8079
}
81-
80+
8281
static void git_openssl_free(void *mem, const char *file, int line)
8382
{
8483
GIT_UNUSED(file);

src/libgit2/streams/socket.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "streams/socket.h"
99

1010
#include "posix.h"
11-
#include "netops.h"
1211
#include "registry.h"
1312
#include "runtime.h"
1413
#include "stream.h"

src/libgit2/streams/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "common.h"
1111

12-
#include "netops.h"
12+
#include "stream.h"
1313

1414
typedef struct {
1515
git_stream parent;

0 commit comments

Comments
 (0)