diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-04-20 18:51:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-04-20 18:54:17 +0300 |
commit | df59e148ac7b5fa46959c89f206572738735e121 (patch) | |
tree | fac2ec0d01632ee60135d4427364e808b829e459 /src/net.c | |
parent | 4caaf454b507722908a642d25034837108ccaf16 (diff) | |
download | wydawca-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.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -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); } } |