aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.c b/src/net.c
index 3e9fe30..d08a6ba 100644
--- a/src/net.c
+++ b/src/net.c
@@ -94,47 +94,47 @@ trim_crlf (char *s)
94 } 94 }
95} 95}
96 96
97void 97void
98handle_connection (FILE *in, FILE *out) 98handle_connection (FILE *in, FILE *out)
99{ 99{
100 char *buf = NULL; 100 char *buf = NULL;
101 size_t buflen = 0; 101 size_t buflen = 0;
102 const struct spool *spool; 102 const struct spool *spool;
103 char *p; 103 char *p;
104 struct passwd *pw; 104 struct passwd *pw;
105 105
106 if (getline (&buf, &buflen, in) <= 0) 106 if (grecs_getline (&buf, &buflen, in) <= 0)
107 return; 107 return;
108 trim_crlf (buf); 108 trim_crlf (buf);
109 if (debug_level) 109 if (debug_level)
110 logmsg (LOG_DEBUG, "recv: %s", buf); 110 logmsg (LOG_DEBUG, "recv: %s", buf);
111 spool = wydawca_find_spool (buf); 111 spool = wydawca_find_spool (buf);
112 if (!spool) 112 if (!spool)
113 { 113 {
114 if (all_spool_aliases && grecs_list_locate (all_spool_aliases, buf)) 114 if (all_spool_aliases && grecs_list_locate (all_spool_aliases, buf))
115 fprintf (out, "+ OK, all spools\r\n"); 115 fprintf (out, "+ OK, all spools\r\n");
116 else 116 else
117 { 117 {
118 fprintf (out, "- Unknown service name\r\n"); 118 fprintf (out, "- Unknown service name\r\n");
119 free (buf); 119 free (buf);
120 return; 120 return;
121 } 121 }
122 } 122 }
123 else if (spool->url) 123 else if (spool->url)
124 fprintf (out, "+ OK, URL %s\r\n", spool->url); 124 fprintf (out, "+ OK, URL %s\r\n", spool->url);
125 else 125 else
126 fprintf (out, "+ OK, spool %s\r\n", spool->tag); 126 fprintf (out, "+ OK, spool %s\r\n", spool->tag);
127 127
128 if (getline (&buf, &buflen, in) < 0) 128 if (grecs_getline (&buf, &buflen, in) < 0)
129 { 129 {
130 logmsg (LOG_ERR, "protocol error"); 130 logmsg (LOG_ERR, "protocol error");
131 free (buf); 131 free (buf);
132 return; 132 return;
133 } 133 }
134 134
135 trim_crlf (buf); 135 trim_crlf (buf);
136 if (debug_level) 136 if (debug_level)
137 logmsg (LOG_DEBUG, "recv: %s", buf); 137 logmsg (LOG_DEBUG, "recv: %s", buf);
138 138
139 p = strchr (buf, ' '); 139 p = strchr (buf, ' ');
140 if (p) 140 if (p)

Return to:

Send suggestions and report system problems to the System administrator.