aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-20 18:51:15 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-20 18:54:17 +0300
commitdf59e148ac7b5fa46959c89f206572738735e121 (patch)
treefac2ec0d01632ee60135d4427364e808b829e459 /src/net.c
parent4caaf454b507722908a642d25034837108ccaf16 (diff)
downloadwydawca-df59e148ac7b5fa46959c89f206572738735e121.tar.gz
wydawca-df59e148ac7b5fa46959c89f206572738735e121.tar.bz2
Add tests for legacy upload notification interface
* src/net.c (handle_connection): Ignore user/comment. * tests/.gitignore: Add wyclt. * tests/wyclt.c: New file. * tests/Makefile.am (TESTSUITE_AT): Add new tests. * tests/unp-idle.at: New test. * tests/unp00.at: New test. * tests/unp01.at: New test. * tests/testsuite.at (AT_WYDAWCA_DAEMON): Change arguments. (AT_WYDAWCA_INOTIFY_DAEMON): New macro. Include new tests.
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/net.c b/src/net.c
index f0869dc..62d2fef 100644
--- a/src/net.c
+++ b/src/net.c
@@ -207,7 +207,6 @@ handle_connection(struct wydawca_connection *conn)
char *buf = NULL;
size_t buflen = 0;
struct spool *spool;
- char *p;
if (grecs_getline(&buf, &buflen, conn->fp) <= 0)
return;
@@ -238,16 +237,6 @@ handle_connection(struct wydawca_connection *conn)
wy_debug(1, ("recv: %s", buf));
/* FIXME: User name not used any more */
- p = strchr(buf, ' ');
- if (p) {
- *p++ = 0;
- while (*p && (*p == ' ' || *p == '\t'))
- p++;
- } else {
- wy_log(LOG_ERR, "protocol error");
- free(buf);
- return;
- }
if (spool)
scan_spool(spool);
@@ -281,9 +270,10 @@ wy_thr_connection_watcher(void *ptr)
clock_gettime(CLOCK_REALTIME, &ts);
if (timespec_cmp(&ts, &conn_idle.head->ts) >= 0) {
void *ret;
- pthread_cancel(conn_idle.head->tid);
+ pthread_t tid = conn_idle.head->tid;
+ pthread_cancel(tid);
pthread_mutex_unlock(&conn_mutex);
- pthread_join(conn_idle.head->tid, &ret);
+ pthread_join(tid, &ret);
pthread_mutex_lock(&conn_mutex);
}
}

Return to:

Send suggestions and report system problems to the System administrator.