MCPcopy Create free account
hub / github.com/git/git / read_request

Function read_request

builtin/credential-cache--daemon.c:103–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static int read_request(FILE *fh, struct credential *c,
104 struct strbuf *action, int *timeout)
105{
106 static struct strbuf item = STRBUF_INIT;
107 const char *p;
108
109 strbuf_getline_lf(&item, fh);
110 if (!skip_prefix(item.buf, "action=", &p))
111 return error("client sent bogus action line: %s", item.buf);
112 strbuf_addstr(action, p);
113
114 strbuf_getline_lf(&item, fh);
115 if (!skip_prefix(item.buf, "timeout=", &p))
116 return error("client sent bogus timeout line: %s", item.buf);
117 *timeout = atoi(p);
118
119 credential_set_all_capabilities(c, CREDENTIAL_OP_INITIAL);
120
121 if (credential_read(c, fh, CREDENTIAL_OP_HELPER) < 0)
122 return -1;
123 return 0;
124}
125
126static void serve_one_client(FILE *in, FILE *out)
127{

Callers 1

serve_one_clientFunction · 0.70

Calls 5

strbuf_getline_lfFunction · 0.85
errorFunction · 0.85
strbuf_addstrFunction · 0.85
credential_readFunction · 0.50

Tested by

no test coverage detected