MCPcopy Create free account
hub / github.com/acl-dev/acl / http_util_set_dump_file

Function http_util_set_dump_file

lib_protocol/src/http/http_util.c:185–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185int http_util_set_dump_file(HTTP_UTIL *http_util, const char *filename)
186{
187 const char *myname = "http_util_set_dump_file";
188
189 if (filename == NULL || *filename == 0) {
190 acl_msg_error("%s(%d): filename invalid", myname, __LINE__);
191 return (-1);
192 }
193 if ((http_util->flag & HTTP_UTIL_FLAG_SET_DUMP_STREAM)) {
194 acl_msg_error("%s(%d): You've called http_util_set_dump_stream before!",
195 myname, __LINE__);
196 return (-1);
197 }
198
199 http_util->dump_stream = acl_vstream_fopen(filename,
200 O_CREAT | O_TRUNC | O_WRONLY, 0600, 4096);
201 if (http_util->dump_stream == NULL) {
202 acl_msg_error("%s(%d): open dump file(%s) error(%s)",
203 myname, __LINE__, filename, acl_last_serror());
204 return (-1);
205 }
206 http_util->flag |= HTTP_UTIL_FLAG_SET_DUMP_FILE;
207 return (0);
208}
209
210int http_util_req_open(HTTP_UTIL *http_util)
211{

Callers 2

get_urlFunction · 0.85
http_util_dump_urlFunction · 0.85

Calls 3

acl_msg_errorFunction · 0.85
acl_vstream_fopenFunction · 0.85
acl_last_serrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…