MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / gopher_connect

Function gopher_connect

libavformat/gopher.c:45–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45static int gopher_connect(URLContext *h, const char *path)
46{
47 char buffer[1024];
48
49 if (!*path) return AVERROR(EINVAL);
50 switch (*++path) {
51 case ';':
52 case '<':
53 case '5':
54 case '9':
55 case 's':
56 path = strchr(path, '/');
57 if (!path) return AVERROR(EINVAL);
58 break;
59 default:
60 av_log(h, AV_LOG_WARNING,
61 "Gopher protocol type '%c' not supported yet!\n",
62 *path);
63 return AVERROR(EINVAL);
64 }
65
66 /* send gopher sector */
67 snprintf(buffer, sizeof(buffer), "%s\r\n", path);
68
69 if (gopher_write(h, buffer, strlen(buffer)) < 0)
70 return AVERROR(EIO);
71
72 return 0;
73}
74
75static int gopher_close(URLContext *h)
76{

Callers 1

gopher_openFunction · 0.85

Calls 2

av_logFunction · 0.85
gopher_writeFunction · 0.85

Tested by

no test coverage detected